[Monodevelop-patches-list] r1537 - trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Wed Apr 28 06:26:37 EDT 2004
Author: tberman
Date: 2004-04-28 06:26:37 -0400 (Wed, 28 Apr 2004)
New Revision: 1537
Modified:
trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/CSharpBindingCompilerManager.cs
trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/ChangeLog
Log:
adding code for non gac'd assembly references (not project references yet) and resources.
Modified: trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/CSharpBindingCompilerManager.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/CSharpBindingCompilerManager.cs 2004-04-28 09:41:58 UTC (rev 1536)
+++ trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/CSharpBindingCompilerManager.cs 2004-04-28 10:26:37 UTC (rev 1537)
@@ -302,17 +302,21 @@
ArrayList compile_files = new ArrayList ();
ArrayList gac_references = new ArrayList ();
+ ArrayList assembly_references = new ArrayList ();
+ ArrayList resources = new ArrayList ();
foreach (ProjectFile finfo in project.ProjectFiles) {
if (finfo.Subtype != Subtype.Directory) {
switch (finfo.BuildAction) {
case BuildAction.Compile:
string rel_path = fileUtilityService.AbsoluteToRelativePath (project.BaseDirectory, Path.GetDirectoryName (finfo.Name));
+ if (CanCompile (finfo.Name));
compile_files.Add (Path.Combine (rel_path, Path.GetFileName (finfo.Name)));
break;
case BuildAction.EmbedAsResource:
- //writer.WriteLine("--linkres " + finfo.Name);
+ string resource_rel_path = fileUtilityService.AbsoluteToRelativePath (project.BaseDirectory, Path.GetDirectoryName (finfo.Name));
+ resources.Add (Path.Combine (resource_rel_path, Path.GetFileName (finfo.Name)));
break;
}
}
@@ -321,9 +325,14 @@
foreach (ProjectReference lib in project.ProjectReferences) {
switch (lib.ReferenceType) {
case ReferenceType.Gac:
- string fileName = lib.GetReferencedFileName(project);
- gac_references.Add (Path.GetFileNameWithoutExtension (fileName));
+ string gac_fileName = lib.GetReferencedFileName (project);
+ gac_references.Add (Path.GetFileNameWithoutExtension (gac_fileName));
break;
+ case ReferenceType.Assembly:
+ string assembly_fileName = lib.GetReferencedFileName (project);
+ string rel_path_to = fileUtilityService.AbsoluteToRelativePath (project.BaseDirectory, Path.GetDirectoryName (assembly_fileName));
+ assembly_references.Add (Path.Combine (rel_path_to, Path.GetFileName (assembly_fileName)));
+ break;
}
}
@@ -336,7 +345,18 @@
stream.WriteLine ();
}
+ stream.WriteLine ("RESOURCES = \\");
+ for (int i = 0; i < resources.Count; i++) {
+ stream.Write (resources[i]);
+ if (i != resources.Count - 1)
+ stream.WriteLine (" \\");
+ else
+ stream.WriteLine ();
+ }
stream.WriteLine ();
+ stream.WriteLine ("RESOURCES_BUILD = $(foreach res,$(RESOURCES), $(addprefix -resource:,$(res)),$(notdir $(res)))");
+
+ stream.WriteLine ();
stream.WriteLine ("GAC_REFERENCES = \\");
for (int i = 0; i < gac_references.Count; i++) {
stream.Write (gac_references[i]);
@@ -350,11 +370,24 @@
stream.WriteLine ("GAC_REFERENCES_BUILD = $(addprefix /r:, $(GAC_REFERENCES))");
stream.WriteLine ();
+ stream.WriteLine ("ASSEMBLY_REFERENCES = \\");
+ for (int i = 0; i < assembly_references.Count; i++) {
+ stream.Write (assembly_references[i]);
+ if (i != assembly_references.Count - 1)
+ stream.WriteLine (" \\");
+ else
+ stream.WriteLine ();
+ }
+
+ stream.WriteLine ();
+ stream.WriteLine ("ASSEMBLY_REFERENCES_BUILD = $(addprefix /r:, $(ASSEMBLY_REFERENCES))");
+ stream.WriteLine ();
+
stream.WriteLine ("all: " + outputName);
stream.WriteLine ();
- stream.WriteLine (outputName + ": $(SOURCES)");
- stream.WriteLine ("\tmcs /target:{0} /out:{1} $(GAC_REFERENCES_BUILD) $(SOURCES)", target, outputName);
+ stream.WriteLine (outputName + ": $(SOURCES) $(RESOURCES)");
+ stream.WriteLine ("\tmcs /target:{0} /out:{1} $(RESOURCES_BUILD) $(GAC_REFERENCES_BUILD) $(ASSEMBLY_REFERENCES_BUILD) $(SOURCES)", target, outputName);
stream.Flush ();
stream.Close ();
Modified: trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/ChangeLog
===================================================================
--- trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/ChangeLog 2004-04-28 09:41:58 UTC (rev 1536)
+++ trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/ChangeLog 2004-04-28 10:26:37 UTC (rev 1537)
@@ -1,5 +1,10 @@
2004-04-28 Todd Berman <tberman at sevenl.net>
+ * CSharpBindingCompilerManger.cs: add code for assembly references
+ and embeding resources.
+
+2004-04-28 Todd Berman <tberman at sevenl.net>
+
* CSharpLanguageBinding.cs: implemented GetMakefile passthru.
* CSharpBindingCompilerManager.cs: dirty dirty dirty first draft run
through of GenerateMakefile, I have tested this with exactly *one*
More information about the Monodevelop-patches-list
mailing list