Exemple #1
0
        public static bool CleanupGame()
        {
            DeleteAllBundlesInTopDirectory();
            DeleteAllBundlesReferredInCookingRules();

            var builder = new SolutionBuilder(The.Workspace.ActivePlatform, The.Workspace.CustomSolution);

            if (!builder.Clean())
            {
                Console.WriteLine("CLEANUP FAILED");
                return(false);
            }
            return(true);
        }
Exemple #2
0
        public static string UpdateXCodeProjectAction()
        {
            var target = The.UI.GetActiveTarget();

            if (target.Platform != TargetPlatform.iOS)
            {
                UserInterface.Instance.ExitWithErrorIfPossible();
                return("Error updating XCode project: active target must target iOS platform.");
            }
            if (The.Workspace.ProjectJson.GetValue <bool>("XCodeProject/DoSvnUpdate"))
            {
                Subversion.Update(GetXCodeProjectFolder());
            }
            AssetCooker.CookForTarget(
                target,
                new [] { CookingRulesBuilder.MainBundleName }
                );
            var solutionPath = The.Workspace.GetSolutionFilePath(TargetPlatform.iOS);
            var builder      = new SolutionBuilder(TargetPlatform.iOS, solutionPath);
            var output       = new StringBuilder();

            builder.Clean();
            if (builder.Build(output))
            {
                The.UI.ScrollLogToEnd();
                string allText = output.ToString();
                var    appPath = GetGeneratedAppPath(allText);
                foreach (var line in allText.Split('\n'))
                {
                    if (line.Contains("/bin/mtouch"))
                    {
                        var mtouch = line;
                        GenerateUnsignedBinary(target, mtouch);
                        var dstPath = GetXCodeProjectDataFolder();
                        CopyContent(appPath, dstPath);
                        CopyDSYM(appPath, Path.GetDirectoryName(dstPath));
                    }
                }
            }
            else
            {
                UserInterface.Instance.ExitWithErrorIfPossible();
                return("Build system has returned error");
            }
            if (The.Workspace.ProjectJson.GetValue <bool>("XCodeProject/DoSvnCommit"))
            {
                Subversion.Commit(GetXCodeProjectFolder(), "");
            }
            return(null);
        }
Exemple #3
0
        public static bool CleanupGame(Target target)
        {
            DeleteAllBundlesInTopDirectory(target);
            DeleteAllBundlesReferredInCookingRules(target);

            var builder = new SolutionBuilder(target.Platform, target.ProjectPath);

            if (!builder.Clean())
            {
                Console.WriteLine("CLEANUP FAILED");
                return(false);
            }
            return(true);
        }
Exemple #4
0
        public static bool BuildGame(Target target, string configuration)
        {
            var builder = new SolutionBuilder(target.Platform, target.ProjectPath, configuration);

            if (target.CleanBeforeBuild == true)
            {
                builder.Clean();
            }
            if (!builder.Build())
            {
                UserInterface.Instance.ExitWithErrorIfPossible();
                return(false);
            }
            return(true);
        }
Exemple #5
0
        public static bool BuildGame(Target target)
        {
            var builder = new SolutionBuilder(target);

            if (target.CleanBeforeBuild == true)
            {
                builder.Clean();
            }
            if (!builder.Build())
            {
                UserInterface.Instance.ExitWithErrorIfPossible();
                return(false);
            }
            return(true);
        }
Exemple #6
0
        public static bool BuildGame(
            TargetPlatform platform, string solutionPath, string configuration)
        {
            var builder = new SolutionBuilder(platform, solutionPath, configuration);

            if (The.Workspace.CleanBeforeBuild)
            {
                builder.Clean();
            }
            if (!builder.Build())
            {
                UserInterface.Instance.ExitWithErrorIfPossible();
                return(false);
            }
            return(true);
        }
Exemple #7
0
        public static string UpdateXCodeProjectAction()
        {
            if (The.Workspace.ProjectJson.GetValue <bool>("XCodeProject/DoSvnUpdate"))
            {
                Subversion.Update(GetXCodeProjectFolder());
            }
            AssetCooker.Cook(TargetPlatform.iOS);
            var builder = new Orange.SolutionBuilder(TargetPlatform.iOS);
            var output  = new StringBuilder();

            builder.Clean();
            if (builder.Build(output))
            {
                The.UI.ScrollLogToEnd();
                string allText = output.ToString();
                foreach (var line in allText.Split('\n'))
                {
                    if (line.Contains("/bin/mtouch"))
                    {
                        var mtouch = line;
                        GenerateUnsignedBinary(mtouch);
                        var appPath = GetGeneratedAppPath(mtouch);
                        var dstPath = GetXCodeProjectDataFolder();
                        CopyContent(appPath, dstPath);
                        CopyDSYM(appPath, Path.GetDirectoryName(dstPath));
                    }
                }
            }
            else
            {
                UserInterface.Instance.ExitWithErrorIfPossible();
                return("Build system has returned error");
            }
            if (The.Workspace.ProjectJson.GetValue <bool>("XCodeProject/DoSvnCommit"))
            {
                Subversion.Commit(GetXCodeProjectFolder(), "");
            }
            return(null);
        }