コード例 #1
0
 public void AddAll(BuildCompilationDefines defines)
 {
     foreach (string value in defines._defines)
     {
         Add(value);
     }
 }
コード例 #2
0
        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);
        }
コード例 #3
0
        public BuildCompilationDefines Clone()
        {
            BuildCompilationDefines clone = new BuildCompilationDefines();

            foreach (string value in _defines)
            {
                clone._defines.Add(value);
            }

            return(clone);
        }
コード例 #4
0
        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;
        }
コード例 #5
0
 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;
 }
コード例 #6
0
 public StandaloneBuildConfig(BuildTarget target, BuildType type, string platformName, string appendToPath = null, BuildCompilationDefines defines = null) : base(target, BuildTargetGroup.Standalone, type, platformName, appendToPath, defines)
 {
 }
コード例 #7
0
 public AndroidBuildConfig(BuildType type, string platformName, string appendToPath = null, BuildCompilationDefines defines = null) : base(BuildTarget.Android, BuildTargetGroup.Android, type, platformName, appendToPath, defines)
 {
 }
コード例 #8
0
 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)
 {
 }
コード例 #9
0
ファイル: iOSBuildConfig.cs プロジェクト: loju-games/Build
 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;
 }