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);
                      }
            }
        }
        protected override void DoBuild(string[] extraClasspaths, bool noTrace)
        {
            string tempFile = null;
            
            Environment.CurrentDirectory = project.Directory;
            try
            {
                string objDir = "obj";
                if (!Directory.Exists(objDir)) Directory.CreateDirectory(objDir);
                tempFile = GetTempProjectFile(project);

                //create new config file
                double sdkVersion = ParseVersion(FDBuild.Program.BuildOptions.CompilerVersion ?? "4.0");
                if (asc2Mode) sdkVersion -= 1.6;

                // create compiler configuration file
                string projectName = project.Name.Replace(" ", "");
                string backupConfig = Path.Combine(objDir, projectName + "Config.old");
                string configFileTmp = Path.Combine(objDir, projectName + "Config.tmp");
                string 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 
                FlexConfigWriter config = new FlexConfigWriter(project.GetAbsolutePath(configFileTmp));
                config.WriteConfig(project, sdkVersion, extraClasspaths, noTrace == false);

                //compare tmp to current
                bool 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);

                MxmlcArgumentBuilder mxmlc = new MxmlcArgumentBuilder(project, sdkVersion);

                mxmlc.AddConfig(configFile);
                mxmlc.AddOptions(noTrace, fcsh != null);
                mxmlc.AddOutput(tempFile);

                string mxmlcArgs = mxmlc.ToString();

                if (asc2Mode)
                {
                    mxmlcArgs = AddBaseConfig(mxmlcArgs);
                    Console.WriteLine("mxmlc-cli " + mxmlcArgs);
                }
                else Console.WriteLine("mxmlc " + mxmlcArgs);

                CompileWithMxmlc(project.Directory, mxmlcArgs, configChanged);

                // if we get here, the build was successful
                string output = project.FixDebugReleasePath(project.OutputPathAbsolute);
                string 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); }
        }