public void AddAll(BuildCompilationDefines defines) { foreach (string value in defines._defines) { Add(value); } }
public static BuildReport Build(BuildConfig config, BuildOptions options, bool replaceScriptCompilationDefines = false, bool incrementBuildNumber = false) { string location = GetFinalBuildPath(config); BuildTargetGroup buildGroup = BuildPipeline.GetBuildTargetGroup(config.target); SaveVersion(config); // setup compilation defines BuildCompilationDefines restoreDefines = new BuildCompilationDefines(PlayerSettings.GetScriptingDefineSymbolsForGroup(buildGroup)); BuildCompilationDefines currentDefines = replaceScriptCompilationDefines ? new BuildCompilationDefines() : restoreDefines.Clone(); currentDefines.AddAll(config.defines); switch (config.type) { case BuildType.Debug: currentDefines.Add("BUILD_DEBUG"); break; case BuildType.Beta: currentDefines.Add("BUILD_BETA"); break; case BuildType.Release: currentDefines.Add("BUILD_RELEASE"); break; } // setup pre-build config.OnPreBuild(ref options); if (config.type == BuildType.Debug || config.target == BuildTarget.iOS) { options |= BuildOptions.AutoRunPlayer; } if (config.type == BuildType.Debug) { options |= BuildOptions.Development; } // build PlayerSettings.SetScriptingDefineSymbolsForGroup(buildGroup, currentDefines.ToString()); BuildPlayerOptions buildOptions = new BuildPlayerOptions(); buildOptions.scenes = config.scenes; buildOptions.locationPathName = location; buildOptions.options = options; buildOptions.target = config.target; buildOptions.targetGroup = config.targetGroup; BuildReport report = BuildPipeline.BuildPlayer(buildOptions); // cleanup PlayerSettings.SetScriptingDefineSymbolsForGroup(buildGroup, restoreDefines.ToString()); config.OnPostBuild(location); if (incrementBuildNumber) { UpdateBuildNumber(config.target); } return(report); }
public BuildCompilationDefines Clone() { BuildCompilationDefines clone = new BuildCompilationDefines(); foreach (string value in _defines) { clone._defines.Add(value); } return(clone); }
public BuildConfig(BuildTarget target, BuildTargetGroup targetGroup, string[] scenes, BuildType type, string platformName, string appendToPath = null, BuildCompilationDefines defines = null) { this.target = target; this.targetGroup = targetGroup; this.type = type; this.platformName = platformName; this.defines = defines != null?defines.Clone() : new BuildCompilationDefines(); this.appendToPath = appendToPath; this.scenes = scenes; }
public SteamBuildConfig(string depotId, BuildTarget target, string[] scenes, BuildType type, string platformName, string appendToPath = null, BuildCompilationDefines defines = null) : base(target, BuildTargetGroup.Standalone, scenes, type, platformName, appendToPath, defines) { this.depotId = depotId; }
public StandaloneBuildConfig(BuildTarget target, BuildType type, string platformName, string appendToPath = null, BuildCompilationDefines defines = null) : base(target, BuildTargetGroup.Standalone, type, platformName, appendToPath, defines) { }
public AndroidBuildConfig(BuildType type, string platformName, string appendToPath = null, BuildCompilationDefines defines = null) : base(BuildTarget.Android, BuildTargetGroup.Android, type, platformName, appendToPath, defines) { }
public BuildConfig(BuildTarget target, BuildTargetGroup targetGroup, BuildType type, string platformName, string appendToPath = null, BuildCompilationDefines defines = null) : this(target, targetGroup, EditorBuildSettingsScene.GetActiveSceneList(EditorBuildSettings.scenes), type, platformName, appendToPath, defines) { }
public iOSBuildConfig(BuildType type, string platformName, string appendToPath = null, BuildCompilationDefines defines = null, bool append = true) : base(BuildTarget.iOS, BuildTargetGroup.iOS, type, platformName, appendToPath, defines) { this.append = append; }