示例#1
0
        public override Task <bool> BuildAsync(ProjectBuildOptions options, IBuildFeedbackSink feedbackSink, IProgressMonitor progressMonitor)
        {
            TaskCompletionSource <bool> tcs = new TaskCompletionSource <bool>();

            StartBuild(tcs, options, feedbackSink, progressMonitor);
            return(tcs.Task);
        }
示例#2
0
        public override Task <bool> BuildAsync(ProjectBuildOptions options, IBuildFeedbackSink feedbackSink, IProgressMonitor progressMonitor)
        {
            bool success = false;

            if (!VB6Helper.GetIsVB6Available())
            {
                feedbackSink.ReportError(new BuildError("", "Cannot locate VB6.EXE. Please make sure that you have entered the correct path to the VB6-directory under 'Tools -> VB6'."));
            }
            else
            {
                feedbackSink.ReportMessage(new RichText("Building the project using VB6.EXE..."));

                var      result = VB6Helper.MakeProject(_vbProject);
                string[] errors = result.Results;

                if (errors.Length == 0)
                {
                    feedbackSink.ReportMessage(new RichText("Building with VB6.EXE completed successfully!"));
                    success = true;
                }
                else
                {
                    foreach (string error in errors)
                    {
                        if (!string.IsNullOrWhiteSpace(error))
                        {
                            feedbackSink.ReportError(new BuildError("", error));
                        }
                    }
                }
            }

            return(Task.FromResult(success));
        }
 public override Task <bool> BuildAsync(ProjectBuildOptions options, IBuildFeedbackSink feedbackSink, IProgressMonitor progressMonitor)
 {
     if (this.MinimumSolutionVersion == SolutionFormatVersion.VS2005)
     {
         return(SD.MSBuildEngine.BuildAsync(
                    this, options, feedbackSink, progressMonitor.CancellationToken,
                    new [] { Path.Combine(FileUtility.ApplicationRootPath, @"bin\SharpDevelop.CheckMSBuild35Features.targets") }));
     }
     else
     {
         return(base.BuildAsync(options, feedbackSink, progressMonitor));
     }
 }
示例#4
0
 public override void StartBuild(ProjectBuildOptions options, IBuildFeedbackSink feedbackSink)
 {
     if (this.MinimumSolutionVersion == Solution.SolutionVersionVS2005)
     {
         MSBuildEngine.StartBuild(this,
                                  options,
                                  feedbackSink,
                                  MSBuildEngine.AdditionalTargetFiles.Concat(
                                      new [] { Path.Combine(MSBuildEngine.SharpDevelopBinPath, "SharpDevelop.CheckMSBuild35Features.targets") }));
     }
     else
     {
         base.StartBuild(options, feedbackSink);
     }
 }
示例#5
0
 public void StartBuild(ProjectBuildOptions buildOptions, IBuildFeedbackSink feedbackSink)
 {
     throw new NotImplementedException();
 }
示例#6
0
 public ICollection <IBuildable> GetBuildDependencies(ProjectBuildOptions buildOptions)
 {
     throw new NotImplementedException();
 }
示例#7
0
        public override void StartBuild(ProjectBuildOptions options, IBuildFeedbackSink feedbackSink)
        {
            string productDir = GetPathFromRegistry(@"SOFTWARE\Microsoft\VisualStudio\9.0\Setup\VC", "ProductDir");

            string batFile = "vcvars32.bat";

            if (options.Platform == "x64")
            {
                batFile = "vcvars64.bat";
            }

            string commonTools =
                GetFile(productDir != null ? Path.Combine(productDir, "bin\\" + batFile) : null)
                ?? GetFile("%VS90COMNTOOLS%\\" + batFile)
                ?? GetFile("%VS80COMNTOOLS%\\" + batFile);

            Process p = new Process();

            p.StartInfo.FileName  = "cmd.exe";
            p.StartInfo.Arguments = "/C";
            if (!string.IsNullOrEmpty(commonTools))
            {
                p.StartInfo.Arguments += " call \"" + commonTools + "\" &&";
            }
            p.StartInfo.Arguments += " vcbuild";
            if (options.Target == BuildTarget.Build)
            {
                // OK
            }
            else if (options.Target == BuildTarget.Clean)
            {
                p.StartInfo.Arguments += " /clean";
            }
            else if (options.Target == BuildTarget.Rebuild)
            {
                p.StartInfo.Arguments += " /rebuild";
            }
            p.StartInfo.Arguments += " /showenv";
            p.StartInfo.Arguments += " \"" + this.FileName + "\"";
            p.StartInfo.Arguments += " \"/error:Error: \"";
            p.StartInfo.Arguments += " \"/warning:Warning: \"";

            p.StartInfo.WorkingDirectory       = this.Directory;
            p.StartInfo.RedirectStandardOutput = true;
            p.StartInfo.RedirectStandardError  = true;
            p.StartInfo.CreateNoWindow         = true;
            p.StartInfo.UseShellExecute        = false;
            p.StartInfo.EnvironmentVariables["VCBUILD_DEFAULT_CFG"] = options.Configuration + "|" + options.Platform;
            p.StartInfo.EnvironmentVariables["SolutionPath"]        = ParentSolution.FileName;

            p.EnableRaisingEvents = true;
            p.OutputDataReceived += delegate(object sender, DataReceivedEventArgs e) {
                if (!string.IsNullOrEmpty(e.Data))
                {
                    BuildError error = ParseError(e.Data);
                    if (error != null)
                    {
                        feedbackSink.ReportError(error);
                    }
                    else
                    {
                        feedbackSink.ReportMessage(e.Data);
                    }
                }
            };
            p.ErrorDataReceived += delegate(object sender, DataReceivedEventArgs e) {
                if (!string.IsNullOrEmpty(e.Data))
                {
                    BuildError error = ParseError(e.Data);
                    if (error != null)
                    {
                        feedbackSink.ReportError(error);
                    }
                    else
                    {
                        feedbackSink.ReportError(new BuildError(null, e.Data));
                    }
                }
            };
            p.Exited += delegate(object sender, EventArgs e) {
                p.CancelErrorRead();
                p.CancelOutputRead();
                feedbackSink.Done(p.ExitCode == 0);
                p.Dispose();
            };

            feedbackSink.ReportMessage("Building " + this.Name);
            feedbackSink.ReportMessage(p.StartInfo.FileName + " " + p.StartInfo.Arguments);
            p.Start();
            p.BeginOutputReadLine();
            p.BeginErrorReadLine();
        }
 public void StartBuild(ProjectBuildOptions buildOptions, IBuildFeedbackSink feedbackSink)
 {
     // SharpDevelop already has built our dependencies, so we're done immediately.
     feedbackSink.Done(true);
 }
 public ICollection <IBuildable> GetBuildDependencies(ProjectBuildOptions buildOptions)
 {
     return(projects);
 }
 public void StartBuild(ProjectBuildOptions buildOptions, IBuildFeedbackSink feedbackSink)
 {
 }
示例#11
0
 public Task <bool> BaseBuild(ProjectBuildOptions options, IBuildFeedbackSink feedbackSink, IProgressMonitor progressMonitor)
 {
     return(base.BuildAsync(options, feedbackSink, progressMonitor));
 }