incubator-nmaven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sisb...@apache.org
Subject svn commit: r527422 - in /incubator/nmaven/branches/SI_XPT/components: ./ dotnet-artifact/ dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ dotnet-artifact/src/test/ dotnet-artifact/src/test/java/ dotnet-artifact/src/test/java/org/ ...
Date Wed, 11 Apr 2007 08:59:04 GMT
Author: sisbell
Date: Wed Apr 11 01:58:52 2007
New Revision: 527422

URL: http://svn.apache.org/viewvc?view=rev&rev=527422
Log:
Various bug fixes and added support for specifying the GAC by MSIL, GAC32 and GAC. I needed this because the VS Add-in needs a dll from the .NET 1.1 GAC even though I am compiling under .NET 2.0

Added:
    incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/test/
    incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/test/java/
    incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/test/java/org/
    incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/test/java/org/apache/
    incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/test/java/org/apache/maven/
    incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/test/java/org/apache/maven/dotnet/
    incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/test/java/org/apache/maven/dotnet/artifact/
    incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/test/java/org/apache/maven/dotnet/artifact/AssemblyRepositoryLayoutTest.java   (with props)
    incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/test/java/org/apache/maven/dotnet/artifact/impl/
    incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/MavenProject.java   (with props)
    incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/impl/MavenProjectImpl.java   (with props)
    incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/logger/
    incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/logger/MavenFormatter.java   (with props)
    incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/logger/SocketLogger.java   (with props)
    incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/logger/SocketLoggerManager.java   (with props)
    incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/resources/META-INF/plexus/plexus.xml   (with props)
Modified:
    incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/pom.xml
    incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactContextImpl.java
    incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactInstallerImpl.java
    incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactMetadataImpl.java
    incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/AssemblyResolverImpl.java
    incubator/nmaven/branches/SI_XPT/components/dotnet-assembler/pom.xml
    incubator/nmaven/branches/SI_XPT/components/dotnet-core/pom.xml
    incubator/nmaven/branches/SI_XPT/components/dotnet-core/src/main/resources/META-INF/plexus/components.xml
    incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/pom.xml
    incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/MavenEmbedderService.java
    incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/MavenExecutionRequest.java
    incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/impl/MavenEmbedderServiceImpl.java
    incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/impl/MavenExecutionRequestImpl.java
    incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/resources/META-INF/plexus/components.xml
    incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/test/java/ServiceTest.java
    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-registry/pom.xml
    incubator/nmaven/branches/SI_XPT/components/dotnet-service/embedder/pom.xml
    incubator/nmaven/branches/SI_XPT/components/dotnet-service/embedder/src/main/webapp/WEB-INF/plexus.xml
    incubator/nmaven/branches/SI_XPT/components/pom.xml

Modified: incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/pom.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/pom.xml?view=diff&rev=527422&r1=527421&r2=527422
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/pom.xml (original)
+++ incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/pom.xml Wed Apr 11 01:58:52 2007
@@ -17,12 +17,12 @@
     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-project</artifactId>
-      <version>2.0.4</version>
+      <version>2.1-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-artifact</artifactId>
-      <version>2.0.4</version>
+      <version>2.1-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.apache.maven.dotnet</groupId>

Modified: incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactContextImpl.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactContextImpl.java?view=diff&rev=527422&r1=527421&r2=527422
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactContextImpl.java (original)
+++ incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactContextImpl.java Wed Apr 11 01:58:52 2007
@@ -190,7 +190,7 @@
                                                                          dependency.getVersion() ),
                                                                      dependency.getType(), dependency.getClassifier(),
                                                                      scope, null );
-            if(!art.getType().equals( "gac")) depSet.add( art );
+            if(!art.getType().startsWith( "gac")) depSet.add( art );
         }
 
         try

Modified: incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactInstallerImpl.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactInstallerImpl.java?view=diff&rev=527422&r1=527421&r2=527422
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactInstallerImpl.java (original)
+++ incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactInstallerImpl.java Wed Apr 11 01:58:52 2007
@@ -130,7 +130,7 @@
             List<Dependency> newDependencies = new ArrayList<Dependency>();
             for ( Dependency dependency : dependencies )
             {
-                if ( !dependency.getType().equals( "gac" ) )
+                if ( !dependency.getType().startsWith( "gac" ) )
                 {
                     newDependencies.add( dependency );
                 }
@@ -450,7 +450,7 @@
         {
             //TODO: This condition is only here since transitive gac dependencies break the build. This needs to be fixed
             //within the core.
-            if ( !dependency.getType().equals( "gac" ) )
+            if ( !dependency.getType().startsWith( "gac" ) )
             {
                 model.addDependency( dependency );
             }

Modified: incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactMetadataImpl.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactMetadataImpl.java?view=diff&rev=527422&r1=527421&r2=527422
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactMetadataImpl.java (original)
+++ incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactMetadataImpl.java Wed Apr 11 01:58:52 2007
@@ -64,8 +64,8 @@
      */
     public String getRemoteFilename()
     {
-        return super.getRemoteFilename();
-        //return getArtifactId() + ".pom";
+        //return super.getRemoteFilename();
+        return getArtifactId() + ".pom";
     }
 
     /**
@@ -78,8 +78,8 @@
      */
     public String getLocalFilename( ArtifactRepository repository )
     {
-        return super.getLocalFilename(repository);
-       // return getArtifactId() + ".pom";
+        //return super.getLocalFilename(repository);
+        return getArtifactId() + ".pom";
     }
 
 

Modified: incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/AssemblyResolverImpl.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/AssemblyResolverImpl.java?view=diff&rev=527422&r1=527421&r2=527422
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/AssemblyResolverImpl.java (original)
+++ incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/AssemblyResolverImpl.java Wed Apr 11 01:58:52 2007
@@ -113,7 +113,7 @@
                                                                               dependency.getVersion() ),
                                                                           dependency.getType(),
                                                                           dependency.getClassifier(), scope, null );
-            if ( artifact.getType().equals( "gac" ) )
+            if ( artifact.getType().startsWith( "gac" ) )
             {
                 gacDependencies.add( artifact );
             }

Added: 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=auto&rev=527422
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/test/java/org/apache/maven/dotnet/artifact/AssemblyRepositoryLayoutTest.java (added)
+++ incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/test/java/org/apache/maven/dotnet/artifact/AssemblyRepositoryLayoutTest.java Wed Apr 11 01:58:52 2007
@@ -0,0 +1,92 @@
+package org.apache.maven.dotnet.artifact;
+
+import junit.framework.TestCase;
+import org.apache.maven.artifact.versioning.VersionRange;
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.DefaultArtifact;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.artifact.repository.DefaultArtifactRepository;
+import org.apache.maven.artifact.metadata.ArtifactMetadata;
+import org.apache.maven.artifact.handler.DefaultArtifactHandler;
+import org.apache.maven.project.artifact.ProjectArtifactMetadata;
+
+public class AssemblyRepositoryLayoutTest
+    extends TestCase
+{
+    public void testPathOfWithClassifier()
+    {
+        /*
+        String groupId,
+        String artifactId,
+        VersionRange versionRange,
+        String scope, 
+        String type,
+        String classifier,
+        ArtifactHandler artifactHandler
+        */
+        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" );
+    }
+
+    public void testPathOf()
+    {
+        Artifact artifact = new DefaultArtifact( "org.apache.maven", "artifact.test",
+                                                 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" );
+    }
+
+    public void testPathOfRemoteRepositoryMetadata()
+    {
+        Artifact artifact = new DefaultArtifact( "org.apache.maven", "artifact.test",
+                                                 VersionRange.createFromVersion( "1.0.0" ), "compile", "dll", null,
+                                                 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" );
+
+    }
+
+    public void testPathOfRemoteRepositoryMetadataWithClassifier()
+    {
+        Artifact artifact = new DefaultArtifact( "org.apache.maven", "artifact.test",
+                                                 VersionRange.createFromVersion( "1.0.0" ), "compile", "dll", "3.0",
+                                                 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" );
+
+    }
+
+    public void testPathOfLocalRepositoryMetadata()
+    {
+        Artifact artifact = new DefaultArtifact( "org.apache.maven", "artifact.test",
+                                                 VersionRange.createFromVersion( "1.0.0" ), "compile", "dll", null,
+                                                 new DefaultArtifactHandler( "dll" ) );
+        ArtifactMetadata artifactMetadata = new ProjectArtifactMetadata( artifact );
+        ArtifactRepository artifactRepository =
+            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" );
+
+    }
+
+    public void testPathOfLocalRepositoryMetadataWithClassifier()
+    {
+        Artifact artifact = new DefaultArtifact( "org.apache.maven", "artifact.test",
+                                                 VersionRange.createFromVersion( "1.0.0" ), "compile", "dll", "3.0",
+                                                 new DefaultArtifactHandler( "dll" ) );
+        ArtifactMetadata artifactMetadata = new ProjectArtifactMetadata( artifact );
+        ArtifactRepository artifactRepository =
+            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" );
+
+    }
+}

Propchange: incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/test/java/org/apache/maven/dotnet/artifact/AssemblyRepositoryLayoutTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/nmaven/branches/SI_XPT/components/dotnet-assembler/pom.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/components/dotnet-assembler/pom.xml?view=diff&rev=527422&r1=527421&r2=527422
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/dotnet-assembler/pom.xml (original)
+++ incubator/nmaven/branches/SI_XPT/components/dotnet-assembler/pom.xml Wed Apr 11 01:58:52 2007
@@ -17,12 +17,12 @@
     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-plugin-api</artifactId>
-      <version>2.0.4</version>
+      <version>2.1-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-project</artifactId>
-      <version>2.0.4</version>
+      <version>2.1-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.apache.maven.dotnet</groupId>

Modified: incubator/nmaven/branches/SI_XPT/components/dotnet-core/pom.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/components/dotnet-core/pom.xml?view=diff&rev=527422&r1=527421&r2=527422
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/dotnet-core/pom.xml (original)
+++ incubator/nmaven/branches/SI_XPT/components/dotnet-core/pom.xml Wed Apr 11 01:58:52 2007
@@ -22,12 +22,12 @@
     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-plugin-api</artifactId>
-      <version>2.0.5</version>
+      <version>2.1-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-project</artifactId>
-      <version>2.0.5</version>
+      <version>2.1-SNAPSHOT</version>
     </dependency>
   </dependencies>
 </project>

Modified: incubator/nmaven/branches/SI_XPT/components/dotnet-core/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/components/dotnet-core/src/main/resources/META-INF/plexus/components.xml?view=diff&rev=527422&r1=527421&r2=527422
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/dotnet-core/src/main/resources/META-INF/plexus/components.xml (original)
+++ incubator/nmaven/branches/SI_XPT/components/dotnet-core/src/main/resources/META-INF/plexus/components.xml Wed Apr 11 01:58:52 2007
@@ -1,13 +1,13 @@
 <component-set>
-    <components>
-        <component>
-            <role>org.apache.maven.dotnet.NMavenRepositoryRegistry</role>
-            <implementation>org.apache.maven.dotnet.impl.NMavenRepositoryRegistryImpl</implementation>
-            <requirements>
-                <requirement>
-                    <role>org.apache.maven.dotnet.registry.RepositoryRegistry</role>
-                </requirement>
-            </requirements>
-        </component>
-    </components>
+  <components>
+    <component>
+      <role>org.apache.maven.dotnet.NMavenRepositoryRegistry</role>
+      <implementation>org.apache.maven.dotnet.impl.NMavenRepositoryRegistryImpl</implementation>
+      <requirements>
+        <requirement>
+          <role>org.apache.maven.dotnet.registry.RepositoryRegistry</role>
+        </requirement>
+      </requirements>
+    </component>
+  </components>
 </component-set>

Modified: incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/pom.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/pom.xml?view=diff&rev=527422&r1=527421&r2=527422
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/pom.xml (original)
+++ incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/pom.xml Wed Apr 11 01:58:52 2007
@@ -17,22 +17,17 @@
     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-embedder</artifactId>
-      <version>2.0.4</version>
+      <version>2.1-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.codehaus.xfire</groupId>
       <artifactId>xfire-plexus</artifactId>
-      <version>1.2</version>
+      <version>1.2.5</version>
     </dependency>
     <dependency>
       <groupId>org.codehaus.xfire</groupId>
       <artifactId>xfire-java5</artifactId>
-      <version>1.2.4</version>
-    </dependency>
-    <dependency>
-      <groupId>org.codehaus.xfire</groupId>
-      <artifactId>javax.ws</artifactId>
-      <version>1.0.0</version>
+      <version>1.2.5</version>
     </dependency>
   </dependencies>
 </project>

Modified: incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/MavenEmbedderService.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/MavenEmbedderService.java?view=diff&rev=527422&r1=527421&r2=527422
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/MavenEmbedderService.java (original)
+++ incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/MavenEmbedderService.java Wed Apr 11 01:58:52 2007
@@ -1,5 +1,7 @@
 package org.apache.maven.dotnet.embedder;
 
+import java.util.Set;
+
 public interface MavenEmbedderService
 {
 
@@ -14,5 +16,6 @@
      */
     void execute( MavenExecutionRequest request );
 
-    
+    Set<MavenProject> getMavenProjectsFor(String basedir);
+
 }

Modified: incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/MavenExecutionRequest.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/MavenExecutionRequest.java?view=diff&rev=527422&r1=527421&r2=527422
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/MavenExecutionRequest.java (original)
+++ incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/MavenExecutionRequest.java Wed Apr 11 01:58:52 2007
@@ -16,4 +16,9 @@
 
     void setPomFile(java.lang.String string);
 
+    @XmlElement(name="goal", namespace="urn:maven-embedder")
+    String getGoal();
+    
+    void setGoal(String goal);
+
 }

Added: incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/MavenProject.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/MavenProject.java?view=auto&rev=527422
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/MavenProject.java (added)
+++ incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/MavenProject.java Wed Apr 11 01:58:52 2007
@@ -0,0 +1,32 @@
+package org.apache.maven.dotnet.embedder;
+
+import org.codehaus.xfire.aegis.type.java5.*;
+import org.apache.maven.model.Model;
+
+import java.util.List;
+import java.util.Set;
+
+@XmlType(namespace="urn:maven-embedder")
+public interface MavenProject extends Comparable
+{
+
+    /**
+     * Role used to register component implementations with the container.
+     */
+    String ROLE = MavenProject.class.getName();
+
+    @XmlElement(name="pomPath", namespace="urn:maven-embedder")
+    String getPomPath();
+
+    @XmlElement(name="groupId", namespace="urn:maven-embedder")
+    String getGroupId();
+
+    @XmlElement(name="artifactId", namespace="urn:maven-embedder")
+    String getArtifactId();
+
+    @XmlElement(name="version", namespace="urn:maven-embedder")
+    String getVersion();
+
+    @XmlElement(name="mavenProjects", namespace="urn:maven-embedder")
+    Set<MavenProject> getMavenProjects();
+}
\ No newline at end of file

Propchange: incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/MavenProject.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/impl/MavenEmbedderServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/impl/MavenEmbedderServiceImpl.java?view=diff&rev=527422&r1=527421&r2=527422
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/impl/MavenEmbedderServiceImpl.java (original)
+++ incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/impl/MavenEmbedderServiceImpl.java Wed Apr 11 01:58:52 2007
@@ -2,158 +2,281 @@
 
 import org.apache.maven.dotnet.embedder.MavenEmbedderService;
 import org.apache.maven.dotnet.embedder.MavenExecutionRequest;
+import org.apache.maven.dotnet.embedder.MavenProject;
+import org.apache.maven.dotnet.embedder.logger.SocketLoggerManager;
 import org.apache.maven.embedder.MavenEmbedder;
 import org.apache.maven.embedder.MavenEmbedderException;
-import org.apache.maven.embedder.MavenEmbedderConsoleLogger;
-import org.apache.maven.embedder.PlexusLoggerAdapter;
-import org.apache.maven.embedder.MavenEmbedderLogger;
-import org.apache.maven.BuildFailureException;
-import org.apache.maven.cli.ConsoleDownloadMonitor;
-import org.apache.maven.cli.MavenCli;
-import org.apache.maven.monitor.event.EventMonitor;
-import org.apache.maven.monitor.event.DefaultEventMonitor;
-import org.apache.maven.lifecycle.LifecycleExecutionException;
-import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.ProjectBuildingException;
+import org.apache.maven.embedder.Configuration;
+import org.apache.maven.embedder.DefaultConfiguration;
+import org.apache.maven.embedder.ContainerCustomizer;
+import org.apache.maven.settings.Settings;
+import org.apache.maven.execution.DefaultMavenExecutionRequest;
+import org.apache.maven.model.Model;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.Disposable;
-import org.codehaus.plexus.util.dag.CycleDetectedException;
-import org.codehaus.plexus.logging.LogEnabled;
-import org.codehaus.plexus.logging.Logger;
-import org.codehaus.classworlds.ClassWorld;
-import org.codehaus.classworlds.DuplicateRealmException;
+import org.codehaus.plexus.logging.AbstractLogEnabled;
+
+import org.codehaus.plexus.classworlds.ClassWorld;
+import org.codehaus.plexus.PlexusContainer;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
+import org.codehaus.plexus.util.DirectoryScanner;
+import org.codehaus.plexus.component.repository.ComponentDescriptor;
 
 import java.util.List;
 import java.util.ArrayList;
 import java.util.Properties;
+import java.util.Set;
+import java.util.HashSet;
 import java.io.File;
+import java.io.IOException;
 
 public final class MavenEmbedderServiceImpl
-    implements MavenEmbedderService, Initializable, Disposable, LogEnabled
+    extends AbstractLogEnabled
+    implements MavenEmbedderService, Initializable, Disposable
 {
 
     private MavenEmbedder embedder;
 
-    private Logger logger;
-
-    private MavenEmbedderConsoleLogger embedderLogger;
-
     public MavenEmbedderServiceImpl()
     {
     }
 
-    public void enableLogging( Logger logger )
-    {
-        this.logger = logger;
-    }
-
-    /*
-     *  Uses the CLI
-     */
     public void execute( MavenExecutionRequest request )
     {
-        String args[] = new String[3];
-        args[0] = "install";
-        File pomFile = new File( "..\\dotnet-artifact\\pom.xml" );
-        args[1] = "-f";
-        args[2] = pomFile.getAbsolutePath();
-        ClassWorld classWorld = new ClassWorld();
-        try
+
+        System.out.println( "POM FILE = " + request.getPomFile() );
+        System.out.println( "GOAL = " + request.getGoal() );
+
+        List<String> goals = new ArrayList<String>();
+        goals.add( request.getGoal() );
+       // File executionRootDirectory = new File( new File( request.getPomFile() ).getParent() );
+        Properties props = new Properties();
+        props.putAll( System.getProperties() );
+        props.put( "settings.localRepository", new File(
+            System.getProperty( "user.home" ) + File.separator + ".m2/repository" ).getAbsolutePath() );
+        org.apache.maven.execution.MavenExecutionRequest executionRequest = new DefaultMavenExecutionRequest();
+        executionRequest.setPomFile(request.getPomFile() );
+        executionRequest.setGoals( goals );
+        executionRequest.setRecursive( true );
+        //executionRequest.setBaseDirectory( executionRootDirectory );
+
+        Settings settings = embedder.getSettings();
+        if ( settings != null )
         {
-            classWorld.newRealm( "plexus.core", Thread.currentThread().getContextClassLoader() );
+            System.out.println( "SETTINGS = " + settings.isOffline() );
         }
-        catch ( DuplicateRealmException e )
+        executionRequest.setSettings( settings );
+        embedder.execute( executionRequest );
+    }
+
+
+    private Set<MavenProject> getFlatSetFor( Set<MavenProject> mavenProjects )
+    {
+        Set<MavenProject> flatSet = new HashSet<MavenProject>();
+        flatSet.addAll( mavenProjects );
+        for ( MavenProject mavenProject : mavenProjects )
         {
-            e.printStackTrace();
+            flatSet.addAll( getFlatSetFor( mavenProject.getMavenProjects() ) );
         }
-        MavenCli.main( args, classWorld );
+        return flatSet;
+    }
 
+    public Set<org.apache.maven.dotnet.embedder.MavenProject> getMavenProjectsFor( String basedir )
+    {
+        Set<MavenProject> allMavenProjects = getMavenProjectsWithoutSubprojects( basedir );
+        Set<MavenProject> mavenProjects = new HashSet<MavenProject>();
+        for ( MavenProject mavenProject : getMavenProjectsFrom( basedir ) )
+        {
+            System.out.println( "ADDING: " + mavenProject.getArtifactId() + ":" + mavenProject.getPomPath());
+            mavenProjects.addAll( attachMavenProjectsFor( new File( mavenProject.getPomPath() ), allMavenProjects ) );
+        }
+        Set<MavenProject> orphanedMavenProjects = new HashSet<MavenProject>( allMavenProjects );
+        orphanedMavenProjects.removeAll( getFlatSetFor( mavenProjects ) );
+        mavenProjects.addAll( orphanedMavenProjects );
+        return mavenProjects;
     }
 
-    /*
-     * Uses the embedder
-     */
-    public void execute1( MavenExecutionRequest request )
+    public void initialize()
     {
+        ClassWorld classWorld = new ClassWorld();
 
-        MavenProject mavenProject = null;
         try
         {
-            mavenProject = embedder.readProject( new File( request.getPomFile() ) );
+            classWorld.newRealm( "plexus.core", Thread.currentThread().getContextClassLoader() );
         }
-        catch ( ProjectBuildingException e )
+        catch ( org.codehaus.plexus.classworlds.realm.DuplicateRealmException e )
         {
-            logger.info( "", e );
+            e.printStackTrace();
         }
-        List<String> goals = new ArrayList<String>();
-        goals.add( "install" );
-        File executionRootDirectory =
-            new File(new File( request.getPomFile() ).getParent());
-        EventMonitor eventMonitor =
-            new DefaultEventMonitor( new PlexusLoggerAdapter( new MavenEmbedderConsoleLogger() ) );
+        Configuration configuration = new DefaultConfiguration();
+        configuration.setClassWorld( classWorld );
+        configuration.setLocalRepository(
+            new File( System.getProperty( "user.home" ) + File.separator + ".m2/repository" ) );
+
+        File userLoc = new File( System.getProperty( "user.home" ), ".m2" );
+        File userSettingsPath = new File( userLoc, "settings.xml" );
+        configuration.setUserSettingsFile( userSettingsPath );
+        configuration.setMavenEmbedderLogger( null );
+
+        configuration.setConfigurationCustomizer( new ContainerCustomizer()
+        {
+            public void customize( PlexusContainer plexusContainer )
+            {
+                SocketLoggerManager loggerManager = new SocketLoggerManager();
+                loggerManager.initialize();
+                plexusContainer.setLoggerManager( loggerManager );
+
+                ComponentDescriptor componentDescriptor =
+                    plexusContainer.getComponentDescriptor( org.codehaus.plexus.logging.LoggerManager.ROLE );
+                componentDescriptor.setImplementation( "org.apache.maven.dotnet.embedder.logger.SocketLoggerManager" );
+            }
+        } );
 
         try
         {
-            embedder.execute( mavenProject, goals, eventMonitor, new ConsoleDownloadMonitor(), new Properties(),
-                              executionRootDirectory );
-        }
-        catch ( CycleDetectedException e )
-        {
-            e.printStackTrace();
+            embedder = new MavenEmbedder( configuration );
         }
-        catch ( LifecycleExecutionException e )
+        catch ( MavenEmbedderException e )
         {
             e.printStackTrace();
         }
-        catch ( BuildFailureException e )
+    }
+
+    public void dispose()
+    {
+        try
         {
-            printFullTrace( e );
+            embedder.stop();
         }
-        catch ( org.apache.maven.project.DuplicateProjectException e )
+        catch ( MavenEmbedderException e )
         {
             e.printStackTrace();
         }
     }
 
-    private void printFullTrace( Throwable t )
+    private Set<MavenProject> getMavenProjectsFrom( String rootDirectory )
     {
-        Throwable cause = t.getCause();
-        if ( cause != null )
-        {
-            printFullTrace( cause );
+        DirectoryScanner scanner = new DirectoryScanner();
+        scanner.setBasedir( rootDirectory );
+        String[] includes = new String[1];
+        includes[0] = "*pom*.xml";
+        scanner.setIncludes( includes );
+        scanner.scan();
+
+        Set<MavenProject> mavenProjects = new HashSet<MavenProject>();
+        for ( String pomFile : scanner.getIncludedFiles() )
+        {
+
+            MavenProjectImpl mavenProject = new MavenProjectImpl();
+            Model model = null;
+            try
+            {
+                model = embedder.readModel( new File( rootDirectory, pomFile ) );
+            }
+            catch ( XmlPullParserException e )
+            {
+                e.printStackTrace();
+            }
+            catch ( IOException e )
+            {
+                e.printStackTrace();
+            }
+            if ( model != null )
+            {
+                mavenProject.setArtifactId( model.getArtifactId() );
+                mavenProject.setGroupId( model.getGroupId() );
+                mavenProject.setVersion( model.getVersion() );
+                mavenProject.setPomPath( new File( rootDirectory, pomFile ).getAbsolutePath() );
+                mavenProject.setModel( model );
+                mavenProjects.add( mavenProject );
+            }
         }
+        //Collections.sort( mavenProjects );
+        return mavenProjects;
     }
 
-    public void initialize()
+    private Set<MavenProject> getMavenProjectsWithoutSubprojects( String rootDirectory )
     {
-        embedderLogger = new MavenEmbedderConsoleLogger();
-        embedderLogger.setThreshold( MavenEmbedderLogger.LEVEL_DEBUG );
-        embedder = new MavenEmbedder();
-
-        embedder.setClassLoader( Thread.currentThread().getContextClassLoader() );
-        embedder.setLogger( embedderLogger );
-        embedder.setAlignWithUserInstallation( true );
-        embedder.setLocalRepositoryDirectory( new File( System.getProperty( "user.home" ) + File.separator + ".m2" ) );
+        DirectoryScanner scanner = new DirectoryScanner();
+        scanner.setBasedir( rootDirectory );
+        String[] includes = new String[1];
+        includes[0] = "**/*pom*.xml";
+        scanner.setIncludes( includes );
+        scanner.scan();
+
+        Set<MavenProject> mavenProjects = new HashSet<MavenProject>();
+        for ( String pomFile : scanner.getIncludedFiles() )
+        {
+            MavenProjectImpl mavenProject = new MavenProjectImpl();
+            Model model = null;
+            try
+            {
+                model = embedder.readModel( new File( rootDirectory, pomFile ) );
+            }
+            catch ( XmlPullParserException e )
+            {
+                e.printStackTrace();
+            }
+            catch ( IOException e )
+            {
+                e.printStackTrace();
+            }
+            if ( model != null )
+            {
+                mavenProject.setArtifactId( model.getArtifactId() );
+                mavenProject.setGroupId( model.getGroupId() );
+                mavenProject.setVersion( model.getVersion() );
+                mavenProject.setPomPath( new File( rootDirectory, pomFile ).getAbsolutePath() );
+                mavenProject.setModel( model );
+                mavenProjects.add( mavenProject );
+            }
+        }
+        //Collections.sort( mavenProjects );
+        return mavenProjects;
+    }
 
-        try
+    private MavenProject getMavenProjectForPomFile( File pomFile, Set<MavenProject> allMavenProjects )
+    {
+        for ( MavenProject mavenProject : allMavenProjects )
         {
-            embedder.start();
+            if ( pomFile.getAbsolutePath().equals( mavenProject.getPomPath() ) )
+            {
+                return mavenProject;
+            }
         }
-        catch ( MavenEmbedderException e )
-        {
-            e.printStackTrace();
+        return null;
+    }
+
+    private Set<MavenProject> attachMavenProjectsFor( File pomFile, Set<MavenProject> allMavenProjects )
+    {
+        Set<MavenProject> attachedMavenProjects = new HashSet<MavenProject>();
+        MavenProjectImpl mavenProject = (MavenProjectImpl) getMavenProjectForPomFile( pomFile, allMavenProjects );
+        attachedMavenProjects.add( mavenProject );
+        List<String> modules = mavenProject.getModel().getModules();
+        Set<MavenProject> childProjects = new HashSet<MavenProject>();
+        for ( String module : modules )
+        {
+            File moduleFile = new File( pomFile.getParent() + "/" + module + "/pom.xml" );
+            MavenProject childProject = getMavenProjectForPomFile( moduleFile, allMavenProjects );
+            childProjects.add( childProject );
+            attachMavenProjectsFor( moduleFile, allMavenProjects);
         }
+        mavenProject.setMavenProjects( childProjects );
+        return attachedMavenProjects;
     }
 
-    public void dispose()
+    private void printProjects( Set<MavenProject> mavenProjects, int indent )
     {
-        try
+        StringBuffer dashes = new StringBuffer();
+        for ( int i = 0; i < indent; i++ )
         {
-            embedder.stop();
+            dashes.append( "--" );
         }
-        catch ( MavenEmbedderException e )
+        for ( MavenProject mavenProject : mavenProjects )
         {
-            e.printStackTrace();
+            System.out.println( dashes.toString() + mavenProject.getArtifactId() );
+
+            printProjects( mavenProject.getMavenProjects(), indent + 1 );
         }
     }
 }

Modified: incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/impl/MavenExecutionRequestImpl.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/impl/MavenExecutionRequestImpl.java?view=diff&rev=527422&r1=527421&r2=527422
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/impl/MavenExecutionRequestImpl.java (original)
+++ incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/impl/MavenExecutionRequestImpl.java Wed Apr 11 01:58:52 2007
@@ -2,17 +2,32 @@
 
 import org.apache.maven.dotnet.embedder.MavenExecutionRequest;
 
-public class MavenExecutionRequestImpl
-    implements MavenExecutionRequest
+public class MavenExecutionRequestImpl implements MavenExecutionRequest
+    
 {
+    private String pomFile;
 
-    public void setPomFile( java.lang.String string )
+    private String goal;
+
+    public String getPomFile()
     {
+        return pomFile;
+    }
 
+    public void setPomFile( String pomFile )
+    {
+        this.pomFile = pomFile;
     }
 
-    public String getPomFile()
+    public String getGoal()
     {
-          return "";
+        return goal;
     }
+
+    public void setGoal( String goal )
+    {
+        this.goal = goal;
+    }
+
+
 }

Added: incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/impl/MavenProjectImpl.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/impl/MavenProjectImpl.java?view=auto&rev=527422
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/impl/MavenProjectImpl.java (added)
+++ incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/impl/MavenProjectImpl.java Wed Apr 11 01:58:52 2007
@@ -0,0 +1,131 @@
+package org.apache.maven.dotnet.embedder.impl;
+
+import org.apache.maven.dotnet.embedder.MavenProject;
+import org.apache.maven.model.Model;
+
+import java.util.Set;
+
+public class MavenProjectImpl
+    implements MavenProject
+{
+
+    private String pomPath;
+
+    private String groupId;
+
+    private String artifactId;
+
+    private String version;
+
+    private Set<MavenProject> mavenProjects;
+
+    private Model model;
+
+    public Set<MavenProject> getMavenProjects()
+    {
+        return mavenProjects;
+    }
+
+    public Model getModel()
+    {
+        return model;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public void setModel( Model model )
+    {
+        this.model = model;
+    }
+
+    public void setMavenProjects( Set<MavenProject> mavenProjects )
+    {
+        this.mavenProjects = mavenProjects;
+    }
+
+    public String getPomPath()
+    {
+        return pomPath;
+    }
+
+    public void setPomPath( String pomPath )
+    {
+        this.pomPath = pomPath;
+    }
+
+    public String getGroupId()
+    {
+        return groupId;
+    }
+
+    public void setGroupId( String groupId )
+    {
+        this.groupId = groupId;
+    }
+
+    public String getArtifactId()
+    {
+        return artifactId;
+    }
+
+    public void setArtifactId( String artifactId )
+    {
+        this.artifactId = artifactId;
+    }
+
+    public String getVersion()
+    {
+        return version;
+    }
+
+    public void setVersion( String version )
+    {
+        this.version = version;
+    }
+
+    public boolean equals( Object o )
+    {
+        if ( this == o )
+        {
+            return true;
+        }
+        if ( o == null || getClass() != o.getClass() )
+        {
+            return false;
+        }
+
+        final MavenProjectImpl that = (MavenProjectImpl) o;
+
+        if ( !pomPath.equals( that.pomPath ) )
+        {
+            return false;
+        }
+
+        return true;
+    }
+
+    public int hashCode()
+    {
+        return pomPath.hashCode();
+    }
+
+    public int compareTo( Object o )
+        throws ClassCastException
+    {
+        MavenProject mavenProject = (MavenProject) o;
+        int otherRank = getRank( mavenProject.getPomPath() );
+        int thisRank = getRank( pomPath );
+        if ( otherRank < thisRank )
+        {
+            return -1;
+        }
+        else if ( otherRank > thisRank )
+        {
+            return 1;
+        }
+        return 0;
+    }
+
+    private int getRank( String path )
+    {
+        return path.split( "[/]" ).length;
+    }
+}

Propchange: incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/impl/MavenProjectImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/logger/MavenFormatter.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/logger/MavenFormatter.java?view=auto&rev=527422
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/logger/MavenFormatter.java (added)
+++ incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/logger/MavenFormatter.java Wed Apr 11 01:58:52 2007
@@ -0,0 +1,24 @@
+package org.apache.maven.dotnet.embedder.logger;
+
+import java.util.logging.Formatter;
+import java.util.logging.LogRecord;
+
+public class MavenFormatter
+    extends Formatter
+{
+    private static String lineSeparator = System.getProperty( "line.separator" );
+
+    public synchronized String format( LogRecord logRecord )
+    {
+        StringBuffer sb = new StringBuffer();
+        sb.append( "[" ).append( logRecord.getLevel().getLocalizedName() ).append( "] " );
+        sb.append( formatMessage( logRecord ) );
+
+        if ( logRecord.getThrown() != null )
+        {
+            sb.append( lineSeparator );
+            sb.append( logRecord.getThrown().toString() );
+        }
+        return sb.append( lineSeparator ).toString();
+    }
+}

Propchange: incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/logger/MavenFormatter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/logger/SocketLogger.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/logger/SocketLogger.java?view=auto&rev=527422
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/logger/SocketLogger.java (added)
+++ incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/logger/SocketLogger.java Wed Apr 11 01:58:52 2007
@@ -0,0 +1,154 @@
+package org.apache.maven.dotnet.embedder.logger;
+
+import org.codehaus.plexus.logging.AbstractLogger;
+import org.codehaus.plexus.logging.Logger;
+
+import java.io.IOException;
+import java.util.logging.SocketHandler;
+import java.util.logging.LogManager;
+import java.util.logging.Handler;
+
+public class SocketLogger
+    extends AbstractLogger
+{
+    private java.util.logging.Logger logger;
+
+    public SocketLogger( int threshold, java.util.logging.Logger logger )
+    {
+        super( threshold, logger.getName() );
+        this.logger = logger;
+    }
+
+    public void init()
+        throws IOException
+    {
+        SocketHandler socketHandler;
+        socketHandler = new SocketHandler( "localhost", 9099 );
+        socketHandler.setFormatter( new MavenFormatter() );
+        for ( Handler handler : logger.getHandlers() )
+        {
+            logger.removeHandler( handler );
+        }
+        logger.addHandler( socketHandler );
+    }
+
+    public Logger getChildLogger( String name )
+    {
+        String childName = logger.getName() + "." + name;
+        SocketLogger socketLogger = new SocketLogger( getThreshold(), java.util.logging.Logger.getLogger( childName ) );
+        try
+        {
+            socketLogger.init();
+        }
+        catch ( IOException e )
+        {
+            e.printStackTrace();
+            return null;
+        }
+        return socketLogger;
+    }
+
+    public void debug( String message, Throwable throwable )
+    {
+        if ( isDebugEnabled() )
+        {
+            System.out.print( "[ maven embedder DEBUG] " );
+            System.out.println( message );
+
+            if ( null != throwable )
+            {
+                throwable.printStackTrace( System.out );
+            }
+        }
+    }
+
+    public void info( String message )
+    {
+        logger.info( message );
+        /*
+        try
+        {
+            OutputStream os = socket.getOutputStream();
+            os.write( message1.getBytes());
+            os.flush();
+        }
+        catch ( IOException e )
+        {
+            e.printStackTrace();
+        }
+        */
+/*
+        if ( isInfoEnabled() )
+        {
+            System.out.print( "[ maven embedder INFO] " );
+            System.out.println( message );
+
+
+            if ( null != throwable )
+            {
+                throwable.printStackTrace( System.out );
+            }
+        }
+        */
+    }
+
+    public void info( String message, Throwable throwable )
+    {
+        logger.info( "[PLEXUS-TEST1]:" + message + "[END-PLEXUS-TEST1]" );
+/*
+        if ( isInfoEnabled() )
+        {
+            System.out.print( "[ maven embedder INFO] " );
+            System.out.println( message );
+
+
+            if ( null != throwable )
+            {
+                throwable.printStackTrace( System.out );
+            }
+        }
+        */
+    }
+
+    public void warn( String message, Throwable throwable )
+    {
+        if ( isWarnEnabled() )
+        {
+            System.out.print( "[ maven embedder WARNING] " );
+            System.out.println( message );
+
+            if ( null != throwable )
+            {
+                throwable.printStackTrace( System.out );
+            }
+        }
+    }
+
+    public void error( String message, Throwable throwable )
+    {
+        if ( isErrorEnabled() )
+        {
+            System.out.print( "[ maven embedder ERROR] " );
+            System.out.println( message );
+
+            if ( null != throwable )
+            {
+                throwable.printStackTrace( System.out );
+            }
+        }
+    }
+
+    public void fatalError( String message, Throwable throwable )
+    {
+        if ( isFatalErrorEnabled() )
+        {
+            System.out.print( "[ maven embedder FATAL ERROR] " );
+            System.out.println( message );
+
+            if ( null != throwable )
+            {
+                throwable.printStackTrace( System.out );
+            }
+        }
+    }
+}

Propchange: incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/logger/SocketLogger.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/logger/SocketLoggerManager.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/logger/SocketLoggerManager.java?view=auto&rev=527422
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/logger/SocketLoggerManager.java (added)
+++ incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/logger/SocketLoggerManager.java Wed Apr 11 01:58:52 2007
@@ -0,0 +1,58 @@
+package org.apache.maven.dotnet.embedder.logger;
+
+import org.codehaus.plexus.logging.BaseLoggerManager;
+import org.codehaus.plexus.logging.Logger;
+
+import java.io.IOException;
+
+public class SocketLoggerManager
+    extends BaseLoggerManager
+{
+    private static SocketLogger logger;
+
+    public void enableLogging( Logger logger )
+    {
+        System.out.println( "SET NEW LOGGER!!!!" );
+        logger = createLogger( "SocketLogger" );
+    }
+
+    public Logger createLogger( String key )
+    {
+        System.out.println( "CREATING LOGGER" );
+        if ( logger != null )
+        {
+            return logger;
+        }
+        logger = new SocketLogger( getThreshold(), java.util.logging.Logger.getLogger( key ) );
+        try
+        {
+            logger.init();
+        }
+        catch ( IOException e )
+        {
+            e.printStackTrace();
+            return null;
+        }
+        return logger;
+    }
+
+    public Logger getLoggerForComponent( String role, String roleHint )
+    {
+        System.out.println( "GET LOGGER COMPONENT" );
+        if ( logger != null )
+        {
+            return logger;
+        }
+        logger = new SocketLogger( getThreshold(), java.util.logging.Logger.getLogger( role ) );
+        try
+        {
+            logger.init();
+        }
+        catch ( IOException e )
+        {
+            e.printStackTrace();
+            return null;
+        }
+        return logger;
+    }
+}

Propchange: incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/logger/SocketLoggerManager.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/resources/META-INF/plexus/components.xml?view=diff&rev=527422&r1=527421&r2=527422
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/resources/META-INF/plexus/components.xml (original)
+++ incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/resources/META-INF/plexus/components.xml Wed Apr 11 01:58:52 2007
@@ -9,6 +9,10 @@
       <implementation>org.apache.maven.dotnet.embedder.impl.MavenExecutionRequestImpl</implementation>
     </component>
     <component>
+      <role>org.apache.maven.dotnet.embedder.MavenProjectt</role>
+      <implementation>org.apache.maven.dotnet.embedder.impl.MavenProjectImpl</implementation>
+    </component>
+    <component>
       <role>org.codehaus.xfire.plexus.config.ConfigurationService</role>
       <implementation>org.codehaus.xfire.plexus.config.DefaultConfigurationService</implementation>
       <configuration>

Added: incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/resources/META-INF/plexus/plexus.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/resources/META-INF/plexus/plexus.xml?view=auto&rev=527422
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/resources/META-INF/plexus/plexus.xml (added)
+++ incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/resources/META-INF/plexus/plexus.xml Wed Apr 11 01:58:52 2007
@@ -0,0 +1,14 @@
+<plexus>
+
+  <!-- Internal components org.apache.maven.dotnet.embedder.logger.SocketLoggerManager-->
+  <components>
+    <component>
+      <role>org.codehaus.plexus.logging.LoggerManager</role>
+      <implementation>org.apache.maven.dotnet.embedder.logger.SocketLoggerManager</implementation>
+      <lifecycle-handler>basic</lifecycle-handler>
+      <configuration>
+        <threshold>info</threshold>
+      </configuration>
+    </component>
+  </components>
+</plexus>

Propchange: incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/main/resources/META-INF/plexus/plexus.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/test/java/ServiceTest.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/test/java/ServiceTest.java?view=diff&rev=527422&r1=527421&r2=527422
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/test/java/ServiceTest.java (original)
+++ incubator/nmaven/branches/SI_XPT/components/dotnet-embedder/src/test/java/ServiceTest.java Wed Apr 11 01:58:52 2007
@@ -1,17 +1,112 @@
 import junit.framework.TestCase;
 import org.apache.maven.dotnet.embedder.MavenEmbedderService;
 import org.apache.maven.dotnet.embedder.MavenExecutionRequest;
+import org.apache.maven.dotnet.embedder.MavenProject;
 import org.apache.maven.dotnet.embedder.impl.MavenEmbedderServiceImpl;
 import org.apache.maven.dotnet.embedder.impl.MavenExecutionRequestImpl;
 
+import java.net.ServerSocket;
+import java.net.InetSocketAddress;
+import java.net.Socket;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.List;
+import java.util.Set;
+
 public class ServiceTest
     extends TestCase
 {
+
+    public void setUp()
+    {
+        ServerThread serverThread = new ServerThread();
+        //  serverThread.run();
+        //   new Thread( serverThread ).start();
+    }
+
     public void testA()
     {
+        /*
+       MavenEmbedderServiceImpl service = new MavenEmbedderServiceImpl();
+       service.initialize();
+
+       MavenExecutionRequest request = new MavenExecutionRequestImpl();
+       request.setPomFile( "C:\\Documents and Settings\\shane\\nmaven-apache\\SI_XPT\\assemblies\\pom.xml" );
+       request.setGoal( "compile" );
+        */
+        //  service.execute( request );
+        //  fail("");
+    }
+
+    public void testB()
+    {
+
         MavenEmbedderServiceImpl service = new MavenEmbedderServiceImpl();
         service.initialize();
-        MavenExecutionRequest request = new MavenExecutionRequestImpl();
-        //service.execute( request );
+        Set<MavenProject> mavenProjects =
+            service.getMavenProjectsFor( "C:\\Documents and Settings\\shane\\nmaven-apache\\SI_XPT\\assemblies" );
+        if ( mavenProjects != null )
+        {
+            printProjects( mavenProjects, 0 );
+        }
+    }
+
+    private void printProjects( Set<MavenProject> mavenProjects, int indent )
+    {
+        if(mavenProjects == null) return;
+        StringBuffer dashes = new StringBuffer();
+        for ( int i = 0; i < indent; i++ )
+        {
+            dashes.append( "--" );
+        }
+        for ( MavenProject mavenProject : mavenProjects )
+        {
+            System.out.println( dashes.toString() + mavenProject.getArtifactId() );
+            printProjects( mavenProject.getMavenProjects(), indent + 1 );
+        }
+    }
+
+    private class ServerThread
+        implements Runnable
+    {
+        public void run()
+        {
+            Socket client;
+            try
+            {
+                ServerSocket socket = new ServerSocket();
+                socket.bind( new InetSocketAddress( "localhost", 9090 ) );
+                while ( true )
+                {
+                    client = socket.accept();
+                    System.out.println( "Accepted Socket" );
+                    write( client );
+
+                }
+            }
+            catch ( IOException e )
+            {
+                e.printStackTrace();
+            }
+        }
+
+        private void write( Socket client )
+        {
+            try
+            {
+                InputStream is = client.getInputStream();
+                byte[] buffer = new byte[1];
+                int read = 0;
+                while ( ( read = is.read( buffer ) ) >= 0 )
+                {
+                    System.out.print( new String( buffer ) );
+                    //  System.out.println("[SOCKET]\r\n" + new String(buffer) + "\r\n[END SOCKET]");
+                }
+            }
+            catch ( IOException e )
+            {
+                e.printStackTrace();
+            }
+        }
     }
 }

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=527422&r1=527421&r2=527422
==============================================================================
--- 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 Wed Apr 11 01:58:52 2007
@@ -266,8 +266,7 @@
                 libraries.add( artifact );
             }
             //Resolving here since the GAC path is vendor and framework aware
-            //TODO: Add support for 32/64 bit GACs
-            else if ( type.equals( "gac" ) )
+            else if ( type.equals( "gac_generic" ) )
             {
                 String gacRoot = null;
                 if ( compilerRequirement.getVendor().equals( Vendor.MICROSOFT ) && (
@@ -283,21 +282,32 @@
                 }
                 else if ( compilerRequirement.getVendor().equals( Vendor.MONO ) )
                 {
-                    //TODO: MONO Support
+                    //TODO: MONO Support - read settings file
                 }
                 if ( gacRoot != null )
                 {
-                    File gacFile = new File( gacRoot + artifact.getArtifactId() + File.separator +
-                        artifact.getVersion() + File.separator + artifact.getArtifactId() + ".dll" );
-                    if ( !gacFile.exists() )
-                    {
-                        throw new PlatformUnsupportedException(
-                            "NMAVEN-000-000: Could not find GAC dependency: File = " + gacFile.getAbsolutePath() );
-                    }
-                    artifact.setFile( gacFile );
+                    setArtifactGacFile( gacRoot, artifact );
                     libraries.add( artifact );
                 }
             }
+            else if ( type.equals( "gac" ) )
+            {
+                String gacRoot = "C:\\WINDOWS\\assembly\\GAC\\";
+                setArtifactGacFile( gacRoot, artifact );
+                libraries.add( artifact );
+            }
+            else if ( type.equals( "gac_32" ) )
+            {
+                String gacRoot =  "C:\\WINDOWS\\assembly\\GAC_32\\";
+                setArtifactGacFile( gacRoot, artifact );
+                libraries.add( artifact );
+            }
+            else if ( type.equals( "gac_msil" ) )
+            {
+                String gacRoot =  "C:\\WINDOWS\\assembly\\GAC_MSIL\\";
+                setArtifactGacFile( gacRoot, artifact );
+                libraries.add( artifact );
+            }
         }
 
         compilerCapability = capabilityMatcher.matchCompilerCapabilityFor( compilerRequirement );
@@ -349,5 +359,18 @@
                 win32icon = icons[0];
             }
         }
+    }
+
+    private void setArtifactGacFile( String gacRoot, Artifact artifact )
+        throws PlatformUnsupportedException
+    {
+        File gacFile = new File( gacRoot + artifact.getArtifactId() + File.separator + artifact.getVersion() + File
+            .separator + artifact.getArtifactId() + ".dll" );
+        if ( !gacFile.exists() )
+        {
+            throw new PlatformUnsupportedException(
+                "NMAVEN-000-000: Could not find GAC dependency: File = " + gacFile.getAbsolutePath() );
+        }
+        artifact.setFile( gacFile );
     }
 }

Modified: incubator/nmaven/branches/SI_XPT/components/dotnet-registry/pom.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/components/dotnet-registry/pom.xml?view=diff&rev=527422&r1=527421&r2=527422
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/dotnet-registry/pom.xml (original)
+++ incubator/nmaven/branches/SI_XPT/components/dotnet-registry/pom.xml Wed Apr 11 01:58:52 2007
@@ -16,7 +16,7 @@
     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-project</artifactId>
-      <version>2.0.4</version>
+      <version>2.1-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>kxml2</groupId>

Modified: incubator/nmaven/branches/SI_XPT/components/dotnet-service/embedder/pom.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/components/dotnet-service/embedder/pom.xml?view=diff&rev=527422&r1=527421&r2=527422
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/dotnet-service/embedder/pom.xml (original)
+++ incubator/nmaven/branches/SI_XPT/components/dotnet-service/embedder/pom.xml Wed Apr 11 01:58:52 2007
@@ -9,6 +9,7 @@
   <description>
     NMaven
   </description>
+
   <dependencies>
     <dependency>
       <groupId>org.apache.maven.dotnet</groupId>

Modified: incubator/nmaven/branches/SI_XPT/components/dotnet-service/embedder/src/main/webapp/WEB-INF/plexus.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/components/dotnet-service/embedder/src/main/webapp/WEB-INF/plexus.xml?view=diff&rev=527422&r1=527421&r2=527422
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/dotnet-service/embedder/src/main/webapp/WEB-INF/plexus.xml (original)
+++ incubator/nmaven/branches/SI_XPT/components/dotnet-service/embedder/src/main/webapp/WEB-INF/plexus.xml Wed Apr 11 01:58:52 2007
@@ -5,4 +5,14 @@
       <role>org.codehaus.xfire.plexus.config.ConfigurationService</role>
     </component>
   </load-on-start>
+  <components>
+    <component>
+      <role>org.codehaus.plexus.logging.LoggerManager</role>
+      <implementation>org.apache.maven.dotnet.embedder.logger.SocketLoggerManager</implementation>
+      <lifecycle-handler>basic</lifecycle-handler>
+      <configuration>
+        <threshold>info</threshold>
+      </configuration>
+    </component>
+  </components>
 </plexus>

Modified: incubator/nmaven/branches/SI_XPT/components/pom.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/components/pom.xml?view=diff&rev=527422&r1=527421&r2=527422
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/pom.xml (original)
+++ incubator/nmaven/branches/SI_XPT/components/pom.xml Wed Apr 11 01:58:52 2007
@@ -119,8 +119,10 @@
     <module>dotnet-model</module>
     <module>dotnet-artifact</module>
     <module>dotnet-assembler</module>
+    <module>dotnet-embedder</module>
     <module>dotnet-executable</module>
     <module>dotnet-registry</module>
+    <module>dotnet-service/embedder</module>
     <module>dotnet-vendor</module>
   </modules>
   <dependencies>



Mime
View raw message