Exemple #1
0
        static void Build(string projectPath, string outputPath)
        {
            Console.Out.WriteLine("\nBuilding: " + projectPath);
            Console.Out.WriteLine();

            string appExePath = System.Reflection.Assembly.GetExecutingAssembly().Location;

            System.IO.FileInfo fi = new System.IO.FileInfo(appExePath);
            appExePath = Util.FixPath(fi.DirectoryName);

            //NOTE: In order to load an existing settings.xml file for debugging, you must first
            //create one using the GUI then copy it into the directory from which this assembly
            //is running (normally jsbuildconsole\bin\debug).  Otherwise it will simply use defaults.
            Options.GetInstance().Load(appExePath);

            if (cleanOutputDir != null)
            {
                //If the clean flag was specified as a param, override the project setting
                Options.GetInstance().ClearOutputDir = (bool)cleanOutputDir;
            }
            ProjectBuilder.MessageAvailable += new MessageDelegate(ProjectBuilder_MessageAvailable);
            ProjectBuilder.ProgressUpdate   += new ProgressDelegate(ProjectBuilder_ProgressUpdate);
            ProjectBuilder.BuildComplete    += new BuildCompleteDelegate(ProjectBuilder_BuildComplete);

            Project project = Project.GetInstance();

            project.Load(appExePath, projectPath);

            ProjectBuilder.Build(project, outputPath);

            Wait();
        }
Exemple #2
0
 private void Build()
 {
     try
     {
         ProjectBuilder.Build(project);
     }
     catch (Exception ex)
     {
         MessageBox.Show("An unhandled exception occurred while building:\n" + ex.ToString(),
                         "JS Builder Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         status.Text = "Build failed";
         this.Invoke(new ProgressForm.CloseDelegate(pform.Close));
     }
 }