Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/gomobile: Use parallel build for frameworks on Apple platforms #74

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
13 changes: 12 additions & 1 deletion cmd/gomobile/bind.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,13 @@ func runBind(cmd *command) error {
case isAndroidPlatform(targets[0].platform):
return goAndroidBind(gobind, pkgs, targets)
case isApplePlatform(targets[0].platform):
if buildWorkerError := validateBuildWorkers(buildWorkers); buildWorkerError != nil {
return buildWorkerError
}
if !xcodeAvailable() {
return fmt.Errorf("-target=%q requires Xcode", buildTarget)
}
return goAppleBind(gobind, pkgs, targets)
return goAppleBind(gobind, pkgs, targets, buildWorkers)
default:
return fmt.Errorf(`invalid -target=%q`, buildTarget)
}
Expand Down Expand Up @@ -321,3 +324,11 @@ func areGoModulesUsed() (bool, error) {
}
return true, nil
}

func validateBuildWorkers(workers int) error {
if workers < 1 {
return fmt.Errorf("invalid workers %d: must be >= 1", workers)
} else {
return nil
}
}
Loading