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); 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, project.CompilerOptions.Verbose); // do we have anything to compile? if (project.CompileTargets.Count > 0 || project.CompilerOptions.IncludePackages.Length > 0) { MtascArgumentBuilder mtasc = new MtascArgumentBuilder(project); mtasc.AddCompileTargets(); mtasc.AddOutput(); mtasc.AddClassPaths(extraClasspaths); mtasc.AddOptions(noTrace); if (project.UsesInjection) { mtasc.AddInput(); } else { mtasc.AddFrame(libraryBuilder.Frame); if (project.LibraryAssets.Count == 0) mtasc.AddHeader(); // mtasc will have to generate its own output SWF else mtasc.AddKeep(); // keep everything you added with swfmill } string mtascArgs = mtasc.ToString(); if (project.CompilerOptions.Verbose) Console.WriteLine("mtasc " + mtascArgs); if (!ProcessRunner.Run(MtascPath, mtascArgs, false, false)) throw new BuildException("Build halted with errors (mtasc)."); } }
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); } 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, project.CompilerOptions.Verbose); // do we have anything to compile? if (project.CompileTargets.Count > 0 || project.CompilerOptions.IncludePackages.Length > 0) { MtascArgumentBuilder mtasc = new MtascArgumentBuilder(project); mtasc.AddCompileTargets(); mtasc.AddOutput(); mtasc.AddClassPaths(extraClasspaths); mtasc.AddOptions(noTrace); if (project.UsesInjection) { mtasc.AddInput(); } else { mtasc.AddFrame(libraryBuilder.Frame); if (project.LibraryAssets.Count == 0) { mtasc.AddHeader(); // mtasc will have to generate its own output SWF } else { mtasc.AddKeep(); // keep everything you added with swfmill } } string mtascArgs = mtasc.ToString(); if (project.CompilerOptions.Verbose) { Console.WriteLine("mtasc " + mtascArgs); } if (!ProcessRunner.Run(MtascPath, mtascArgs, false, false)) { throw new BuildException("Build halted with errors (mtasc)."); } } }