public AggregatedProgressMonitor(IProgressMonitor masterMonitor)
 {
     this.masterMonitor = masterMonitor;
     AddSlaveMonitor (masterMonitor, MonitorAction.All);
     logger = new LogTextWriter ();
     logger.TextWritten += new LogTextEventHandler (OnWriteLog);
 }
 public BaseProgressMonitor()
 {
     progressTracker = new ProgressTracker ();
     logger = new LogTextWriter ();
     logger.TextWritten += new LogTextEventHandler (WriteLogInternal);
 }
        private bool DoCompilation(IProgressMonitor monitor, string compiler, string args, DotNetProjectConfiguration configuration, JavaCompilerParameters compilerparameters, TextWriter output, TextWriter error)
        {
            LogTextWriter chainedError = new LogTextWriter ();
            chainedError.ChainWriter (monitor.Log);
            chainedError.ChainWriter (error);

            LogTextWriter chainedOutput = new LogTextWriter ();
            chainedOutput.ChainWriter (monitor.Log);
            chainedOutput.ChainWriter (output);

            monitor.Log.WriteLine ("Compiling Java source code ...");

            Process p = Runtime.ProcessService.StartProcess (compiler, args, null, chainedOutput, chainedError, null);
            p.WaitForExit ();
            return p.ExitCode == 0;
        }
Ejemplo n.º 4
0
        protected override ICompilerResult DoBuild(IProgressMonitor monitor)
        {
            MonoProjectConfiguration conf = (MonoProjectConfiguration) ActiveConfiguration;

            StringWriter output = new StringWriter ();
            LogTextWriter tw = new LogTextWriter ();
            tw.ChainWriter (output);
            tw.ChainWriter (monitor.Log);

            ProcessWrapper proc = Runtime.ProcessService.StartProcess ("make", "PROFILE=" + conf.Profile, conf.OutputDirectory, monitor.Log, tw, null);
            proc.WaitForOutput ();

            CompilerResults cr = new CompilerResults (null);
            string[] lines = output.ToString().Split ('\n');
            foreach (string line in lines) {
                CompilerError err = CreateErrorFromString (line);
                if (err != null) cr.Errors.Add (err);
            }

            return new DefaultCompilerResult (cr, output.ToString());
        }
        void CompileToAssembly(IProgressMonitor monitor, DotNetProjectConfiguration configuration, JavaCompilerParameters compilerparameters, ProjectReferenceCollection references, TextWriter output, TextWriter error)
        {
            monitor.Log.WriteLine ("Generating assembly ...");

            LogTextWriter chainedError = new LogTextWriter ();
            chainedError.ChainWriter (monitor.Log);
            chainedError.ChainWriter (error);

            LogTextWriter chainedOutput = new LogTextWriter ();
            chainedOutput.ChainWriter (monitor.Log);
            chainedOutput.ChainWriter (output);

            string outdir = configuration.OutputDirectory;
            string outclass = Path.Combine (outdir, configuration.OutputAssembly + ".class");
            string asm = Path.GetFileNameWithoutExtension (outclass);

            string opts = "-assembly:" + asm;

            switch (configuration.CompileTarget) {
                case CompileTarget.Exe:
                    opts += " -target:exe";
                    break;
                case CompileTarget.WinExe:
                    opts += " -target:winexe";
                    break;
                case CompileTarget.Library:
                    opts += " -target:library";
                    break;
            }

            if (configuration.DebugMode)
                opts += " -debug";

            opts += " -srcpath:" + configuration.SourceDirectory;

            if (references != null) {
                foreach (ProjectReference lib in references)
                    opts += " -r:" + lib.GetReferencedFileName ();
            }

            string ikvmc = Path.Combine (Path.Combine (JavaLanguageBinding.Properties.IkvmPath, "bin"), "ikvmc.exe");

            string args = String.Format ("-c \"mono {0} {1} {2}\"", ikvmc, "*.class", opts);
            Process p = Runtime.ProcessService.StartProcess ("/bin/sh", args, configuration.OutputDirectory, chainedOutput, chainedError, null);
            p.WaitForExit ();
        }