Exemple #1
0
        public override void Run(Configuration config, CommandArguments args)
        {
            base.Run(config, args);

            var workDir   = Path.Combine(Directory.GetCurrentDirectory(), config.StagingDirectory, Configuration.WebTarget);
            var buildArgs = string.Join(" ", GetFilesToBuild(workDir));

            buildArgs += " -s EXPORTED_FUNCTIONS=[" + string.Join(",", config.Web.ExportedFuncs.Select(s => $"\"_{s}\"")) + "]" + " -s ASSERTIONS=2";
            Console.WriteLine($"Start Emscripten build with args: '{buildArgs}'");
            ProcessTools.RunProcessAndEnsureSuccess(this, "Emscripten Build", config.Web.EmccPath, buildArgs, workDir);

            var outputPath = Path.Combine(config.BuildsDirectory, Configuration.WebTarget);

            Console.WriteLine($"Copy build to '{outputPath}'");
            IOTools.CopyDirectory(workDir, outputPath);

            Console.WriteLine($"Strip sources from '{outputPath}'");
            var filesToStrip = new List <string>();

            filesToStrip.AddRange(Directory.GetFiles(outputPath, "*.cpp", SearchOption.AllDirectories));
            filesToStrip.AddRange(Directory.GetFiles(outputPath, "*.h", SearchOption.AllDirectories));
            foreach (var file in filesToStrip)
            {
                Console.WriteLine($"Stripping '{file}'");
                File.Delete(file);
            }
        }
Exemple #2
0
        public override void Run(Configuration config, CommandArguments args)
        {
            base.Run(config, args);

            var target        = args.GetTarget(this);
            var buildFileName = Path.Combine(config.BuildsDirectory, target, config.Windows.BuildFile);

            ProcessTools.RunProcessAndEnsureSuccess(this, $"Run('{target}')", buildFileName, "");
        }
Exemple #3
0
        void RunBuildFor(string configurationName, string projectPath)
        {
            var gradleFile = Path.Combine(projectPath, "gradlew.bat");
            var gradleArgs = $"assemble{configurationName}";

            Console.WriteLine($"Run gradle build with args: '{gradleArgs}'");
            ProcessTools.RunProcessAndEnsureSuccess(this, "Gradle Build", gradleFile, gradleArgs, projectPath);

            Console.WriteLine("Stop gradle agent");
            ProcessTools.RunProcessAndEnsureSuccess(this, "Gradle Stop", gradleFile, "--stop", projectPath);
        }
Exemple #4
0
        void RunFrontendBuildFor(Configuration config, string configurationName)
        {
            var msBuildPath = config.Windows.MSBuildPath;

            Console.WriteLine(
                $"Perform frontend project build (configuration: '{configurationName}')"
                );

            var processArgs = GetFrontendProcessArgs(config, configurationName);

            ProcessTools.RunProcessAndEnsureSuccess(
                this, $"Build ('{configurationName}')", msBuildPath, processArgs
                );
        }
Exemple #5
0
        public override void Run(Configuration config, CommandArguments args)
        {
            base.Run(config, args);

            var projectPath       = config.MacOS.XcodeProjectPath;
            var target            = args.GetTarget(this);
            var configurationName = args.Get(this, "configuration");
            var outputPath        = Path.Combine(Directory.GetCurrentDirectory(), config.BuildsDirectory, target);

            var buildArgs =
                $"-project {projectPath} -scheme {target} -configuration {configurationName} build " +
                $"SYMROOT=\"{outputPath}\"";

            Console.WriteLine("Start Xcode build with args: " + buildArgs);
            ProcessTools.RunProcessAndEnsureSuccess(this, "XCode Build", "xcodebuild", buildArgs);
        }
Exemple #6
0
        void RunLibraryBuildFor(Configuration config, string configurationName, ICollection <string> platforms)
        {
            var msBuildPath = config.Windows.MSBuildPath;

            foreach (var platform in platforms)
            {
                Console.WriteLine(
                    $"Perform library project build for '{platform}' (configuration: '{configurationName}')"
                    );

                var processArgs = GetLibraryProcessArgs(config, configurationName, platform);
                ProcessTools.RunProcessAndEnsureSuccess(
                    this, $"Build ('{configurationName}', '{platform}')", msBuildPath, processArgs
                    );
            }
        }