incubator-nmaven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sisb...@apache.org
Subject svn commit: r607780 - in /incubator/nmaven/trunk: components/maven-dotnet-compiler/src/main/java/org/apache/maven/dotnet/compiler/impl/ components/maven-dotnet-compiler/src/test/java/org/apache/maven/dotnet/compiler/impl/ components/maven-dotnet-extens...
Date Mon, 31 Dec 2007 21:52:39 GMT
Author: sisbell
Date: Mon Dec 31 13:52:38 2007
New Revision: 607780

URL: http://svn.apache.org/viewvc?rev=607780&view=rev
Log:
We weren't pulling in system and provided artifacts. Fix for this.

Added:
    incubator/nmaven/trunk/core-integration-tests/src/test/java/org/apache/maven/dotnet/integrationtests/MavenITmng0008CSharpCompileWithProvidedDependency.java
  (with props)
    incubator/nmaven/trunk/core-integration-tests/src/test/resources/MavenITmng-0008-CSharpCompileWithProvidedDependency/
    incubator/nmaven/trunk/core-integration-tests/src/test/resources/MavenITmng-0008-CSharpCompileWithProvidedDependency/It0008.cs
    incubator/nmaven/trunk/core-integration-tests/src/test/resources/MavenITmng-0008-CSharpCompileWithProvidedDependency/pom.xml
  (with props)
Modified:
    incubator/nmaven/trunk/components/maven-dotnet-compiler/src/main/java/org/apache/maven/dotnet/compiler/impl/DotnetCompilerContextImpl.java
    incubator/nmaven/trunk/components/maven-dotnet-compiler/src/test/java/org/apache/maven/dotnet/compiler/impl/DotnetCompilerContextImplTest.java
    incubator/nmaven/trunk/components/maven-dotnet-extensions/src/main/java/org/apache/maven/dotnet/extensions/compiler/CSharpClassCompiler.java
    incubator/nmaven/trunk/core-integration-tests/src/test/java/org/apache/maven/dotnet/integrationtests/IntegrationTestSuite.java
    incubator/nmaven/trunk/plugins/maven-compiler-plugin/src/main/java/org/apache/maven/dotnet/plugin/compiler/CompilerMojo.java
    incubator/nmaven/trunk/plugins/maven-compiler-plugin/src/main/java/org/apache/maven/dotnet/plugin/compiler/TestCompilerMojo.java

Modified: incubator/nmaven/trunk/components/maven-dotnet-compiler/src/main/java/org/apache/maven/dotnet/compiler/impl/DotnetCompilerContextImpl.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/maven-dotnet-compiler/src/main/java/org/apache/maven/dotnet/compiler/impl/DotnetCompilerContextImpl.java?rev=607780&r1=607779&r2=607780&view=diff
==============================================================================
--- incubator/nmaven/trunk/components/maven-dotnet-compiler/src/main/java/org/apache/maven/dotnet/compiler/impl/DotnetCompilerContextImpl.java
(original)
+++ incubator/nmaven/trunk/components/maven-dotnet-compiler/src/main/java/org/apache/maven/dotnet/compiler/impl/DotnetCompilerContextImpl.java
Mon Dec 31 13:52:38 2007
@@ -182,18 +182,17 @@
             for ( Artifact artifact : directDependentArtifacts )
             {
                 String type = artifact.getType();
+                String scope = artifact.getScope();
                 if ( type.equals( ArtifactType.MODULE.getPackagingType() ) )
                 {
-                    if ( !ArtifactScope.COMPILE.isMatchByString( artifact.getScope() ) )
+                    if ( !ArtifactScope.COMPILE.isMatchByString( scope ) )
                     {
-                        throw new InitializationException(
-                            "Module must be of compile scope: Scope = " + artifact.getScope()
);
+                        throw new InitializationException( "Module must be of compile scope:
Scope = " + scope );
                     }
                     moduleDependencies.add( artifact );
                 }
             }
         }
-
         addLibraryArtifactsToTarget( project.getCompileArtifacts(), compileLibraryDependencies
);
         addLibraryArtifactsToTarget( project.getTestArtifacts(), testLibraryDependencies
);
         addLibraryArtifactsToTarget( project.getRuntimeArtifacts(), runtimeLibraryDependencies
);

Modified: incubator/nmaven/trunk/components/maven-dotnet-compiler/src/test/java/org/apache/maven/dotnet/compiler/impl/DotnetCompilerContextImplTest.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/maven-dotnet-compiler/src/test/java/org/apache/maven/dotnet/compiler/impl/DotnetCompilerContextImplTest.java?rev=607780&r1=607779&r2=607780&view=diff
==============================================================================
--- incubator/nmaven/trunk/components/maven-dotnet-compiler/src/test/java/org/apache/maven/dotnet/compiler/impl/DotnetCompilerContextImplTest.java
(original)
+++ incubator/nmaven/trunk/components/maven-dotnet-compiler/src/test/java/org/apache/maven/dotnet/compiler/impl/DotnetCompilerContextImplTest.java
Mon Dec 31 13:52:38 2007
@@ -124,6 +124,30 @@
         assertThat( libraries.size(), equalTo( 1 ) );
     }
 
+    @Test
+    public void testInit_WithProvidedDependency()
+        throws InitializationException, IOException
+    {
+        DotnetCompilerContextImpl ctx = new DotnetCompilerContextImpl();
+        MavenProject project = new MavenProject();
+
+        Set<Artifact> dependencyArtifacts = new HashSet<Artifact>();
+        project.setArtifacts( dependencyArtifacts );
+        Artifact artifact = new DefaultArtifact( "groupId", "artifactId", VersionRange.createFromVersion(
"1.0" ),
+                                                 "provided", "dotnet:library", null, new
DefaultArtifactHandler( "dotnet:library" ), false );
+        artifact.setArtifactHandler( new DummyArtifactHandler());
+        dependencyArtifacts.add( artifact );
+
+        Build build = new Build();
+        build.setDirectory( "" );
+        project.setBuild( build );
+
+        ctx.turnOffCompilerExistsCheck();
+        ctx.init( project, getDefaultDotnetCompilerConfig() );
+
+        Set<Artifact> libraries = ctx.getLibraryDependenciesFor(ArtifactScope.COMPILE);
+        assertThat( libraries.size(), equalTo( 1 ) );
+    }
     //@Test
     public void testInit_WithGacGenericAndMicrosoft()
         throws InitializationException, IOException

Modified: incubator/nmaven/trunk/components/maven-dotnet-extensions/src/main/java/org/apache/maven/dotnet/extensions/compiler/CSharpClassCompiler.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/maven-dotnet-extensions/src/main/java/org/apache/maven/dotnet/extensions/compiler/CSharpClassCompiler.java?rev=607780&r1=607779&r2=607780&view=diff
==============================================================================
--- incubator/nmaven/trunk/components/maven-dotnet-extensions/src/main/java/org/apache/maven/dotnet/extensions/compiler/CSharpClassCompiler.java
(original)
+++ incubator/nmaven/trunk/components/maven-dotnet-extensions/src/main/java/org/apache/maven/dotnet/extensions/compiler/CSharpClassCompiler.java
Mon Dec 31 13:52:38 2007
@@ -57,7 +57,7 @@
     {
         DotnetCompilerConfig config = (DotnetCompilerConfig) compilerContext.getCompilerConfig();
 
-        Set<Artifact> references = null;
+        Set<Artifact> references;
         if ( compilerContext.getCompilerConfig().isTestCompile() )
         {
             references = compilerContext.getLibraryDependenciesFor( ArtifactScope.TEST );

Modified: incubator/nmaven/trunk/core-integration-tests/src/test/java/org/apache/maven/dotnet/integrationtests/IntegrationTestSuite.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/core-integration-tests/src/test/java/org/apache/maven/dotnet/integrationtests/IntegrationTestSuite.java?rev=607780&r1=607779&r2=607780&view=diff
==============================================================================
--- incubator/nmaven/trunk/core-integration-tests/src/test/java/org/apache/maven/dotnet/integrationtests/IntegrationTestSuite.java
(original)
+++ incubator/nmaven/trunk/core-integration-tests/src/test/java/org/apache/maven/dotnet/integrationtests/IntegrationTestSuite.java
Mon Dec 31 13:52:38 2007
@@ -27,14 +27,16 @@
         }
 
         TestSuite suite = new TestSuite();
+
         suite.addTestSuite( MavenITmng0000CSharpCompileLibrary.class );
         suite.addTestSuite( MavenITmng0001CSharpCompileExe.class );
         suite.addTestSuite( MavenITmng0002CSharpCompileModule.class );
         suite.addTestSuite( MavenITmng0003CSharpCompileWinexe.class );
         suite.addTestSuite( MavenITmng0004CSharpCompileWithDependency.class );
-        suite.addTestSuite( MavenITmng0005CSharpCompileWithTransitiveDependency.class );
+        suite.addTestSuite( MavenITmng0005CSharpCompileWithTransitiveDependency.class );
      
 //        suite.addTestSuite( MavenITmng0006NUnitTestExecution.class );
         suite.addTestSuite( MavenITmng0007CSharpCompileTestLibrary.class );
+        suite.addTestSuite( MavenITmng0008CSharpCompileWithProvidedDependency.class );
         return suite;
     }
 }

Added: incubator/nmaven/trunk/core-integration-tests/src/test/java/org/apache/maven/dotnet/integrationtests/MavenITmng0008CSharpCompileWithProvidedDependency.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/core-integration-tests/src/test/java/org/apache/maven/dotnet/integrationtests/MavenITmng0008CSharpCompileWithProvidedDependency.java?rev=607780&view=auto
==============================================================================
--- incubator/nmaven/trunk/core-integration-tests/src/test/java/org/apache/maven/dotnet/integrationtests/MavenITmng0008CSharpCompileWithProvidedDependency.java
(added)
+++ incubator/nmaven/trunk/core-integration-tests/src/test/java/org/apache/maven/dotnet/integrationtests/MavenITmng0008CSharpCompileWithProvidedDependency.java
Mon Dec 31 13:52:38 2007
@@ -0,0 +1,25 @@
+package org.apache.maven.dotnet.integrationtests;
+
+import org.apache.maven.integrationtests.AbstractMavenIntegrationTestCase;
+import org.apache.maven.it.util.ResourceExtractor;
+import org.apache.maven.it.Verifier;
+import org.apache.maven.dotnet.BuildDirectories;
+
+import java.io.File;
+
+public class MavenITmng0008CSharpCompileWithProvidedDependency
+    extends AbstractMavenIntegrationTestCase
+{
+    public void testit0008()
+        throws Exception
+    {
+        File testDir =
+            ResourceExtractor.simpleExtractResources( getClass(), "/MavenITmng-0008-CSharpCompileWithProvidedDependency"
);
+        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
+        verifier.executeGoal( "install" );
+        verifier.assertFilePresent( "target/" + BuildDirectories.BUILD_SOURCES.getBuildDirectoryName()
+ "/It0008.cs" );
+        verifier.assertFilePresent( "target/NMaven.It.It0008-1.0.0.dll" );
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
+    }
+}

Propchange: incubator/nmaven/trunk/core-integration-tests/src/test/java/org/apache/maven/dotnet/integrationtests/MavenITmng0008CSharpCompileWithProvidedDependency.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/nmaven/trunk/core-integration-tests/src/test/resources/MavenITmng-0008-CSharpCompileWithProvidedDependency/It0008.cs
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/core-integration-tests/src/test/resources/MavenITmng-0008-CSharpCompileWithProvidedDependency/It0008.cs?rev=607780&view=auto
==============================================================================
--- incubator/nmaven/trunk/core-integration-tests/src/test/resources/MavenITmng-0008-CSharpCompileWithProvidedDependency/It0008.cs
(added)
+++ incubator/nmaven/trunk/core-integration-tests/src/test/resources/MavenITmng-0008-CSharpCompileWithProvidedDependency/It0008.cs
Mon Dec 31 13:52:38 2007
@@ -0,0 +1,8 @@
+namespace NMaven.IT {
+
+public class It0008 {
+	public static void Main () { 
+		new It0000();
+	} 
+}
+}

Added: incubator/nmaven/trunk/core-integration-tests/src/test/resources/MavenITmng-0008-CSharpCompileWithProvidedDependency/pom.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/core-integration-tests/src/test/resources/MavenITmng-0008-CSharpCompileWithProvidedDependency/pom.xml?rev=607780&view=auto
==============================================================================
--- incubator/nmaven/trunk/core-integration-tests/src/test/resources/MavenITmng-0008-CSharpCompileWithProvidedDependency/pom.xml
(added)
+++ incubator/nmaven/trunk/core-integration-tests/src/test/resources/MavenITmng-0008-CSharpCompileWithProvidedDependency/pom.xml
Mon Dec 31 13:52:38 2007
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<project>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>NMaven.Its</groupId>
+  <artifactId>NMaven.It.It0008</artifactId>
+  <packaging>dotnet:library</packaging>
+  <version>1.0.0</version>
+  <name>NMaven.It.It0008</name>
+  <build>
+    <sourceDirectory>.</sourceDirectory>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.dotnet.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <extensions>true</extensions>
+      </plugin>
+    </plugins>
+  </build>
+  <dependencies>
+    <dependency>
+      <groupId>NMaven.Its</groupId>
+      <artifactId>NMaven.It.It0000</artifactId>
+      <version>1.0.0</version>
+      <type>dotnet:library</type>
+      <scope>provided</scope>
+    </dependency>
+  </dependencies>
+</project>

Propchange: incubator/nmaven/trunk/core-integration-tests/src/test/resources/MavenITmng-0008-CSharpCompileWithProvidedDependency/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/nmaven/trunk/plugins/maven-compiler-plugin/src/main/java/org/apache/maven/dotnet/plugin/compiler/CompilerMojo.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/plugins/maven-compiler-plugin/src/main/java/org/apache/maven/dotnet/plugin/compiler/CompilerMojo.java?rev=607780&r1=607779&r2=607780&view=diff
==============================================================================
--- incubator/nmaven/trunk/plugins/maven-compiler-plugin/src/main/java/org/apache/maven/dotnet/plugin/compiler/CompilerMojo.java
(original)
+++ incubator/nmaven/trunk/plugins/maven-compiler-plugin/src/main/java/org/apache/maven/dotnet/plugin/compiler/CompilerMojo.java
Mon Dec 31 13:52:38 2007
@@ -49,7 +49,7 @@
  *
  * @goal compile
  * @phase compile
- * @requiresDependencyResolution
+ * @requiresDependencyResolution compile
  * @description Maven Mojo for compiling class files to the .NET Intermediate Language
  */
 public class CompilerMojo
@@ -124,7 +124,8 @@
     public void execute()
         throws MojoExecutionException, MojoFailureException
     {
-        File sourceDir = 
+
+        File sourceDir =
             new File( project.getBuild().getDirectory(), 
                       BuildDirectories.BUILD_SOURCES.getBuildDirectoryName() );
         

Modified: incubator/nmaven/trunk/plugins/maven-compiler-plugin/src/main/java/org/apache/maven/dotnet/plugin/compiler/TestCompilerMojo.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/plugins/maven-compiler-plugin/src/main/java/org/apache/maven/dotnet/plugin/compiler/TestCompilerMojo.java?rev=607780&r1=607779&r2=607780&view=diff
==============================================================================
--- incubator/nmaven/trunk/plugins/maven-compiler-plugin/src/main/java/org/apache/maven/dotnet/plugin/compiler/TestCompilerMojo.java
(original)
+++ incubator/nmaven/trunk/plugins/maven-compiler-plugin/src/main/java/org/apache/maven/dotnet/plugin/compiler/TestCompilerMojo.java
Mon Dec 31 13:52:38 2007
@@ -46,7 +46,7 @@
  *
  * @goal test-compile
  * @phase test-compile
- * @requiresDependencyResolution
+ * @requiresDependencyResolution test
  * @description Maven Mojo for compiling class files to the .NET Intermediate Language
  */
 public class TestCompilerMojo



Mime
View raw message