Beispiel #1
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);
        }
Beispiel #2
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);
        }
Beispiel #3
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);
        }
Beispiel #4
0
        public static string RunTangerine()
        {
            const string projectName      = "Tangerine";
            var          projectDirectory = Path.Combine(Toolbox.CalcCitrusDirectory(), projectName);

#if WIN
            var solutionPath = Path.Combine(projectDirectory, projectName + ".Win.sln");
            MSBuild.TryGetMSBuildPath(out var msbuildPath);
            Nuget.Restore(solutionPath, msbuildPath);
            var solutionBuilder = new SolutionBuilder(
                TargetPlatform.Win,
                solutionPath,
                BuildConfiguration.Release);
#elif MAC
            var solutionPath = Path.Combine(projectDirectory, projectName + ".Win.sln");
            Nuget.Restore(solutionPath);
            var solutionBuilder = new SolutionBuilder(
                TargetPlatform.Mac,
                solutionPath,
                BuildConfiguration.Debug);                 // RELEASE requires code signing, use debug for a while.
#endif
            if (!solutionBuilder.Build())
            {
                return("Build system has returned error");
            }

            var p = new System.Diagnostics.Process();
#if WIN
            p.StartInfo.FileName = Path.Combine(
                projectDirectory,
                "Tangerine",
                "bin",
                BuildConfiguration.Release,
                "Tangerine.exe");
#elif MAC
            p.StartInfo.FileName = Path.Combine(
                projectDirectory,
                "Tangerine",
                "bin",
                BuildConfiguration.Debug,
                "Tangerine.app/Contents/MacOS/Tangerine");
            p.StartInfo.UseShellExecute = false;
            p.StartInfo.EnvironmentVariables.Clear();
            p.StartInfo.EnvironmentVariables.Add("PATH", "/usr/bin");
#endif
            p.Start();
            return(null);
        }
Beispiel #5
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);
        }
Beispiel #6
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);
        }