Exemple #1
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 virtual void StartBuild(ProjectBuildOptions options, IBuildFeedbackSink feedbackSink)
 {
     feedbackSink.ReportError(new BuildError {
         ErrorText = "Building project " + Name + " is not supported.", IsWarning = true
     });
     // we don't know how to build anything, report that we're done.
     feedbackSink.Done(true);
 }
 public virtual Task <bool> BuildAsync(ProjectBuildOptions options, IBuildFeedbackSink feedbackSink, IProgressMonitor progressMonitor)
 {
     feedbackSink.ReportError(new BuildError {
         ErrorText = "Building project " + Name + " is not supported.", IsWarning = true
     });
     // we don't know how to build anything, report that we're done.
     return(Task.FromResult(true));
 }
 public virtual Task <bool> BuildAsync(ProjectBuildOptions options, IBuildFeedbackSink feedbackSink, IProgressMonitor progressMonitor)
 {
     feedbackSink.ReportError(new BuildError {
         ErrorText = StringParser.Parse("${res:MainWindow.CompilerMessages.BuildingProjectIsNotSupported}", new StringTagPair("Name", Name)), IsWarning = true
     });
     // we don't know how to build anything, report that we're done.
     return(Task.FromResult(true));
 }
Exemple #5
0
 void ReportError(BuildNode source, BuildError error)
 {
     if (!error.IsWarning)
     {
         source.hasErrors = true;
     }
     results.Add(error);
     ReportMessage(source, error.ToString());
     if (combinedBuildFeedbackSink != null)
     {
         combinedBuildFeedbackSink.ReportError(error);
     }
 }
		public virtual void StartBuild(ProjectBuildOptions options, IBuildFeedbackSink feedbackSink)
		{
			feedbackSink.ReportError(new BuildError { ErrorText = "Building project " + Name + " is not supported.", IsWarning = true });
			// we don't know how to build anything, report that we're done.
			feedbackSink.Done(true);
		}
Exemple #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 ReportError(BuildError error)
 {
     sink.ReportError(error);
 }
Exemple #9
0
 public void ReportError(BuildError error)
 {
     feedbackSink.ReportError(error);
 }
Exemple #10
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);
        }
Exemple #11
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();
        }