Author: eworley Date: Sun Feb 10 22:15:47 2008 New Revision: 620426 URL: http://svn.apache.org/viewvc?rev=620426&view=rev Log: Adding backwards compatibility by supporting "library" packaging type. Also fixed code that assumes .net types have a ":" in the package name. Used dotnet:library as a model for supporting "library" type.
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-core/src/main/java/org/apache/maven/dotnet/ArtifactType.java incubator/nmaven/trunk/plugins/maven-dotnet-compiler-plugin/src/main/java/org/apache/maven/dotnet/plugin/compiler/CompilerMojo.java incubator/nmaven/trunk/plugins/maven-dotnet-compiler-plugin/src/main/resources/META-INF/plexus/components.xml 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=620426&r1=620425&r2=620426&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 Sun Feb 10 22:15:47 2008 @@ -276,7 +276,8 @@ { String type = artifact.getType(); if ( ArtifactType.LIBRARY.isMatchByString( type ) || ArtifactType.EXE.isMatchByString( type ) || - ArtifactType.WINEXE.isMatchByString( type ) || type.startsWith( "dotnet:gac" ) ) + ArtifactType.WINEXE.isMatchByString( type ) || type.startsWith( "dotnet:gac" ) || + ArtifactType.LIBRARY_LEGACY.isMatchByString( type )) { targetArtifacts.add( artifact ); } Modified: incubator/nmaven/trunk/components/maven-dotnet-core/src/main/java/org/apache/maven/dotnet/ArtifactType.java URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/maven-dotnet-core/src/main/java/org/apache/maven/dotnet/ArtifactType.java?rev=620426&r1=620425&r2=620426&view=diff ============================================================================== --- incubator/nmaven/trunk/components/maven-dotnet-core/src/main/java/org/apache/maven/dotnet/ArtifactType.java (original) +++ incubator/nmaven/trunk/components/maven-dotnet-core/src/main/java/org/apache/maven/dotnet/ArtifactType.java Sun Feb 10 22:15:47 2008 @@ -29,6 +29,7 @@ GAC_GENERIC( "dotnet:gac_generic", "library", "dll" ), GAC_MSIL( "dotnet:gac_msil", "library", "dll" ), LIBRARY( "dotnet:library", "library", "dll" ), + LIBRARY_LEGACY( "library", "library", "dll" ), MODULE( "dotnet:module", "module", "netmodule" ), WINEXE( "dotnet:winexe", "winexe", "exe" ), NULL( "null", "null", "null" ); Modified: incubator/nmaven/trunk/plugins/maven-dotnet-compiler-plugin/src/main/java/org/apache/maven/dotnet/plugin/compiler/CompilerMojo.java URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/plugins/maven-dotnet-compiler-plugin/src/main/java/org/apache/maven/dotnet/plugin/compiler/CompilerMojo.java?rev=620426&r1=620425&r2=620426&view=diff ============================================================================== --- incubator/nmaven/trunk/plugins/maven-dotnet-compiler-plugin/src/main/java/org/apache/maven/dotnet/plugin/compiler/CompilerMojo.java (original) +++ incubator/nmaven/trunk/plugins/maven-dotnet-compiler-plugin/src/main/java/org/apache/maven/dotnet/plugin/compiler/CompilerMojo.java Sun Feb 10 22:15:47 2008 @@ -129,8 +129,15 @@ getLog().info( ".NET Vendor: " + vendor ); DotnetCompilerConfig compilerConfig = DotnetCompilerConfig.Factory.createDefaultCompilerConfig(); - compilerConfig.setArtifactType( - ArtifactType.valueOf( project.getPackaging().split( "[:]" )[1].toUpperCase() ) ); + String packaging = project.getPackaging(); + + // If this is a dotnet type, remove the "dotnet:" portion + if ( packaging.contains( ":" ) ) + { + packaging = packaging.split( "[:]" )[1]; + } + + compilerConfig.setArtifactType( ArtifactType.valueOf( packaging.toUpperCase() ) ); compilerConfig.setCompilerPlatformVersion( DotnetCompilerPlatformVersion.valueFromVersion( frameworkVersion ) ); KeyInfo keyInfo = KeyInfo.Factory.createDefaultKeyInfo(); Modified: incubator/nmaven/trunk/plugins/maven-dotnet-compiler-plugin/src/main/resources/META-INF/plexus/components.xml URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/plugins/maven-dotnet-compiler-plugin/src/main/resources/META-INF/plexus/components.xml?rev=620426&r1=620425&r2=620426&view=diff ============================================================================== --- incubator/nmaven/trunk/plugins/maven-dotnet-compiler-plugin/src/main/resources/META-INF/plexus/components.xml (original) +++ incubator/nmaven/trunk/plugins/maven-dotnet-compiler-plugin/src/main/resources/META-INF/plexus/components.xml Sun Feb 10 22:15:47 2008 @@ -1,6 +1,6 @@ <component-set> <components> - <!--liifecycle mappings--> + <!--lifecycle mappings--> <component> <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role> <role-hint>dotnet:library</role-hint> @@ -36,6 +36,42 @@ </phases> </configuration> </component> + <!-- Support old artifact type --> + <component> + <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role> + <role-hint>library</role-hint> + <implementation> + org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping + </implementation> + <configuration> + <phases> + <generate-sources> + org.apache.maven.dotnet.plugins:maven-dotnet-compiler-plugin:generate-assembly-info + </generate-sources> + <process-sources> + org.apache.maven.dotnet.plugins:maven-dotnet-compiler-plugin:process-sources + </process-sources> + <process-test-sources> + org.apache.maven.dotnet.plugins:maven-dotnet-compiler-plugin:process-test-sources + </process-test-sources> + <compile> + org.apache.maven.dotnet.plugins:maven-dotnet-compiler-plugin:compile + </compile> + <test-compile> + org.apache.maven.dotnet.plugins:maven-dotnet-compiler-plugin:test-compile + </test-compile> + <test> + org.apache.maven.dotnet.plugins:maven-dotnet-test-plugin:test + </test> + <install> + org.apache.maven.plugins:maven-install-plugin:install + </install> + <deploy> + org.apache.maven.plugins:maven-deploy-plugin:deploy + </deploy> + </phases> + </configuration> + </component> <component> <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role> <role-hint>dotnet:exe</role-hint> @@ -147,6 +183,17 @@ <configuration> <extension>dll</extension> <type>dotnet:library</type> + <addedToClasspath>true</addedToClasspath> + </configuration> + </component> + <!-- Support old artifact type --> + <component> + <role>org.apache.maven.artifact.handler.ArtifactHandler</role> + <role-hint>library</role-hint> + <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation> + <configuration> + <extension>dll</extension> + <type>library</type> <addedToClasspath>true</addedToClasspath> </configuration> </component>