incubator-nmaven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sisb...@apache.org
Subject svn commit: r514036 - in /incubator/nmaven/branches/SI_IDE: assemblies/NMaven.Core/src/main/csharp/Core/Impl/ assemblies/NMaven.Plugin.Solution/src/main/csharp/Plugin/Solution/ plugins/maven-resolver-plugin/src/main/java/org/apache/maven/dotnet/plugin/...
Date Sat, 03 Mar 2007 01:04:21 GMT
Author: sisbell
Date: Fri Mar  2 17:04:21 2007
New Revision: 514036

URL: http://svn.apache.org/viewvc?view=rev&rev=514036
Log:
Numerous bug fixes for IDE support.

Modified:
    incubator/nmaven/branches/SI_IDE/assemblies/NMaven.Core/src/main/csharp/Core/Impl/ProjectGeneratorImpl.cs
    incubator/nmaven/branches/SI_IDE/assemblies/NMaven.Plugin.Solution/src/main/csharp/Plugin/Solution/SolutionPlugin.cs
    incubator/nmaven/branches/SI_IDE/plugins/maven-resolver-plugin/src/main/java/org/apache/maven/dotnet/plugin/resolver/NetDependencyResolverMojo.java
    incubator/nmaven/branches/SI_IDE/plugins/maven-solution-plugin/src/main/java/org/apache/maven/dotnet/plugin/solution/SolutionMojo.java

Modified: incubator/nmaven/branches/SI_IDE/assemblies/NMaven.Core/src/main/csharp/Core/Impl/ProjectGeneratorImpl.cs
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/assemblies/NMaven.Core/src/main/csharp/Core/Impl/ProjectGeneratorImpl.cs?view=diff&rev=514036&r1=514035&r2=514036
==============================================================================
--- incubator/nmaven/branches/SI_IDE/assemblies/NMaven.Core/src/main/csharp/Core/Impl/ProjectGeneratorImpl.cs
(original)
+++ incubator/nmaven/branches/SI_IDE/assemblies/NMaven.Core/src/main/csharp/Core/Impl/ProjectGeneratorImpl.cs
Fri Mar  2 17:04:21 2007
@@ -234,17 +234,16 @@
 			{
 				foreach(Dependency dependency in model.dependencies) {
 					String artifactExtension = (dependency.type == "module") ? "dll" : GetExtension(dependency.type);
-					if(dependency.type == "module")
-					{
-						
-					}
 					String repoPath = Environment.GetEnvironmentVariable("HOMEDRIVE") 
 					    + Environment.GetEnvironmentVariable("HOMEPATH") 
 						+ @"\.m2\repository\" + dependency.groupId.Replace(".", "\\")
 						+ "\\" + dependency.artifactId + "\\" + dependency.version + "\\" + dependency.artifactId
+ "." 
 						+ artifactExtension;
 					BuildItem buildItem = group.AddNewItem("Reference", dependency.artifactId);
-					if(!dependency.GetType().Equals("gac")) buildItem.SetMetadata("HintPath", repoPath,
false);
+					//TODO: Fix this. Just because it is in the GAC on the system that builds the .csproj
does not mean 
+					//it is in the GAC on another system. 
+					if(!dependency.GetType().Equals("gac") && !IsInGac(dependency.artifactId)) 
+						buildItem.SetMetadata("HintPath", repoPath, false);
 				}				
 			}
 
@@ -258,22 +257,25 @@
             {
             	try {
                     string assembly = GetAssemblyFor(dependency);
-            		DirectoryInfo fileInfo = new DirectoryInfo(@"C:\WINDOWS\assembly\GAC_MSIL\"
+ assembly);
-            		if(fileInfo.Exists) {
+                    if(IsInGac(assembly)) {
             			group.AddNewItem("Reference", assembly);	
             		} 
             	}
             	catch(Exception e) 
             	{
-            		Console.WriteLine(e.Message);
+            		Console.WriteLine("NMAVEN-000-000: Could not find assembly dependency", e.Message);
             	}
-            	
             }
 		}
+		
+		private bool IsInGac(string assembly)
+		{
+			return new DirectoryInfo(@"C:\WINDOWS\assembly\GAC_MSIL\" + assembly).Exists;	
+		}
 
         private string GetAssemblyFor(string dependency)
         {
-            if(dependency.Equals("System.Resource")) return "System.Windows.Form";
+        if(dependency.Trim().Equals("System.Resources")) return "System.Windows.Forms";
             return dependency;
         }
 		

Modified: incubator/nmaven/branches/SI_IDE/assemblies/NMaven.Plugin.Solution/src/main/csharp/Plugin/Solution/SolutionPlugin.cs
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/assemblies/NMaven.Plugin.Solution/src/main/csharp/Plugin/Solution/SolutionPlugin.cs?view=diff&rev=514036&r1=514035&r2=514036
==============================================================================
--- incubator/nmaven/branches/SI_IDE/assemblies/NMaven.Plugin.Solution/src/main/csharp/Plugin/Solution/SolutionPlugin.cs
(original)
+++ incubator/nmaven/branches/SI_IDE/assemblies/NMaven.Plugin.Solution/src/main/csharp/Plugin/Solution/SolutionPlugin.cs
Fri Mar  2 17:04:21 2007
@@ -64,21 +64,28 @@
 			} 
 			else
 			{
-				Console.WriteLine(currentDirectory.FullName + @"\src\main\csharp\");
+				IProjectReference mainProjectReference = null;
 				if(new DirectoryInfo(currentDirectory.FullName + @"\src\main\csharp\").Exists)
 				{
-					IProjectReference projectReference = 
+					mainProjectReference = 
 			 			projectGenerator.GenerateProjectFor(model,
 			 	                                    new DirectoryInfo(currentDirectory.FullName + @"\src\main\csharp\"),
 			 	                                    model.artifactId, null);
-					projectReferences.Add(projectReference);
+					Console.WriteLine("NMAVEN-000-000: Generated project: File Name = "
+					                  + mainProjectReference.CsProjFile.FullName);							
+					projectReferences.Add(mainProjectReference);
 				}
-				if(new DirectoryInfo( @"src\test\csharp\").Exists)
+				if(new DirectoryInfo( currentDirectory.FullName + @"\src\test\csharp\").Exists)
 				{
+					List<IProjectReference> mainRef = new List<IProjectReference>();
+					if(mainProjectReference != null)
+					{
+						mainRef.Add(mainProjectReference);
+					}
 					IProjectReference projectReference = 
 			 			projectGenerator.GenerateProjectFor(model,
-			 	                                    new DirectoryInfo(currentDirectory.FullName + @"src\test\csharp\"),
-			 	                                    model.artifactId + "-Test", null);
+			 	                                    new DirectoryInfo(currentDirectory.FullName + @"\src\test\csharp\"),
+			 	                                    model.artifactId + "-Test", mainRef);
 					Console.WriteLine("NMAVEN-000-000: Generated test project: File Name = "
 					                  + projectReference.CsProjFile.FullName);					
 					projectReferences.Add(projectReference);					
@@ -93,7 +100,7 @@
             string pomFile = plugin.GetArgFor("pomFile", args);
             if (pomFile == null) pomFile = "pom.xml";
 
-            string profile = plugin.GetArgFor("profile", args); ;
+            string profile = plugin.GetArgFor("pomProfile", args); ;
 
 			IProjectGenerator projectGenerator = new ProjectGeneratorImpl();
 			NMaven.Model.Model rootPom = projectGenerator.CreatePomModelFor(@pomFile);

Modified: incubator/nmaven/branches/SI_IDE/plugins/maven-resolver-plugin/src/main/java/org/apache/maven/dotnet/plugin/resolver/NetDependencyResolverMojo.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/plugins/maven-resolver-plugin/src/main/java/org/apache/maven/dotnet/plugin/resolver/NetDependencyResolverMojo.java?view=diff&rev=514036&r1=514035&r2=514036
==============================================================================
--- incubator/nmaven/branches/SI_IDE/plugins/maven-resolver-plugin/src/main/java/org/apache/maven/dotnet/plugin/resolver/NetDependencyResolverMojo.java
(original)
+++ incubator/nmaven/branches/SI_IDE/plugins/maven-resolver-plugin/src/main/java/org/apache/maven/dotnet/plugin/resolver/NetDependencyResolverMojo.java
Fri Mar  2 17:04:21 2007
@@ -96,7 +96,7 @@
             return;
         }
 
-        String profile = System.getProperty( "Profile" );
+        String profile = System.getProperty( "dependencyProfile" );
 
         RepositoryRegistry repositoryRegistry;
         try

Modified: incubator/nmaven/branches/SI_IDE/plugins/maven-solution-plugin/src/main/java/org/apache/maven/dotnet/plugin/solution/SolutionMojo.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/plugins/maven-solution-plugin/src/main/java/org/apache/maven/dotnet/plugin/solution/SolutionMojo.java?view=diff&rev=514036&r1=514035&r2=514036
==============================================================================
--- incubator/nmaven/branches/SI_IDE/plugins/maven-solution-plugin/src/main/java/org/apache/maven/dotnet/plugin/solution/SolutionMojo.java
(original)
+++ incubator/nmaven/branches/SI_IDE/plugins/maven-solution-plugin/src/main/java/org/apache/maven/dotnet/plugin/solution/SolutionMojo.java
Fri Mar  2 17:04:21 2007
@@ -60,14 +60,14 @@
 
     public void execute() throws MojoExecutionException
     {
-        String profile = System.getProperty( "Profile");
+        String profile = System.getProperty( "pomProfile");
         String pomFile = System.getProperty( "pomFile");
         
         String basedir = System.getProperty( "user.dir");
         //String basedir1 = "C:\\Documents and Settings\\shane\\nmaven-apache\\SI_IDE\\assemblies";
         List<String> commands = new ArrayList<String>();
         commands.add("pomFile=" + new File(basedir).getAbsolutePath() + File.separator +
"pom.xml");
-        if(profile != null) commands.add("profile=" + profile);
+        if(profile != null) commands.add("pomProfile=" + profile);
         try
         {
             VendorInfo vendorInfo = VendorInfo.Factory.createDefaultVendorInfo();



Mime
View raw message