コード例 #1
0
        public static void BuildError(BuildReport report, BuildParameter parameter)
        {
            Debug.LogError("Build Error" + Environment.NewLine + JsonUtility.ToJson(parameter));

            var error = String.Join(Environment.NewLine, report.steps.SelectMany(s => s.messages).Select(m => $"{m.type} {m.content}"));

            Debug.LogError(error);

            throw new InvalidOperationException("Build Error");
        }
コード例 #2
0
        public void OnPreprocessBuild(BuildReport report)
        {
            var parameter = BuildParameter.GetActiveParameter();

            Debug.Log($"Build {report.summary.platform} Start" + Environment.NewLine + JsonUtility.ToJson(parameter));

            PlayerSettings.applicationIdentifier = parameter.BundleIdentifier;
            PlayerSettings.productName           = parameter.AppName;

            var bi = ScriptableObject.CreateInstance <BuildInformation>();

            bi.BuildDateBinary  = DateTime.Now.ToBinary();
            bi.BundleIdentifier = parameter.BundleIdentifier;
            bi.Environment      = parameter.Environment;


            bi.Save();

            SetAndroidParameters();
        }
コード例 #3
0
        public static void Build()
        {
            //Clear Directory
            if (Directory.Exists(BuildDirectory))
            {
                Directory.Delete(BuildDirectory, true);
            }

            AssetDatabase.CreateFolder("", BuildDirectory);

            var target = EditorUserBuildSettings.activeBuildTarget;


            var report = BuildPipeline.BuildPlayer(GetBuildScenes(), GetBuildPath(), target, BuildEvent.GetBuildOption(BuildParameter.GetActiveParameter()));

            if (report.summary.result == UnityEditor.Build.Reporting.BuildResult.Succeeded)
            {
                return;
            }

            BuildEvent.BuildError(report, BuildParameter.GetActiveParameter());
        }
コード例 #4
0
        public void OnPostprocessBuild(BuildReport report)
        {
            var parameter = BuildParameter.GetActiveParameter();

            Debug.Log("Build End" + Environment.NewLine + JsonUtility.ToJson(parameter));
        }
コード例 #5
0
 public static BuildOptions GetBuildOption(BuildParameter parameter)
 {
     return(BuildOptions.None);
 }
コード例 #6
0
 public static void Build(string buildParameterName)
 {
     BuildParameter.GetParameter(buildParameterName).Build();
 }