Exemplo n.º 1
0
        /// <summary>
        /// Build from pre/post command: mxmlc
        /// </summary>
        /// <param name="workingdir">the working directory for fsch, to have full optimization make this the same for all calls </param>
        /// <param name="arguments">the mxmlc arguments</param>
        public static void BuildMXMLC(string workingdir, string arguments)
        {
            //Project project = ProjectLoader.Load(projectFile);
            //Program.BuildOptions.Language = project.Language.ToUpper();

            AS3ProjectBuilder builder = new AS3ProjectBuilder(null, Program.BuildOptions.CompilerPath, Program.BuildOptions.IpcName);

            builder.CompileWithMxmlc(workingdir, arguments, true);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Build from pre/post command: compc
 /// </summary>
 /// <param name="workingdir">the working directory for fsch, to have full optimization make this the same for all calls </param>
 /// <param name="arguments">the compc arguments</param>
 public static void BuildCOMPC(string workingdir, string arguments)
 {
     AS3ProjectBuilder builder = new AS3ProjectBuilder(null, Program.BuildOptions.CompilerPath, Program.BuildOptions.IpcName);
 }
Exemplo n.º 3
0
        protected override void DoBuild(string[] extraClassPaths, bool noTrace)
        {
            string tempFile = null;

            Environment.CurrentDirectory = project.Directory;
            try
            {
                const string objDir = "obj";
                if (!Directory.Exists(objDir))
                {
                    Directory.CreateDirectory(objDir);
                }
                tempFile = AS3ProjectBuilder.GetTempProjectFile(project);

                //create new config file
                double sdkVersion = AS3ProjectBuilder.ParseVersion(Program.BuildOptions.CompilerVersion ?? "4.0");

                // create compiler configuration file
                var projectName   = project.Name.Replace(" ", "");
                var backupConfig  = Path.Combine(objDir, projectName + "Config.old");
                var configFileTmp = Path.Combine(objDir, projectName + "Config.tmp");
                var configFile    = Path.Combine(objDir, projectName + "Config.xml");

                // backup the old Config.xml to Config.old so we can reference it
                if (File.Exists(configFile))
                {
                    File.Copy(configFile, backupConfig, true);
                }

                //write "new" config to tmp
                var config = new FlexConfigWriter(project.GetAbsolutePath(configFileTmp));
                config.WriteConfig(project, sdkVersion, extraClassPaths, !noTrace, false);

                //compare tmp to current
                var configChanged = !File.Exists(backupConfig) || !File.Exists(configFile) || !FileComparer.IsEqual(configFileTmp, configFile);

                //copy temp file to config if there is a change
                if (configChanged)
                {
                    File.Copy(configFileTmp, configFile, true);
                }

                //remove temp
                File.Delete(configFileTmp);

                var mxmlc = new MxmlcArgumentBuilder(project, sdkVersion, false);
                mxmlc.AddConfig(configFile);
                mxmlc.AddOptions(noTrace, false);
                mxmlc.AddOutput(tempFile);
                var mxmlcArgs = mxmlc.ToString();
                Console.WriteLine("mxmlc " + mxmlcArgs);
                CompileWithMxmlc(mxmlcArgs);

                // if we get here, the build was successful
                var output    = project.FixDebugReleasePath(project.OutputPathAbsolute);
                var outputDir = Path.GetDirectoryName(output);
                if (!Directory.Exists(outputDir))
                {
                    Directory.CreateDirectory(outputDir);
                }
                File.Copy(tempFile, output, true);
            }
            finally { if (tempFile != null && File.Exists(tempFile))
                      {
                          File.Delete(tempFile);
                      }
            }
        }