incubator-nmaven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sisb...@apache.org
Subject svn commit: r611953 - in /incubator/nmaven/trunk: components/maven-dotnet-core/src/main/java/org/apache/maven/dotnet/ core-integration-tests/src/test/java/org/apache/maven/dotnet/integrationtests/ plugins/maven-compiler-plugin/src/main/java/org/apache/...
Date Mon, 14 Jan 2008 22:16:09 GMT
Author: sisbell
Date: Mon Jan 14 14:16:08 2008
New Revision: 611953

URL: http://svn.apache.org/viewvc?rev=611953&view=rev
Log:
Changed some of the test directory structure. Bug fixes for supporting flat directory structure.

Modified:
    incubator/nmaven/trunk/components/maven-dotnet-core/src/main/java/org/apache/maven/dotnet/BuildDirectories.java
    incubator/nmaven/trunk/core-integration-tests/src/test/java/org/apache/maven/dotnet/integrationtests/IntegrationTestSuite.java
    incubator/nmaven/trunk/core-integration-tests/src/test/java/org/apache/maven/dotnet/integrationtests/MavenITmng0007CSharpCompileTestLibrary.java
    incubator/nmaven/trunk/core-integration-tests/src/test/java/org/apache/maven/dotnet/integrationtests/MavenITmng0018CSharpSynchronizeTargetWithSource.java
    incubator/nmaven/trunk/plugins/maven-compiler-plugin/src/main/java/org/apache/maven/dotnet/plugin/compiler/AbstractSourceProcessorMojo.java
    incubator/nmaven/trunk/plugins/maven-compiler-plugin/src/main/java/org/apache/maven/dotnet/plugin/compiler/SourceProcessorMojo.java
    incubator/nmaven/trunk/plugins/maven-compiler-plugin/src/main/java/org/apache/maven/dotnet/plugin/compiler/TestCompilerMojo.java
    incubator/nmaven/trunk/plugins/maven-compiler-plugin/src/main/java/org/apache/maven/dotnet/plugin/compiler/TestSourceProcessorMojo.java

Modified: incubator/nmaven/trunk/components/maven-dotnet-core/src/main/java/org/apache/maven/dotnet/BuildDirectories.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/maven-dotnet-core/src/main/java/org/apache/maven/dotnet/BuildDirectories.java?rev=611953&r1=611952&r2=611953&view=diff
==============================================================================
--- incubator/nmaven/trunk/components/maven-dotnet-core/src/main/java/org/apache/maven/dotnet/BuildDirectories.java
(original)
+++ incubator/nmaven/trunk/components/maven-dotnet-core/src/main/java/org/apache/maven/dotnet/BuildDirectories.java
Mon Jan 14 14:16:08 2008
@@ -27,9 +27,9 @@
     BUILD_SOURCES_MAIN("build-sources/main-sources"),
     BUILD_SOURCES_GENERATED("build-sources/generated-sources"),
     TEST_ASSEMBLIES("test-assemblies"),
-    TEST_SOURCES("test-sources"),
-    TEST_SOURCES_MAIN("test-sources/main-sources"),
-    TEST_SOURCES_GENERATED("test-sources/generated-sources"),
+    TEST_BUILD_SOURCES("test-build-sources"),
+    TEST_BUILD_SOURCES_MAIN("test-build-sources/test-sources"),
+    TEST_BUILD_SOURCES_GENERATED("test-build-sources/generated-sources"),
     ASSEMBLY_RESOURCES("assembly-resources");
 
     private String buildDirectoryName;

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=611953&r1=611952&r2=611953&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 Jan 14 14:16:08 2008
@@ -27,12 +27,14 @@
         }
 
         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( MavenITmng0006NUnitTestExecution.class );
         suite.addTestSuite( MavenITmng0007CSharpCompileTestLibrary.class );
         suite.addTestSuite( MavenITmng0008CSharpCompileWithProvidedDependency.class );

Modified: incubator/nmaven/trunk/core-integration-tests/src/test/java/org/apache/maven/dotnet/integrationtests/MavenITmng0007CSharpCompileTestLibrary.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/core-integration-tests/src/test/java/org/apache/maven/dotnet/integrationtests/MavenITmng0007CSharpCompileTestLibrary.java?rev=611953&r1=611952&r2=611953&view=diff
==============================================================================
--- incubator/nmaven/trunk/core-integration-tests/src/test/java/org/apache/maven/dotnet/integrationtests/MavenITmng0007CSharpCompileTestLibrary.java
(original)
+++ incubator/nmaven/trunk/core-integration-tests/src/test/java/org/apache/maven/dotnet/integrationtests/MavenITmng0007CSharpCompileTestLibrary.java
Mon Jan 14 14:16:08 2008
@@ -17,7 +17,7 @@
         Verifier verifier = new Verifier( testDir.getAbsolutePath() );
         verifier.executeGoal( "install" );
         verifier.assertFilePresent( "target/" + BuildDirectories.BUILD_SOURCES_MAIN.getBuildDirectoryName()
+ "/App.cs" );
-        verifier.assertFilePresent( "target/" + BuildDirectories.TEST_SOURCES_MAIN.getBuildDirectoryName()
+ "/It0007.cs" );
+        verifier.assertFilePresent( "target/" + BuildDirectories.TEST_BUILD_SOURCES_MAIN.getBuildDirectoryName()
+ "/It0007.cs" );
         verifier.assertFilePresent( "target/NMaven.It.It0007-1.0.0-test.dll" );
         verifier.verifyErrorFreeLog();
         verifier.resetStreams();

Modified: incubator/nmaven/trunk/core-integration-tests/src/test/java/org/apache/maven/dotnet/integrationtests/MavenITmng0018CSharpSynchronizeTargetWithSource.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/core-integration-tests/src/test/java/org/apache/maven/dotnet/integrationtests/MavenITmng0018CSharpSynchronizeTargetWithSource.java?rev=611953&r1=611952&r2=611953&view=diff
==============================================================================
--- incubator/nmaven/trunk/core-integration-tests/src/test/java/org/apache/maven/dotnet/integrationtests/MavenITmng0018CSharpSynchronizeTargetWithSource.java
(original)
+++ incubator/nmaven/trunk/core-integration-tests/src/test/java/org/apache/maven/dotnet/integrationtests/MavenITmng0018CSharpSynchronizeTargetWithSource.java
Mon Jan 14 14:16:08 2008
@@ -12,52 +12,54 @@
 public class MavenITmng0018CSharpSynchronizeTargetWithSource
     extends AbstractMavenIntegrationTestCase
 {
-	
-	private static final String CS_GEN_FILENAME = "It0018Gen.cs";
-	
-	private static final String CS_GEN_SOURCE = 
-		"namespace NMaven.IT {\n" +
-		"public class It0018Gen {\n" +
-		"    public static void Main () {\n" +
-		"    }\n" +
-		"}" +
-		"}";
-	
+
+    private static final String CS_GEN_FILENAME = "It0018Gen.cs";
+
+    private static final String CS_GEN_SOURCE = "namespace NMaven.IT {\n" + "public class
It0018Gen {\n" +
+        "    public static void Main () {\n" + "    }\n" + "}" + "}";
+
     public void testit0018()
         throws Exception
     {
-        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/MavenITmng-0018-CSharpSynchronizeTargetWithSource"
);
-        
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(),
+                                                                 "/MavenITmng-0018-CSharpSynchronizeTargetWithSource"
);
+
         // Generate a new CS source file
         File generatedCSSourceFile = new File( testDir, "src/" + CS_GEN_FILENAME );
         BufferedWriter fileWriter = new BufferedWriter( new FileWriter( generatedCSSourceFile
) );
         fileWriter.write( CS_GEN_SOURCE );
         fileWriter.close();
-        
+
         // Generate a new CS test file
         File generatedCSTargetFile = new File( testDir, "test/" + CS_GEN_FILENAME );
         fileWriter = new BufferedWriter( new FileWriter( generatedCSTargetFile ) );
         fileWriter.write( CS_GEN_SOURCE );
         fileWriter.close();
-        
+
         Verifier verifier = new Verifier( testDir.getAbsolutePath() );
         verifier.executeGoal( "install" );
-        verifier.assertFilePresent( "target/" + BuildDirectories.BUILD_SOURCES_MAIN.getBuildDirectoryName()
+ "/It0018.cs" );
-        verifier.assertFilePresent( "target/" + BuildDirectories.BUILD_SOURCES_MAIN.getBuildDirectoryName()
+ "/It0018Gen.cs" );
-        verifier.assertFilePresent( "target/" + BuildDirectories.TEST_SOURCES_MAIN.getBuildDirectoryName()
+ "/It0018.cs" );
-        verifier.assertFilePresent( "target/" + BuildDirectories.TEST_SOURCES_MAIN.getBuildDirectoryName()
+ "/It0018Gen.cs" );
+        verifier.assertFilePresent(
+            "target/" + BuildDirectories.BUILD_SOURCES_MAIN.getBuildDirectoryName() + "/It0018.cs"
);
+        verifier.assertFilePresent(
+            "target/" + BuildDirectories.BUILD_SOURCES_MAIN.getBuildDirectoryName() + "/It0018Gen.cs"
);
+        verifier.assertFilePresent(
+            "target/" + BuildDirectories.TEST_BUILD_SOURCES_MAIN.getBuildDirectoryName()
+ "/It0018.cs" );
+        verifier.assertFilePresent(
+            "target/" + BuildDirectories.TEST_BUILD_SOURCES_MAIN.getBuildDirectoryName()
+ "/It0018Gen.cs" );
         verifier.verifyErrorFreeLog();
         verifier.resetStreams();
-        
+
         // Delete the generated file
         assertTrue( "Unable to delete generated source file", generatedCSSourceFile.delete()
);
         assertTrue( "Unable to delete generated test file", generatedCSTargetFile.delete()
);
-        
+
         verifier.executeGoal( "install" );
-        
+
         // Verify that the deleted file is purged from the staging compilation directory
-        verifier.assertFileNotPresent( "target/" + BuildDirectories.BUILD_SOURCES_MAIN.getBuildDirectoryName()
+ "/It0018Gen.cs" );
-        verifier.assertFileNotPresent( "target/" + BuildDirectories.TEST_SOURCES_MAIN.getBuildDirectoryName()
+ "/It0018Gen.cs" );
+        verifier.assertFileNotPresent(
+            "target/" + BuildDirectories.BUILD_SOURCES_MAIN.getBuildDirectoryName() + "/It0018Gen.cs"
);
+        verifier.assertFileNotPresent(
+            "target/" + BuildDirectories.TEST_BUILD_SOURCES_GENERATED.getBuildDirectoryName()
+ "/It0018Gen.cs" );
         verifier.verifyErrorFreeLog();
         verifier.resetStreams();
     }

Modified: incubator/nmaven/trunk/plugins/maven-compiler-plugin/src/main/java/org/apache/maven/dotnet/plugin/compiler/AbstractSourceProcessorMojo.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/plugins/maven-compiler-plugin/src/main/java/org/apache/maven/dotnet/plugin/compiler/AbstractSourceProcessorMojo.java?rev=611953&r1=611952&r2=611953&view=diff
==============================================================================
--- incubator/nmaven/trunk/plugins/maven-compiler-plugin/src/main/java/org/apache/maven/dotnet/plugin/compiler/AbstractSourceProcessorMojo.java
(original)
+++ incubator/nmaven/trunk/plugins/maven-compiler-plugin/src/main/java/org/apache/maven/dotnet/plugin/compiler/AbstractSourceProcessorMojo.java
Mon Jan 14 14:16:08 2008
@@ -77,6 +77,10 @@
      */
     protected abstract String getSourceUpToDateKey();
 
+    protected abstract List<String> getExcludesList();
+
+    protected abstract List<String> getIncludesList( String classExtension );
+
     protected void processSources()
         throws MojoExecutionException
     {
@@ -87,6 +91,10 @@
             getLog().info( "NMAVEN-904-001: No source files to copy" );
             return;
         }
+        if(!getOutputDirectory().exists())
+        {
+            getOutputDirectory().mkdirs();
+        }
         DirectoryScanner directoryScanner = new DirectoryScanner();
         directoryScanner.setBasedir( sourceDirectory );
 
@@ -95,12 +103,16 @@
         excludeList.add( "obj/**" );
         excludeList.add( "bin/**" );
         excludeList.add( "target/**" );
+
         //Misc
+        excludeList.add( "*.suo" );
+        excludeList.add( "*.csproj" );
+        excludeList.add( "*.sln" );
         excludeList.add( "Resources/**" );
-        excludeList.add( "Test/**" );
+        excludeList.addAll( getExcludesList());
 
         List<String> includeList = new ArrayList<String>(Arrays.asList(includes));
-        includeList.add( "**/*." + ProgrammingLanguage.valueOf( language ).getClassFileExtension()
);
+        includeList.addAll( getIncludesList(ProgrammingLanguage.valueOf( language ).getClassFileExtension())
);
 
         directoryScanner.setIncludes( includeList.toArray( includes ) );
         directoryScanner.setExcludes( excludeList.toArray( excludes ) );

Modified: incubator/nmaven/trunk/plugins/maven-compiler-plugin/src/main/java/org/apache/maven/dotnet/plugin/compiler/SourceProcessorMojo.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/plugins/maven-compiler-plugin/src/main/java/org/apache/maven/dotnet/plugin/compiler/SourceProcessorMojo.java?rev=611953&r1=611952&r2=611953&view=diff
==============================================================================
--- incubator/nmaven/trunk/plugins/maven-compiler-plugin/src/main/java/org/apache/maven/dotnet/plugin/compiler/SourceProcessorMojo.java
(original)
+++ incubator/nmaven/trunk/plugins/maven-compiler-plugin/src/main/java/org/apache/maven/dotnet/plugin/compiler/SourceProcessorMojo.java
Mon Jan 14 14:16:08 2008
@@ -19,8 +19,11 @@
 package org.apache.maven.dotnet.plugin.compiler;
 
 import java.io.File;
+import java.util.List;
+import java.util.ArrayList;
 
 import org.apache.maven.dotnet.BuildDirectories;
+import org.apache.maven.dotnet.ProgrammingLanguage;
 import org.apache.maven.plugin.MojoExecutionException;
 
 /**
@@ -58,5 +61,19 @@
     protected String getSourceUpToDateKey()
     {
         return "SOURCE_FILES_UP_TO_DATE";
+    }
+
+    protected List<String> getExcludesList()
+    {
+        List<String> excludeList = new ArrayList<String>();
+        excludeList.add( "Test/**" );
+        return excludeList;
+    }
+
+    protected List<String> getIncludesList( String classExtension )
+    {
+        List<String> includeList = new ArrayList<String>();
+        includeList.add( "**/*." + classExtension );
+        return includeList;
     }
 }

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=611953&r1=611952&r2=611953&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 Jan 14 14:16:08 2008
@@ -105,7 +105,7 @@
         }
 
         File sourceDir =
-            new File( project.getBuild().getDirectory(), BuildDirectories.TEST_SOURCES.getBuildDirectoryName()
);
+            new File( project.getBuild().getDirectory(), BuildDirectories.TEST_BUILD_SOURCES.getBuildDirectoryName()
);
 
         // No test source to process
         if ( !sourceDir.exists() )

Modified: incubator/nmaven/trunk/plugins/maven-compiler-plugin/src/main/java/org/apache/maven/dotnet/plugin/compiler/TestSourceProcessorMojo.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/plugins/maven-compiler-plugin/src/main/java/org/apache/maven/dotnet/plugin/compiler/TestSourceProcessorMojo.java?rev=611953&r1=611952&r2=611953&view=diff
==============================================================================
--- incubator/nmaven/trunk/plugins/maven-compiler-plugin/src/main/java/org/apache/maven/dotnet/plugin/compiler/TestSourceProcessorMojo.java
(original)
+++ incubator/nmaven/trunk/plugins/maven-compiler-plugin/src/main/java/org/apache/maven/dotnet/plugin/compiler/TestSourceProcessorMojo.java
Mon Jan 14 14:16:08 2008
@@ -19,6 +19,8 @@
 package org.apache.maven.dotnet.plugin.compiler;
 
 import java.io.File;
+import java.util.List;
+import java.util.ArrayList;
 
 import org.apache.maven.dotnet.BuildDirectories;
 import org.apache.maven.plugin.MojoExecutionException;
@@ -51,7 +53,7 @@
     protected File getOutputDirectory()
     {
         return new File( project.getBuild().getDirectory(), 
-                         BuildDirectories.TEST_SOURCES_MAIN.getBuildDirectoryName() );
+                         BuildDirectories.TEST_BUILD_SOURCES_MAIN.getBuildDirectoryName()
);
     }
 
     @Override
@@ -64,5 +66,17 @@
     protected String getSourceUpToDateKey()
     {
         return "TEST_SOURCE_FILES_UP_TO_DATE";
+    }
+
+    protected List<String> getExcludesList()
+    {
+        return new ArrayList<String>();
+    }
+
+    protected List<String> getIncludesList( String classExtension )
+    {
+        List<String> includeList = new ArrayList<String>();
+        includeList.add( "**/*." + classExtension );
+        return includeList;
     }
 }



Mime
View raw message