// 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 TestPrintJsonDefaults(t *testing.T) { settings := config.Settings{} config.FillSettingsDefaults(&settings, ".") jsonD, _ := json.MarshalIndent(settings, "", "\t") t.Logf("JSON defaults: \n%+v", string(jsonD)) }