// goXC is the goxc startpoint // In theory you could call this with a slice of flags func goXC(call []string) error { interpretFlags(call) workingDirectory := getWorkingDir() mergeConfigIntoSettings(workingDirectory) if isWriteConfig || isWriteLocalConfig { err := config.WriteJsonConfig(workingDirectory, settings, configName, isWriteLocalConfig) if err != nil { log.Printf("Could not write config file: %v", err) } //0.2.5 writeConfig now just exits after writing config return err } else { //0.2.3 fillDefaults should only happen after writing config config.FillSettingsDefaults(&settings, workingDirectory) tasks.FillTaskSettingsDefaults(&settings) if settings.IsVerbose() { log.Printf("Final settings %+v", settings) } destPlatforms := platforms.GetDestPlatforms(settings.Os, settings.Arch) destPlatforms = platforms.ApplyBuildConstraints(settings.BuildConstraints, destPlatforms) err := tasks.RunTasks(workingDirectory, destPlatforms, &settings, maxProcessors) if err != nil { log.Printf("RunTasks error: %+v", err) } return err } }
func setupZip(tp TaskParams) ([]platforms.Platform, error) { //for previous versions ... //osOptions := settings.GetTaskSettingMap(TASK_ARCHIVE, "os") if _, keyExists := tp.Settings.TaskSettings[TASK_ZIP]["os"]; keyExists { return []platforms.Platform{}, errors.New("Option 'os' is no longer supported! Please use 'platforms' instead, specified as a 'build contraint'. e.g. 'linux,386'") } bc := tp.Settings.GetTaskSettingString(TASK_ZIP, "platforms") destPlatforms := platforms.ApplyBuildConstraints(bc, tp.DestPlatforms) return destPlatforms, nil }
func runTaskZip(tp TaskParams, dest platforms.Platform, errchan chan error) { bcTopLevelDir := tp.Settings.GetTaskSettingString(TASK_ZIP, "include-top-level-dir") destPlatforms := platforms.ApplyBuildConstraints(bcTopLevelDir, []platforms.Platform{dest}) isIncludeTopLevelDir := platforms.ContainsPlatform(destPlatforms, dest) runArchiveTask(tp, dest, errchan, "zip", archive.Zip, isIncludeTopLevelDir) }