incubator-nmaven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sisb...@apache.org
Subject svn commit: r539672 - in /incubator/nmaven/branches/SI_XPT: ./ components/dotnet-artifact/src/test/java/org/apache/maven/dotnet/artifact/ components/dotnet-core/src/main/resources/META-INF/nmaven/ components/dotnet-executable/src/main/java/org/apache/m...
Date Sat, 19 May 2007 01:51:47 GMT
Author: sisbell
Date: Fri May 18 18:51:46 2007
New Revision: 539672

URL: http://svn.apache.org/viewvc?view=rev&rev=539672
Log:
Compiling on Linux. Fixed problem with GAC install and fixed unit tests.

Modified:
    incubator/nmaven/branches/SI_XPT/bootstrap-build.sh
    incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/test/java/org/apache/maven/dotnet/artifact/AssemblyRepositoryLayoutTest.java
    incubator/nmaven/branches/SI_XPT/components/dotnet-core/src/main/resources/META-INF/nmaven/executable-plugins.xml
    incubator/nmaven/branches/SI_XPT/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/CompilerContextImpl.java
    incubator/nmaven/branches/SI_XPT/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/NetExecutableFactoryImpl.java
    incubator/nmaven/branches/SI_XPT/maven-dotnet.iml

Modified: incubator/nmaven/branches/SI_XPT/bootstrap-build.sh
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/bootstrap-build.sh?view=diff&rev=539672&r1=539671&r2=539672
==============================================================================
--- incubator/nmaven/branches/SI_XPT/bootstrap-build.sh (original)
+++ incubator/nmaven/branches/SI_XPT/bootstrap-build.sh Fri May 18 18:51:46 2007
@@ -1,4 +1,9 @@
-mvn -f ./components/pom.xml install
-mvn -f ./plugins/pom.xml install
-mvn org.apache.maven.dotnet.plugins:maven-install-plugin:install-file -Dfile=thirdparty/NUnit/NUnit.Framework.dll
-DgroupId=NUnit -DartifactId=NUnit.Framework -Dpackaging=dll -Dversion=2.2.8.0
-mvn -f ./assemblies/pom.xml -Dmaven.test.skip=true -Dbootstrap install $*
+#mvn install
+#mvn -f ./plugins/NMaven.Plugin.Addin/pom-java.xml install
+#mvn -f ./plugins/NMaven.Plugin.Devenv/pom-java.xml install
+#mvn -f ./plugins/NMaven.Plugin.Settings/pom-java.xml install
+#mvn -f ./plugins/NMaven.Plugin.Solution/pom-java.xml install
+#mvn org.apache.maven.dotnet.plugins:maven-install-plugin:install-file -Dfile=thirdparty/NUnit/NUnit.Framework.dll
-DgroupId=NUnit -DartifactId=NUnit.Framework -Dpackaging=dll -Dversion=2.2.8.0
+#mvn -f ./assemblies/pom.xml -Dmaven.test.skip=true -Dbootstrap install
+mvn -f ./plugins/pom-netplugins.xml -Dmaven.test.skip=true -Dbootstrap install
+#mvn -f ./assemblies/pom.xml -Dmaven.test.skip=true -Dbootstrap install $*

Modified: incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/test/java/org/apache/maven/dotnet/artifact/AssemblyRepositoryLayoutTest.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/test/java/org/apache/maven/dotnet/artifact/AssemblyRepositoryLayoutTest.java?view=diff&rev=539672&r1=539671&r2=539672
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/test/java/org/apache/maven/dotnet/artifact/AssemblyRepositoryLayoutTest.java
(original)
+++ incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/test/java/org/apache/maven/dotnet/artifact/AssemblyRepositoryLayoutTest.java
Fri May 18 18:51:46 2007
@@ -1,5 +1,7 @@
 package org.apache.maven.dotnet.artifact;
 
+import java.io.File;
+
 import junit.framework.TestCase;
 import org.apache.maven.artifact.versioning.VersionRange;
 import org.apache.maven.artifact.Artifact;
@@ -24,11 +26,12 @@
         String classifier,
         ArtifactHandler artifactHandler
         */
+        System.out.println(new File("org\\apache\\maven\\artifact.test\\1.0.0\\3.0\\artifact.test.dll").getAbsolutePath());
         Artifact artifact = new DefaultArtifact( "org.apache.maven", "artifact.test",
                                                  VersionRange.createFromVersion( "1.0.0"
), "compile", "dll", "3.0",
                                                  new DefaultArtifactHandler( "dll" ) );
         assertEquals( new AssemblyRepositoryLayout().pathOf( artifact ),
-                      "org\\apache\\maven\\artifact.test\\1.0.0\\3.0\\artifact.test.dll"
);
+                      normalizePathForTargetPlatform("org\\apache\\maven\\artifact.test\\1.0.0\\3.0\\artifact.test.dll"));
     }
 
     public void testPathOf()
@@ -37,7 +40,7 @@
                                                  VersionRange.createFromVersion( "1.0.0"
), "compile", "dll", null,
                                                  new DefaultArtifactHandler( "dll" ) );
         assertEquals( new AssemblyRepositoryLayout().pathOf( artifact ),
-                      "org\\apache\\maven\\artifact.test\\1.0.0\\artifact.test.dll" );
+                      normalizePathForTargetPlatform("org\\apache\\maven\\artifact.test\\1.0.0\\artifact.test.dll")
);
     }
 
     public void testPathOfRemoteRepositoryMetadata()
@@ -47,7 +50,7 @@
                                                  new DefaultArtifactHandler( "dll" ) );
         ArtifactMetadata artifactMetadata = new ProjectArtifactMetadata( artifact );
         assertEquals( new AssemblyRepositoryLayout().pathOfRemoteRepositoryMetadata( artifactMetadata
),
-                      "org\\apache\\maven\\artifact.test\\1.0.0\\artifact.test-1.0.0.pom"
);
+                      normalizePathForTargetPlatform("org\\apache\\maven\\artifact.test\\1.0.0\\artifact.test-1.0.0.pom")
);
 
     }
 
@@ -58,7 +61,7 @@
                                                  new DefaultArtifactHandler( "dll" ) );
         ArtifactMetadata artifactMetadata = new ProjectArtifactMetadata( artifact );
         assertEquals( new AssemblyRepositoryLayout().pathOfRemoteRepositoryMetadata( artifactMetadata
),
-                      "org\\apache\\maven\\artifact.test\\1.0.0\\artifact.test-1.0.0.pom"
);
+                      normalizePathForTargetPlatform("org\\apache\\maven\\artifact.test\\1.0.0\\artifact.test-1.0.0.pom")
);
 
     }
 
@@ -72,7 +75,7 @@
             new DefaultArtifactRepository( "testRepo", "http://localhost/maven2", new AssemblyRepositoryLayout()
);
         assertEquals(
             new AssemblyRepositoryLayout().pathOfLocalRepositoryMetadata( artifactMetadata,
artifactRepository ),
-            "org\\apache\\maven\\artifact.test\\1.0.0\\artifact.test-1.0.0.pom" );
+            normalizePathForTargetPlatform("org\\apache\\maven\\artifact.test\\1.0.0\\artifact.test-1.0.0.pom")
);
 
     }
 
@@ -86,7 +89,11 @@
             new DefaultArtifactRepository( "testRepo", "http://localhost/maven2", new AssemblyRepositoryLayout()
);
         assertEquals(
             new AssemblyRepositoryLayout().pathOfLocalRepositoryMetadata( artifactMetadata,
artifactRepository ),
-            "org\\apache\\maven\\artifact.test\\1.0.0\\artifact.test-1.0.0.pom" );
+            normalizePathForTargetPlatform("org\\apache\\maven\\artifact.test\\1.0.0\\artifact.test-1.0.0.pom")
);
+    }
 
+    private String normalizePathForTargetPlatform(String path)
+    {
+        return path.replace( "\\", File.separator);
     }
 }

Modified: incubator/nmaven/branches/SI_XPT/components/dotnet-core/src/main/resources/META-INF/nmaven/executable-plugins.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/components/dotnet-core/src/main/resources/META-INF/nmaven/executable-plugins.xml?view=diff&rev=539672&r1=539671&r2=539672
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/dotnet-core/src/main/resources/META-INF/nmaven/executable-plugins.xml
(original)
+++ incubator/nmaven/branches/SI_XPT/components/dotnet-core/src/main/resources/META-INF/nmaven/executable-plugins.xml
Fri May 18 18:51:46 2007
@@ -215,6 +215,18 @@
       <platform>
         <operatingSystem>Windows</operatingSystem>
       </platform>
+      <platform>
+        <operatingSystem>Mac OS X</operatingSystem>
+      </platform>
+      <platform>
+        <operatingSystem>Linux</operatingSystem>
+      </platform>
+      <platform>
+        <operatingSystem>Solaris</operatingSystem>
+      </platform>
+      <platform>
+        <operatingSystem>FreeBSD</operatingSystem>
+      </platform>
     </platforms>
   </executablePlugin>
   <executablePlugin>

Modified: incubator/nmaven/branches/SI_XPT/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/CompilerContextImpl.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/CompilerContextImpl.java?view=diff&rev=539672&r1=539671&r2=539672
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/CompilerContextImpl.java
(original)
+++ incubator/nmaven/branches/SI_XPT/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/CompilerContextImpl.java
Fri May 18 18:51:46 2007
@@ -244,6 +244,45 @@
         return repository;
     }
 
+    private String getGacRootForMono()
+     throws PlatformUnsupportedException {
+        String path = System.getenv( "PATH");
+        if(path != null)
+        {
+            String[] tokens = path.split( System.getProperty( "path.separator") );
+            for(String token : tokens)
+            {
+                File gacRoot = new File(new File(token).getParentFile(), "lib/mono/gac/");
+                if(gacRoot.exists())
+                {
+                    return gacRoot.getAbsolutePath();
+                }
+            }
+        }
+        //check settings file
+
+
+        String monoRoot = System.getenv( "MONO_ROOT");
+        if(monoRoot != null && !new File(monoRoot).exists())
+        {
+            logger.warn( "MONO_ROOT has been incorrectly set. Trying /usr : MONO_ROOT = "
+ monoRoot);
+        }
+        else if(monoRoot != null)
+        {
+            return (!monoRoot.endsWith( File.separator)) ? monoRoot + File.separator : monoRoot;
+        }
+
+        if(new File("/usr/lib/mono/gac/").exists())
+        {
+            return new File("/usr/lib/mono/gac/").getAbsolutePath();
+        }
+        else
+        {
+            throw new PlatformUnsupportedException(
+                "NMAVEN-061-008: Could not locate Global Assembly Cache for Mono. Try setting
the MONO_ROOT environmental variable.");
+        }
+    }
+
     public void init( CompilerRequirement compilerRequirement, CompilerConfig config, MavenProject
project,
                       CapabilityMatcher capabilityMatcher )
         throws PlatformUnsupportedException
@@ -285,7 +324,7 @@
                 }
                 else if ( compilerRequirement.getVendor().equals( Vendor.MONO ) )
                 {
-                    //TODO: MONO Support - read settings file
+                    gacRoot = getGacRootForMono();
                 }
                 if ( gacRoot != null )
                 {
@@ -295,19 +334,22 @@
             }
             else if ( type.equals( "gac" ) )
             {
-                String gacRoot = "C:\\WINDOWS\\assembly\\GAC\\";
+                String gacRoot = (compilerRequirement.getVendor().equals( Vendor.MONO ))
?
+                    getGacRootForMono() : "C:\\WINDOWS\\assembly\\GAC\\";
                 setArtifactGacFile( gacRoot, artifact );
                 libraries.add( artifact );
             }
             else if ( type.equals( "gac_32" ) )
             {
-                String gacRoot = "C:\\WINDOWS\\assembly\\GAC_32\\";
+                String gacRoot = (compilerRequirement.getVendor().equals( Vendor.MONO ))
?
+                    getGacRootForMono() : "C:\\WINDOWS\\assembly\\GAC_32\\";
                 setArtifactGacFile( gacRoot, artifact );
                 libraries.add( artifact );
             }
             else if ( type.equals( "gac_msil" ) )
             {
-                String gacRoot = "C:\\WINDOWS\\assembly\\GAC_MSIL\\";
+                String gacRoot = (compilerRequirement.getVendor().equals( Vendor.MONO ))
?
+                    getGacRootForMono() : "C:\\WINDOWS\\assembly\\GAC_MSIL\\";
                 setArtifactGacFile( gacRoot, artifact );
                 libraries.add( artifact );
             }
@@ -367,7 +409,7 @@
     private void setArtifactGacFile( String gacRoot, Artifact artifact )
         throws PlatformUnsupportedException
     {
-        File gacFile = new File( gacRoot + artifact.getArtifactId() + File.separator + artifact.getVersion()
+ File
+        File gacFile = new File( gacRoot, artifact.getArtifactId() + File.separator + artifact.getVersion()
+ File
             .separator + artifact.getArtifactId() + ".dll" );
         if ( !gacFile.exists() )
         {

Modified: incubator/nmaven/branches/SI_XPT/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/NetExecutableFactoryImpl.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/NetExecutableFactoryImpl.java?view=diff&rev=539672&r1=539671&r2=539672
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/NetExecutableFactoryImpl.java
(original)
+++ incubator/nmaven/branches/SI_XPT/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/NetExecutableFactoryImpl.java
Fri May 18 18:51:46 2007
@@ -405,8 +405,7 @@
             throw new PlatformUnsupportedException( "NMAVEN-066-010: Illegal State: Vendor
Info = " + vendorInfo, e );
         }
 
-        if ( vendorInfo.getVendor() == null || vendorInfo.getFrameworkVersion() == null ||
-            vendorInfo.getVendorVersion() == null )
+        if ( vendorInfo.getVendor() == null || vendorInfo.getFrameworkVersion() == null )
         {
             throw new PlatformUnsupportedException( "NMAVEN-066-019: Missing Vendor Information:
" + vendorInfo );
         }

Modified: incubator/nmaven/branches/SI_XPT/maven-dotnet.iml
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/maven-dotnet.iml?view=diff&rev=539672&r1=539671&r2=539672
==============================================================================
--- incubator/nmaven/branches/SI_XPT/maven-dotnet.iml (original)
+++ incubator/nmaven/branches/SI_XPT/maven-dotnet.iml Fri May 18 18:51:46 2007
@@ -10,6 +10,7 @@
       <sourceFolder url="file://$MODULE_DIR$/assemblies/NMaven.Core/src/test/csharp" isTestSource="true"
/>
       <sourceFolder url="file://$MODULE_DIR$/components/dotnet-artifact/src/main/java"
isTestSource="false" />
       <sourceFolder url="file://$MODULE_DIR$/components/dotnet-artifact/src/main/resources"
isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/components/dotnet-artifact/src/test/java"
isTestSource="true" />
       <sourceFolder url="file://$MODULE_DIR$/components/dotnet-assembler/src/main/java"
isTestSource="false" />
       <sourceFolder url="file://$MODULE_DIR$/components/dotnet-assembler/src/main/resources"
isTestSource="false" />
       <sourceFolder url="file://$MODULE_DIR$/components/dotnet-assembler/src/test/java"
isTestSource="true" />



Mime
View raw message