Example #1
0
        protected override void DoBuild(string[] extraClasspaths, bool noTrace)
        {
            Environment.CurrentDirectory = project.Directory;

            string output    = project.FixDebugReleasePath(project.OutputPathAbsolute);
            string outputDir = Path.GetDirectoryName(project.OutputPathAbsolute);

            if (!Directory.Exists(outputDir))
            {
                Directory.CreateDirectory(outputDir);
            }

            string serverPort = Environment.ExpandEnvironmentVariables("%HAXE_SERVER_PORT%");
            string connect    = (!serverPort.StartsWith("%") && serverPort != "0")
                ? "--connect " + serverPort : "";

            if (project.IsNmeOutput && !string.IsNullOrEmpty(project.TargetBuild))
            {
                haxePath = haxePath.Replace("haxe.exe", "haxelib.exe");
                string config      = project.TargetBuild;
                string haxeNmeArgs = String.Join(" ", BuildNmeCommand(extraClasspaths, output, config, noTrace, null));// +" " + connect;
                Console.WriteLine("haxelib " + haxeNmeArgs);
                if (!ProcessRunner.Run(haxePath, haxeNmeArgs, false, false))
                {
                    throw new BuildException("Build halted with errors (haxelib.exe).");
                }
                return;
            }

            // always use relative path for CPP (because it prepends ./)
            if (project.IsCppOutput)
            {
                output = project.FixDebugReleasePath(project.OutputPath);
            }

            if (project.IsFlashOutput)
            {
                SwfmillLibraryBuilder libraryBuilder = new SwfmillLibraryBuilder();

                // before doing anything else, make sure any resources marked as "keep updated"
                // are properly kept up to date if possible
                libraryBuilder.KeepUpdated(project);

                // if we have any resources, build our library file and run swfmill on it
                libraryBuilder.BuildLibrarySwf(project, false);
            }

            string haxeArgs = connect + " " + String.Join(" ", project.BuildHXML(extraClasspaths, output, noTrace));

            Console.WriteLine("haxe " + haxeArgs);

            if (!ProcessRunner.Run(haxePath, haxeArgs, false, false))
            {
                throw new BuildException("Build halted with errors (haxe.exe).");
            }
        }
Example #2
0
        protected override void DoBuild(string[] extraClasspaths, bool noTrace)
        {
            Environment.CurrentDirectory = project.Directory;

            string output    = project.FixDebugReleasePath(project.OutputPathAbsolute);
            string outputDir = Path.GetDirectoryName(project.OutputPathAbsolute);

            if (!Directory.Exists(outputDir))
            {
                Directory.CreateDirectory(outputDir);
            }

            string serverPort = Environment.ExpandEnvironmentVariables("%HAXE_SERVER_PORT%");
            string connect    = (!serverPort.StartsWith("%") && serverPort != "0")
                ? "--connect " + serverPort : "";

            if (project.MovieOptions.HasPlatformSupport && project.MovieOptions.PlatformSupport.ExternalToolchain != null)
            {
                Console.WriteLine("Automatic NME/OpenFL build by FDBuild is deprecated.");
                return;
            }

            // always use relative path for CPP (because it prepends ./)
            //if (project.IsCppOutput)
            //    output = project.FixDebugReleasePath(project.OutputPath);

            if (project.IsFlashOutput)
            {
                SwfmillLibraryBuilder libraryBuilder = new SwfmillLibraryBuilder();

                // before doing anything else, make sure any resources marked as "keep updated"
                // are properly kept up to date if possible
                libraryBuilder.KeepUpdated(project);

                // if we have any resources, build our library file and run swfmill on it
                libraryBuilder.BuildLibrarySwf(project, false);
            }

            string haxeArgs = connect + " " + String.Join(" ", project.BuildHXML(extraClasspaths, output, noTrace));

            Console.WriteLine("haxe " + haxeArgs);

            if (!ProcessRunner.Run(haxePath, haxeArgs, false, false))
            {
                throw new BuildException("Build halted with errors (haxe.exe).");
            }
        }
        protected override void DoBuild(string[] extraClasspaths, bool noTrace)
        {
            Environment.CurrentDirectory = project.Directory;

            string outputDir = Path.GetDirectoryName(project.OutputPathAbsolute);

            if (!Directory.Exists(outputDir))
            {
                Directory.CreateDirectory(outputDir);
            }

            if (project.IsFlashOutput)
            {
                SwfmillLibraryBuilder libraryBuilder = new SwfmillLibraryBuilder();

                // before doing anything else, make sure any resources marked as "keep updated"
                // are properly kept up to date if possible
                libraryBuilder.KeepUpdated(project);

                // if we have any resources, build our library file and run swfmill on it
                libraryBuilder.BuildLibrarySwf(project, false);
            }

            string output = project.FixDebugReleasePath(project.OutputPathAbsolute);

            // always use relative path for CPP (because it prepends ./)
            if (project.IsCppOutput)
            {
                output = project.OutputPath;
            }

            string haxeArgs = String.Join(" ", project.BuildHXML(extraClasspaths, output, noTrace));

            Console.WriteLine("haxe " + haxeArgs);

            if (!ProcessRunner.Run(haxePath, haxeArgs, false))
            {
                throw new BuildException("Build halted with errors (haxe.exe).");
            }
        }