Author: mhutch
Date: 2007-10-15 18:20:59 -0400 (Mon, 15 Oct 2007)
New Revision: 87540
Modified:
trunk/monodevelop/Extras/AspNetAddIn/AspNetAddIn.mdp
trunk/monodevelop/Extras/AspNetAddIn/ChangeLog
trunk/monodevelop/Extras/AspNetAddIn/Project/AspNetAppProject.cs
trunk/monodevelop/Extras/AspNetAddIn/Project/VerifyCodeBehindBuildStep.cs
Log:
* Project/AspNetAppProject.cs: Copy refs to output path during compile.
Not sure it's necessary, as the Run/Deploy commands do the copy
too, and people shouldn't be running their site without executing
one of these commands first. However, we have had a few bug reports
about this behaviour, so it's better to do what people expect.
* Project/VerifyCodeBehindBuildStep.cs: Report ASP.NET parser and
Codebehind member generation errors as compile warnings, with
file/line number info. Use Gettext for i18n of warnings.
* AspNetAddIn.mdp: Updated.
Modified: trunk/monodevelop/Extras/AspNetAddIn/AspNetAddIn.mdp
===================================================================
--- trunk/monodevelop/Extras/AspNetAddIn/AspNetAddIn.mdp 2007-10-15
22:10:21 UTC (rev 87539)
+++ trunk/monodevelop/Extras/AspNetAddIn/AspNetAddIn.mdp 2007-10-15
22:20:59 UTC (rev 87540)
@@ -7,93 +7,93 @@
<CodeGeneration compiler="Csc" warninglevel="4" optimize="True"
unsafecodeallowed="False" generateoverflowchecks="True" mainclass=""
generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
</Configuration>
<Configuration name="Release" ctype="DotNetProjectConfiguration">
- <Output directory="./bin/Release" assembly="AspNetAddIn" />
+ <Output directory="bin/Release" assembly="AspNetAddIn" />
<Build debugmode="False" target="Exe" />
<Execution runwithwarnings="True" consolepause="True" runtime="MsNet"
clr-version="Net_2_0" />
<CodeGeneration compiler="Csc" warninglevel="4" optimize="True"
unsafecodeallowed="False" generateoverflowchecks="True"
generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
</Configuration>
</Configurations>
<Contents>
- <File name="./AspNetAddIn.addin.xml" subtype="Code"
buildaction="EmbedAsResource" />
- <File name="./Project/AspNetAppProject.cs" subtype="Code"
buildaction="Compile" />
- <File name="./Project/AspNetAppProjectBinding.cs" subtype="Code"
buildaction="Compile" />
- <File name="./Project/AspNetAppProjectConfiguration.cs" subtype="Code"
buildaction="Compile" />
- <File name="./Project/AspNetFileDescriptionTemplate.cs" subtype="Code"
buildaction="Compile" />
- <File name="./Makefile.am" subtype="Code" buildaction="Nothing" />
- <File name="./Templates/WebForm-Empty.xft.xml" subtype="Code"
buildaction="EmbedAsResource" />
- <File name="./Templates/WebHandler-Empty.xft.xml" subtype="Code"
buildaction="EmbedAsResource" />
- <File name="./Templates/WebControl-Empty.xft.xml" subtype="Code"
buildaction="EmbedAsResource" />
- <File name="./Templates/WebControl-CodeBehind.xft.xml" subtype="Code"
buildaction="EmbedAsResource" />
- <File name="./Templates/WebForm-CodeBehind.xft.xml" subtype="Code"
buildaction="EmbedAsResource" />
- <File name="./Templates/WebHandler-CodeBehind.xft.xml" subtype="Code"
buildaction="EmbedAsResource" />
- <File name="./Templates/WebApplication.xpt.xml" subtype="Code"
buildaction="EmbedAsResource" />
- <File name="./Parser/Internal/AspParser.cs" subtype="Code"
buildaction="Compile" />
- <File name="./Parser/Internal/AspTokenizer.cs" subtype="Code"
buildaction="Compile" />
- <File name="./Parser/Internal/Location.cs" subtype="Code"
buildaction="Compile" />
- <File name="./Parser/Internal/StrUtils.cs" subtype="Code"
buildaction="Compile" />
- <File name="./Parser/Internal/ParseException.cs" subtype="Code"
buildaction="Compile" />
- <File name="./Parser/Internal/Directive.cs" subtype="Code"
buildaction="Compile" />
- <File name="./Parser/Internal/TagType.cs" subtype="Code"
buildaction="Compile" />
- <File name="./Parser/Tree/DirectiveNode.cs" subtype="Code"
buildaction="Compile" />
- <File name="./Parser/Tree/RootNode.cs" subtype="Code"
buildaction="Compile" />
- <File name="./Parser/Tree/CodeRenderNode.cs" subtype="Code"
buildaction="Compile" />
- <File name="./Parser/Tree/TagNode.cs" subtype="Code" buildaction="Compile"
/>
- <File name="./Parser/Tree/Node.cs" subtype="Code" buildaction="Compile" />
- <File name="./Parser/Tree/Visitor.cs" subtype="Code" buildaction="Compile"
/>
- <File name="./Parser/Tree/ServerIncludeNode.cs" subtype="Code"
buildaction="Compile" />
- <File name="./Parser/Tree/TextNode.cs" subtype="Code"
buildaction="Compile" />
- <File name="./Parser/Tree/ParentNode.cs" subtype="Code"
buildaction="Compile" />
- <File name="./Parser/Tree/ILocation.cs" subtype="Code"
buildaction="Compile" />
- <File name="./Parser/Internal/TagAttributes.cs" subtype="Code"
buildaction="Compile" />
- <File name="./Parser/Tree/ServerCommentNode.cs" subtype="Code"
buildaction="Compile" />
- <File name="./Parser/MemberListVisitor.cs" subtype="Code"
buildaction="Compile" />
- <File name="./Parser/PageInfoVisitor.cs" subtype="Code"
buildaction="Compile" />
- <File name="./Parser/WebFormReferenceManager.cs" subtype="Code"
buildaction="Compile" />
- <File name="./Parser/Document.cs" subtype="Code" buildaction="Compile" />
- <File name="./Project/XspParameters.cs" subtype="Code"
buildaction="Compile" />
- <File name="./Gui/XspOptionsPanel.cs" subtype="Code" buildaction="Compile"
/>
- <File name="./Templates/WebService-Empty.xft.xml" subtype="Code"
buildaction="EmbedAsResource" />
- <File name="./Templates/WebService-CodeBehind.xft.xml" subtype="Code"
buildaction="EmbedAsResource" />
- <File name="./Project/AspNetDisplayBinding.cs" subtype="Code"
buildaction="Compile" />
- <File name="./Project/AspNetCodeBehindProvider.cs" subtype="Code"
buildaction="Compile" />
- <File name="./Project/VerifyCodeBehindBuildStep.cs" subtype="Code"
buildaction="Compile" />
- <File name="./Gui/AspNetConfigurationPanel.cs" subtype="Code"
buildaction="Compile" />
- <File name="./Templates/MasterPage-CodeBehind.xft.xml" subtype="Code"
buildaction="EmbedAsResource" />
- <File name="./Templates/MasterPage-Empty.xft.xml" subtype="Code"
buildaction="EmbedAsResource" />
- <File name="./gtk-gui/generated.cs" subtype="Code" buildaction="Compile" />
- <File name="./Project/CodeBehind.cs" subtype="Code" buildaction="Compile"
/>
- <File name="./gtk-gui/gui.stetic" subtype="Code"
buildaction="EmbedAsResource" />
- <File name="./gtk-gui/objects.xml" subtype="Code"
buildaction="EmbedAsResource" />
- <File name="./gtk-gui/AspNetAddIn.AspNetConfigurationPanelWidget.cs"
subtype="Code" buildaction="Compile" />
- <File name="./Gui/AspNetConfigurationPanelWidget.cs" subtype="Code"
buildaction="Compile" />
- <File name="./ChangeLog" subtype="Code" buildaction="Nothing" />
- <File name="./Templates/GlobalAsax-CodeBehind.xft.xml" subtype="Code"
buildaction="EmbedAsResource" />
- <File name="./Templates/GlobalAsax-Empty.xft.xml" subtype="Code"
buildaction="EmbedAsResource" />
- <File name="./Templates/MasterPage-CodeBehindNonPartial.xft.xml"
subtype="Code" buildaction="EmbedAsResource" />
- <File name="./Templates/WebControl-CodeBehindNonPartial.xft.xml"
subtype="Code" buildaction="EmbedAsResource" />
- <File name="./Templates/WebForm-CodeBehindNonPartial.xft.xml"
subtype="Code" buildaction="EmbedAsResource" />
- <File name="./Templates/WebApplication-Empty.xpt.xml" subtype="Code"
buildaction="EmbedAsResource" />
- <File name="./Templates/WebConfig-Application.xft.xml" subtype="Code"
buildaction="EmbedAsResource" />
- <File name="./Templates/WebConfig-SubDir.xft.xml" subtype="Code"
buildaction="EmbedAsResource" />
- <File name="./Project/ProjectFolderNodeBuilderExtension.cs" subtype="Code"
buildaction="Compile" />
- <File name="./Project/AspNetCommands.cs" subtype="Code"
buildaction="Compile" />
- <File name="./gtk-gui/AspNetAddIn.XspOptionsPanelWidget.cs" subtype="Code"
buildaction="Compile" />
- <File name="./Gui/XspOptionsPanelWidget.cs" subtype="Code"
buildaction="Compile" />
- <File name="./Deployment/WebDeployOptionsPanelWidget.cs" subtype="Code"
buildaction="Compile" />
- <File name="./Deployment/WebDeployOptionsPanel.cs" subtype="Code"
buildaction="Compile" />
- <File
name="./gtk-gui/MonoDevelop.AspNet.Deployment.WebDeployOptionsPanelWidget.cs"
subtype="Code" buildaction="Compile" />
- <File name="./Deployment/WebDeployTargetCollection.cs" subtype="Code"
buildaction="Compile" />
- <File name="./Deployment/WebDeployTarget.cs" subtype="Code"
buildaction="Compile" />
- <File name="./Deployment/WebTargetEditor.cs" subtype="Code"
buildaction="Compile" />
- <File name="./gtk-gui/MonoDevelop.AspNet.Deployment.WebTargetEditor.cs"
subtype="Code" buildaction="Compile" />
- <File name="./Deployment/WebDeployTargetEditor.cs" subtype="Code"
buildaction="Compile" />
- <File
name="./gtk-gui/MonoDevelop.AspNet.Deployment.WebDeployTargetEditor.cs"
subtype="Code" buildaction="Compile" />
- <File name="./Deployment/WebDeployLaunchDialog.cs" subtype="Code"
buildaction="Compile" />
- <File
name="./gtk-gui/MonoDevelop.AspNet.Deployment.WebDeployLaunchDialog.cs"
subtype="Code" buildaction="Compile" />
- <File name="./Deployment/WebDeployService.cs" subtype="Code"
buildaction="Compile" />
- <File name="./Deployment/WebDeployCommands.cs" subtype="Code"
buildaction="Compile" />
- <File name="./Project/AspNetMSBuildProjectExtension.cs" subtype="Code"
buildaction="Compile" />
- <File name="./Deployment/WebDeployResolver.cs" subtype="Code"
buildaction="Compile" />
+ <File name="AspNetAddIn.addin.xml" subtype="Code"
buildaction="EmbedAsResource" />
+ <File name="Project/AspNetAppProject.cs" subtype="Code"
buildaction="Compile" />
+ <File name="Project/AspNetAppProjectBinding.cs" subtype="Code"
buildaction="Compile" />
+ <File name="Project/AspNetAppProjectConfiguration.cs" subtype="Code"
buildaction="Compile" />
+ <File name="Project/AspNetFileDescriptionTemplate.cs" subtype="Code"
buildaction="Compile" />
+ <File name="Makefile.am" subtype="Code" buildaction="Nothing" />
+ <File name="Templates/WebForm-Empty.xft.xml" subtype="Code"
buildaction="EmbedAsResource" />
+ <File name="Templates/WebHandler-Empty.xft.xml" subtype="Code"
buildaction="EmbedAsResource" />
+ <File name="Templates/WebControl-Empty.xft.xml" subtype="Code"
buildaction="EmbedAsResource" />
+ <File name="Templates/WebControl-CodeBehind.xft.xml" subtype="Code"
buildaction="EmbedAsResource" />
+ <File name="Templates/WebForm-CodeBehind.xft.xml" subtype="Code"
buildaction="EmbedAsResource" />
+ <File name="Templates/WebHandler-CodeBehind.xft.xml" subtype="Code"
buildaction="EmbedAsResource" />
+ <File name="Templates/WebApplication.xpt.xml" subtype="Code"
buildaction="EmbedAsResource" />
+ <File name="Parser/Internal/AspParser.cs" subtype="Code"
buildaction="Compile" />
+ <File name="Parser/Internal/AspTokenizer.cs" subtype="Code"
buildaction="Compile" />
+ <File name="Parser/Internal/Location.cs" subtype="Code"
buildaction="Compile" />
+ <File name="Parser/Internal/StrUtils.cs" subtype="Code"
buildaction="Compile" />
+ <File name="Parser/Internal/ParseException.cs" subtype="Code"
buildaction="Compile" />
+ <File name="Parser/Internal/Directive.cs" subtype="Code"
buildaction="Compile" />
+ <File name="Parser/Internal/TagType.cs" subtype="Code"
buildaction="Compile" />
+ <File name="Parser/Tree/DirectiveNode.cs" subtype="Code"
buildaction="Compile" />
+ <File name="Parser/Tree/RootNode.cs" subtype="Code" buildaction="Compile"
/>
+ <File name="Parser/Tree/CodeRenderNode.cs" subtype="Code"
buildaction="Compile" />
+ <File name="Parser/Tree/TagNode.cs" subtype="Code" buildaction="Compile" />
+ <File name="Parser/Tree/Node.cs" subtype="Code" buildaction="Compile" />
+ <File name="Parser/Tree/Visitor.cs" subtype="Code" buildaction="Compile" />
+ <File name="Parser/Tree/ServerIncludeNode.cs" subtype="Code"
buildaction="Compile" />
+ <File name="Parser/Tree/TextNode.cs" subtype="Code" buildaction="Compile"
/>
+ <File name="Parser/Tree/ParentNode.cs" subtype="Code"
buildaction="Compile" />
+ <File name="Parser/Tree/ILocation.cs" subtype="Code" buildaction="Compile"
/>
+ <File name="Parser/Internal/TagAttributes.cs" subtype="Code"
buildaction="Compile" />
+ <File name="Parser/Tree/ServerCommentNode.cs" subtype="Code"
buildaction="Compile" />
+ <File name="Parser/MemberListVisitor.cs" subtype="Code"
buildaction="Compile" />
+ <File name="Parser/PageInfoVisitor.cs" subtype="Code"
buildaction="Compile" />
+ <File name="Parser/WebFormReferenceManager.cs" subtype="Code"
buildaction="Compile" />
+ <File name="Parser/Document.cs" subtype="Code" buildaction="Compile" />
+ <File name="Project/XspParameters.cs" subtype="Code" buildaction="Compile"
/>
+ <File name="Gui/XspOptionsPanel.cs" subtype="Code" buildaction="Compile" />
+ <File name="Templates/WebService-Empty.xft.xml" subtype="Code"
buildaction="EmbedAsResource" />
+ <File name="Templates/WebService-CodeBehind.xft.xml" subtype="Code"
buildaction="EmbedAsResource" />
+ <File name="Project/AspNetDisplayBinding.cs" subtype="Code"
buildaction="Compile" />
+ <File name="Project/AspNetCodeBehindProvider.cs" subtype="Code"
buildaction="Compile" />
+ <File name="Project/VerifyCodeBehindBuildStep.cs" subtype="Code"
buildaction="Compile" />
+ <File name="Gui/AspNetConfigurationPanel.cs" subtype="Code"
buildaction="Compile" />
+ <File name="Templates/MasterPage-CodeBehind.xft.xml" subtype="Code"
buildaction="EmbedAsResource" />
+ <File name="Templates/MasterPage-Empty.xft.xml" subtype="Code"
buildaction="EmbedAsResource" />
+ <File name="gtk-gui/generated.cs" subtype="Code" buildaction="Compile" />
+ <File name="Project/CodeBehind.cs" subtype="Code" buildaction="Compile" />
+ <File name="gtk-gui/gui.stetic" subtype="Code"
buildaction="EmbedAsResource" />
+ <File name="gtk-gui/objects.xml" subtype="Code"
buildaction="EmbedAsResource" />
+ <File name="gtk-gui/AspNetAddIn.AspNetConfigurationPanelWidget.cs"
subtype="Code" buildaction="Compile" />
+ <File name="Gui/AspNetConfigurationPanelWidget.cs" subtype="Code"
buildaction="Compile" />
+ <File name="ChangeLog" subtype="Code" buildaction="Nothing" />
+ <File name="Templates/GlobalAsax-CodeBehind.xft.xml" subtype="Code"
buildaction="EmbedAsResource" />
+ <File name="Templates/GlobalAsax-Empty.xft.xml" subtype="Code"
buildaction="EmbedAsResource" />
+ <File name="Templates/MasterPage-CodeBehindNonPartial.xft.xml"
subtype="Code" buildaction="EmbedAsResource" />
+ <File name="Templates/WebControl-CodeBehindNonPartial.xft.xml"
subtype="Code" buildaction="EmbedAsResource" />
+ <File name="Templates/WebForm-CodeBehindNonPartial.xft.xml" subtype="Code"
buildaction="EmbedAsResource" />
+ <File name="Templates/WebApplication-Empty.xpt.xml" subtype="Code"
buildaction="EmbedAsResource" />
+ <File name="Templates/WebConfig-Application.xft.xml" subtype="Code"
buildaction="EmbedAsResource" />
+ <File name="Templates/WebConfig-SubDir.xft.xml" subtype="Code"
buildaction="EmbedAsResource" />
+ <File name="Project/ProjectFolderNodeBuilderExtension.cs" subtype="Code"
buildaction="Compile" />
+ <File name="Project/AspNetCommands.cs" subtype="Code"
buildaction="Compile" />
+ <File name="gtk-gui/AspNetAddIn.XspOptionsPanelWidget.cs" subtype="Code"
buildaction="Compile" />
+ <File name="Gui/XspOptionsPanelWidget.cs" subtype="Code"
buildaction="Compile" />
+ <File name="Deployment/WebDeployOptionsPanelWidget.cs" subtype="Code"
buildaction="Compile" />
+ <File name="Deployment/WebDeployOptionsPanel.cs" subtype="Code"
buildaction="Compile" />
+ <File
name="gtk-gui/MonoDevelop.AspNet.Deployment.WebDeployOptionsPanelWidget.cs"
subtype="Code" buildaction="Compile" />
+ <File name="Deployment/WebDeployTargetCollection.cs" subtype="Code"
buildaction="Compile" />
+ <File name="Deployment/WebDeployTarget.cs" subtype="Code"
buildaction="Compile" />
+ <File name="Deployment/WebTargetEditor.cs" subtype="Code"
buildaction="Compile" />
+ <File name="gtk-gui/MonoDevelop.AspNet.Deployment.WebTargetEditor.cs"
subtype="Code" buildaction="Compile" />
+ <File name="Deployment/WebDeployTargetEditor.cs" subtype="Code"
buildaction="Compile" />
+ <File
name="gtk-gui/MonoDevelop.AspNet.Deployment.WebDeployTargetEditor.cs"
subtype="Code" buildaction="Compile" />
+ <File name="Deployment/WebDeployLaunchDialog.cs" subtype="Code"
buildaction="Compile" />
+ <File
name="gtk-gui/MonoDevelop.AspNet.Deployment.WebDeployLaunchDialog.cs"
subtype="Code" buildaction="Compile" />
+ <File name="Deployment/WebDeployService.cs" subtype="Code"
buildaction="Compile" />
+ <File name="Deployment/WebDeployCommands.cs" subtype="Code"
buildaction="Compile" />
+ <File name="Project/AspNetMSBuildProjectExtension.cs" subtype="Code"
buildaction="Compile" />
+ <File name="Deployment/WebDeployResolver.cs" subtype="Code"
buildaction="Compile" />
</Contents>
<References>
<ProjectReference type="Project" localcopy="False"
refto="MonoDevelop.Components" />
Modified: trunk/monodevelop/Extras/AspNetAddIn/ChangeLog
===================================================================
--- trunk/monodevelop/Extras/AspNetAddIn/ChangeLog 2007-10-15 22:10:21 UTC
(rev 87539)
+++ trunk/monodevelop/Extras/AspNetAddIn/ChangeLog 2007-10-15 22:20:59 UTC
(rev 87540)
@@ -1,3 +1,15 @@
+2007-10-15 Michael Hutchinson <[EMAIL PROTECTED]>
+
+ * Project/AspNetAppProject.cs: Copy refs to output path during compile.
Not
+ sure it's necessary, as the Run/Deploy commands do the copy too, and
+ people shouldn't be running their site without executing one of these
+ commands first. However, we have had a few bug reports about this
+ behaviour, so it's better to do what people expect.
+ * Project/VerifyCodeBehindBuildStep.cs: Report ASP.NET parser and
Codebehind
+ member generation errors as compile warnings, with file/line number
+ info. Use Gettext for i18n of warnings.
+ * AspNetAddIn.mdp: Updated.
+
2007-10-12 Michael Hutchinson <[EMAIL PROTECTED]>
* Project/AspNetAppProjectConfiguration.cs: Allowing changing the output
Modified: trunk/monodevelop/Extras/AspNetAddIn/Project/AspNetAppProject.cs
===================================================================
--- trunk/monodevelop/Extras/AspNetAddIn/Project/AspNetAppProject.cs
2007-10-15 22:10:21 UTC (rev 87539)
+++ trunk/monodevelop/Extras/AspNetAddIn/Project/AspNetAppProject.cs
2007-10-15 22:20:59 UTC (rev 87540)
@@ -183,6 +183,17 @@
#region build/prebuild/execute
+ // all this does is makes sure that references are copied after
building
+ // it's not strictly necessary, as the Run/Deploy commands do
it too..
+ // but some users expect it to happen during a compile, so it's
easier all round this way
+ protected override ICompilerResult DoBuild (IProgressMonitor
monitor)
+ {
+ ICompilerResult ret = base.DoBuild (monitor);
+ //need to do this after the compile, as the compile
phase removes copied references
+ CopyReferencesToOutputPath (false);
+ return ret;
+ }
+
static bool CheckXsp (string command)
{
try {
Modified:
trunk/monodevelop/Extras/AspNetAddIn/Project/VerifyCodeBehindBuildStep.cs
===================================================================
--- trunk/monodevelop/Extras/AspNetAddIn/Project/VerifyCodeBehindBuildStep.cs
2007-10-15 22:10:21 UTC (rev 87539)
+++ trunk/monodevelop/Extras/AspNetAddIn/Project/VerifyCodeBehindBuildStep.cs
2007-10-15 22:20:59 UTC (rev 87540)
@@ -19,6 +19,7 @@
public override ICompilerResult Build (IProgressMonitor
monitor, CombineEntry project)
{
AspNetAppProject aspProject = project as
AspNetAppProject;
+ List<CodeBehindWarning> errors = new
List<CodeBehindWarning> ();
if (aspProject == null)
return base.Build (monitor, project);
@@ -33,9 +34,9 @@
IParserContext ctx =
MonoDevelop.Ide.Gui.IdeApp.ProjectOperations.ParserDatabase.GetProjectParserContext
(aspProject);
ctx.UpdateDatabase ();
- monitor.Log.WriteLine ("Generating CodeBehind
members...");
+ monitor.Log.WriteLine (GettextCatalog.GetString
("Generating CodeBehind members..."));
if (!config.GenerateNonPartialCodeBehindMembers)
- monitor.Log.WriteLine ("Auto-generation of
CodeBehind members is disabled for non-partial classes.");
+ monitor.Log.WriteLine (GettextCatalog.GetString
("Auto-generation of CodeBehind members is disabled for non-partial classes."));
//find the members that need to be added to CodeBehind
classes
foreach (ProjectFile file in aspProject.ProjectFiles) {
@@ -50,7 +51,12 @@
IClass cls = ctx.GetClass (className);
if (cls == null) {
- monitor.ReportWarning ("Cannot find
CodeBehind class \"" + className + "\" for file \"" + file.Name + "\".");
+ CodeBehindWarning cbw = new
CodeBehindWarning (
+ GettextCatalog.GetString
("Cannot find CodeBehind class '{0}'.", className),
+ file.FilePath
+ );
+ monitor.Log.WriteLine (cbw.ToString ());
+ errors.Add (cbw);
continue;
}
@@ -67,49 +73,144 @@
try {
doc = aspProject.GetDocument (file);
} catch (Exception e) {
- monitor.ReportWarning (string.Format
("Parser failed on {0} with error {1}. CodeBehind members for this file will
not be added.", file, e.ToString ()));
+ CodeBehindWarning cbw = new
CodeBehindWarning (
+ GettextCatalog.GetString
("Parser failed with error {1}. CodeBehind members for this file will not be
added.", e.ToString ()),
+ file.FilePath
+ );
+ monitor.Log.WriteLine (cbw.ToString ());
+ errors.Add (cbw);
}
try {
if (doc != null) {
foreach
(System.CodeDom.CodeMemberField member in doc.MemberList.List.Values) {
-
MonoDevelop.Projects.Parser.IMember existingMember =
BindingService.GetCompatibleMemberInClass (cls, member);
- if (existingMember ==
null) {
-
classesForMembers.Add (partToAddTo);
-
membersToAdd.Add (member);
+ try {
+
MonoDevelop.Projects.Parser.IMember existingMember =
BindingService.GetCompatibleMemberInClass (cls, member);
+ if
(existingMember == null) {
+
classesForMembers.Add (partToAddTo);
+
membersToAdd.Add (member);
+ }
+ } catch
(MemberExistsException ex) {
+
CodeBehindWarning cbw = new CodeBehindWarning (
+
ex.ToString (),
+
ex.FileName,
+ ex.Line,
+
ex.Column
+ );
+
monitor.Log.WriteLine (cbw.ToString ());
+ errors.Add
(cbw);
}
}
}
+ } catch (ErrorInFileException e) {
+ CodeBehindWarning cbw = null;
+ if (e.FileName == null)
+ cbw = new CodeBehindWarning
(e.ToString (), file.FilePath);
+ else
+ cbw = new CodeBehindWarning
(e.ToString (), e.FileName, e.Line, e.Column);
+ monitor.Log.WriteLine (cbw.ToString ());
+ errors.Add (cbw);
} catch (Exception e) {
- monitor.ReportWarning (string.Format
("CodeBehind member generation failed on {0} with error {1}. Further CodeBehind
members for this file will not be added.", file, e.ToString ()));
+ CodeBehindWarning cbw = new
CodeBehindWarning (
+ GettextCatalog.GetString
("CodeBehind member generation failed with error {0}. Further CodeBehind
members for this file will not be added.", e.ToString ()),
+ file.FilePath
+ );
+ monitor.Log.WriteLine (cbw.ToString ());
+ errors.Add (cbw);
}
}
//add all the members
//documents may be open, so needs to run in GUI thread
- Gtk.Application.Invoke ( delegate {
+ MonoDevelop.Core.Gui.DispatchService.GuiSyncDispatch
(delegate {
for (int i = 0; i < membersToAdd.Count; i++)
try {
BindingService.GetCodeGenerator
().AddMember (classesForMembers[i], membersToAdd[i]);
} catch (MemberExistsException m) {
- monitor.ReportWarning
(m.ToString ());
- }
+ CodeBehindWarning cbw = new
CodeBehindWarning (
+ m.ToString (),
+ m.FileName,
+ m.Line,
+ m.Column
+ );
+ monitor.Log.WriteLine
(cbw.ToString ());
+ errors.Add (cbw);
+ }
});
-
+
if (membersToAdd.Count > 0) {
- monitor.Log.WriteLine (string.Format ("Added
{0} member{1} to CodeBehind classes. Saving updated source files.",
membersToAdd.Count, (membersToAdd.Count>1)?"s":""));
+ monitor.Log.WriteLine
(GettextCatalog.GetPluralString (
+ "Added {0} member to CodeBehind
classes. Saving updated source files.",
+ "Added {0} members to CodeBehind
classes. Saving updated source files.",
+ membersToAdd.Count, membersToAdd.Count
+ ));
//make sure updated files are saved before
compilation
- Gtk.Application.Invoke ( delegate {
+
MonoDevelop.Core.Gui.DispatchService.GuiSyncDispatch (delegate {
foreach (MonoDevelop.Ide.Gui.Document
guiDoc in MonoDevelop.Ide.Gui.IdeApp.Workbench.Documents)
if (guiDoc.IsDirty)
guiDoc.Save ();
});
} else {
- monitor.Log.WriteLine ("No changes made to
CodeBehind classes.");
+ monitor.Log.WriteLine (GettextCatalog.GetString
("No changes made to CodeBehind classes."));
}
- return base.Build (monitor, project);
+ ICompilerResult baseResult = base.Build (monitor,
project);
+ foreach (CodeBehindWarning cbw in errors) {
+ if (cbw.FileName != null)
+ baseResult.AddWarning (cbw.FileName,
cbw.Line, cbw.Column, null, cbw.WarningText);
+ else
+ baseResult.AddWarning (cbw.WarningText);
+
+ }
+ return baseResult;
}
+
+ class CodeBehindWarning
+ {
+ string fileName = null;
+ int line = 0;
+ int col = 0;
+ string warningText;
+
+ public CodeBehindWarning (string warningText)
+ : this (warningText, null)
+ {
+ }
+
+ public CodeBehindWarning (string warningText, string
fileName)
+ : this (warningText, fileName, 0, 0)
+ {
+ }
+
+ public CodeBehindWarning (string warningText, string
fileName, int line, int col)
+ {
+ this.warningText = warningText;
+ this.fileName = fileName;
+ this.line = line;
+ this.col = col;
+ }
+
+ public string FileName {
+ get { return fileName; }
+ }
+
+ public string WarningText {
+ get { return warningText; }
+ }
+
+ public int Line {
+ get { return line; }
+ }
+
+ public int Column {
+ get { return col; }
+ }
+
+ public override string ToString ()
+ {
+ return string.Format ("{0}({1},{2}): {3}",
FileName, Line, Column, WarningText);
+ }
+ }
}
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches