From nmaven-commits-return-176-apmail-incubator-nmaven-commits-archive=incubator.apache.org@incubator.apache.org Wed Mar 14 06:12:49 2007 Return-Path: Delivered-To: apmail-incubator-nmaven-commits-archive@locus.apache.org Received: (qmail 80779 invoked from network); 14 Mar 2007 06:12:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Mar 2007 06:12:48 -0000 Received: (qmail 7745 invoked by uid 500); 14 Mar 2007 06:12:56 -0000 Delivered-To: apmail-incubator-nmaven-commits-archive@incubator.apache.org Received: (qmail 7720 invoked by uid 500); 14 Mar 2007 06:12:56 -0000 Mailing-List: contact nmaven-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: nmaven-dev@incubator.apache.org Delivered-To: mailing list nmaven-commits@incubator.apache.org Received: (qmail 7710 invoked by uid 99); 14 Mar 2007 06:12:55 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Mar 2007 23:12:55 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Mar 2007 23:12:46 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id AB0841A9838; Tue, 13 Mar 2007 23:12:26 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r518032 - in /incubator/nmaven/branches/SI_IDE/plugins/maven-compile-plugin: ./ src/main/java/org/apache/maven/dotnet/plugin/compile/ Date: Wed, 14 Mar 2007 06:12:26 -0000 To: nmaven-commits@incubator.apache.org From: sisbell@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070314061226.AB0841A9838@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: sisbell Date: Tue Mar 13 23:12:25 2007 New Revision: 518032 URL: http://svn.apache.org/viewvc?view=rev&rev=518032 Log: compile plugin now supports a flat directory structure (For IDE support). Modified: incubator/nmaven/branches/SI_IDE/plugins/maven-compile-plugin/pom.xml incubator/nmaven/branches/SI_IDE/plugins/maven-compile-plugin/src/main/java/org/apache/maven/dotnet/plugin/compile/AssemblyInfoGeneratorMojo.java incubator/nmaven/branches/SI_IDE/plugins/maven-compile-plugin/src/main/java/org/apache/maven/dotnet/plugin/compile/CompilerMojo.java incubator/nmaven/branches/SI_IDE/plugins/maven-compile-plugin/src/main/java/org/apache/maven/dotnet/plugin/compile/ComponentInitializerMojo.java incubator/nmaven/branches/SI_IDE/plugins/maven-compile-plugin/src/main/java/org/apache/maven/dotnet/plugin/compile/SourceProcessorMojo.java Modified: incubator/nmaven/branches/SI_IDE/plugins/maven-compile-plugin/pom.xml URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/plugins/maven-compile-plugin/pom.xml?view=diff&rev=518032&r1=518031&r2=518032 ============================================================================== --- incubator/nmaven/branches/SI_IDE/plugins/maven-compile-plugin/pom.xml (original) +++ incubator/nmaven/branches/SI_IDE/plugins/maven-compile-plugin/pom.xml Tue Mar 13 23:12:25 2007 @@ -22,6 +22,19 @@ 2.0.4 + + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.5 + 1.5 + + + + + Modified: incubator/nmaven/branches/SI_IDE/plugins/maven-compile-plugin/src/main/java/org/apache/maven/dotnet/plugin/compile/AssemblyInfoGeneratorMojo.java URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/plugins/maven-compile-plugin/src/main/java/org/apache/maven/dotnet/plugin/compile/AssemblyInfoGeneratorMojo.java?view=diff&rev=518032&r1=518031&r2=518032 ============================================================================== --- incubator/nmaven/branches/SI_IDE/plugins/maven-compile-plugin/src/main/java/org/apache/maven/dotnet/plugin/compile/AssemblyInfoGeneratorMojo.java (original) +++ incubator/nmaven/branches/SI_IDE/plugins/maven-compile-plugin/src/main/java/org/apache/maven/dotnet/plugin/compile/AssemblyInfoGeneratorMojo.java Tue Mar 13 23:12:25 2007 @@ -119,6 +119,7 @@ public void execute() throws MojoExecutionException { + if ( project.getArtifact().getType().equals( "module" ) ) { return; @@ -144,14 +145,7 @@ } getLog().info( "NMAVEN-902-000: Generating Assembly Info: Language = " + language.trim() ); - try - { - assemblerContext.init( project ); - } - catch ( InitializationException e ) - { - throw new MojoExecutionException( "NMAVEN-902-006: Failed to initialize the assembler context" ); - } + //TODO: Investigate the affect of not setting isDefault and profile. In the case of executables, this is //managed by the framework. I intended to keep vendor info and state machine processor out of the Modified: incubator/nmaven/branches/SI_IDE/plugins/maven-compile-plugin/src/main/java/org/apache/maven/dotnet/plugin/compile/CompilerMojo.java URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/plugins/maven-compile-plugin/src/main/java/org/apache/maven/dotnet/plugin/compile/CompilerMojo.java?view=diff&rev=518032&r1=518031&r2=518032 ============================================================================== --- incubator/nmaven/branches/SI_IDE/plugins/maven-compile-plugin/src/main/java/org/apache/maven/dotnet/plugin/compile/CompilerMojo.java (original) +++ incubator/nmaven/branches/SI_IDE/plugins/maven-compile-plugin/src/main/java/org/apache/maven/dotnet/plugin/compile/CompilerMojo.java Tue Mar 13 23:12:25 2007 @@ -27,6 +27,8 @@ import org.apache.maven.dotnet.executable.ExecutionException; import org.apache.maven.dotnet.vendor.VendorFactory; import org.apache.maven.dotnet.executable.compiler.*; +import org.apache.maven.model.Dependency; +import org.apache.maven.artifact.Artifact; import java.util.ArrayList; import java.io.File; Modified: incubator/nmaven/branches/SI_IDE/plugins/maven-compile-plugin/src/main/java/org/apache/maven/dotnet/plugin/compile/ComponentInitializerMojo.java URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/plugins/maven-compile-plugin/src/main/java/org/apache/maven/dotnet/plugin/compile/ComponentInitializerMojo.java?view=diff&rev=518032&r1=518031&r2=518032 ============================================================================== --- incubator/nmaven/branches/SI_IDE/plugins/maven-compile-plugin/src/main/java/org/apache/maven/dotnet/plugin/compile/ComponentInitializerMojo.java (original) +++ incubator/nmaven/branches/SI_IDE/plugins/maven-compile-plugin/src/main/java/org/apache/maven/dotnet/plugin/compile/ComponentInitializerMojo.java Tue Mar 13 23:12:25 2007 @@ -25,6 +25,7 @@ import org.apache.maven.artifact.resolver.ArtifactNotFoundException; import org.apache.maven.dotnet.InitializationException; +import org.apache.maven.dotnet.assembler.AssemblerContext; import org.apache.maven.dotnet.artifact.AssemblyResolver; import java.io.File; @@ -77,6 +78,11 @@ */ private org.apache.maven.dotnet.NMavenRepositoryRegistry nmavenRegistry; + /** + * @component + */ + private AssemblerContext assemblerContext; + public void execute() throws MojoExecutionException { @@ -92,6 +98,15 @@ catch ( ArtifactNotFoundException e ) { throw new MojoExecutionException( "NMAVEN-901-001: Unable to resolve assemblies", e ); + } + + try + { + assemblerContext.init( project ); + } + catch ( InitializationException e ) + { + throw new MojoExecutionException( "NMAVEN-901-002: Failed to initialize the assembler context" ); } } } Modified: incubator/nmaven/branches/SI_IDE/plugins/maven-compile-plugin/src/main/java/org/apache/maven/dotnet/plugin/compile/SourceProcessorMojo.java URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/plugins/maven-compile-plugin/src/main/java/org/apache/maven/dotnet/plugin/compile/SourceProcessorMojo.java?view=diff&rev=518032&r1=518031&r2=518032 ============================================================================== --- incubator/nmaven/branches/SI_IDE/plugins/maven-compile-plugin/src/main/java/org/apache/maven/dotnet/plugin/compile/SourceProcessorMojo.java (original) +++ incubator/nmaven/branches/SI_IDE/plugins/maven-compile-plugin/src/main/java/org/apache/maven/dotnet/plugin/compile/SourceProcessorMojo.java Tue Mar 13 23:12:25 2007 @@ -20,6 +20,8 @@ import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.dotnet.assembler.AssemblerContext; +import org.apache.maven.dotnet.PlatformUnsupportedException; import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.DirectoryScanner; @@ -67,6 +69,19 @@ */ private String[] excludes; + /** + * .NET Language. The default value is C_SHARP. Not case or white-space sensitive. + * + * @parameter expression="${language}" default-value = "C_SHARP" + * @required + */ + private String language; + + /** + * @component + */ + private AssemblerContext assemblerContext; + public void execute() throws MojoExecutionException { @@ -79,17 +94,28 @@ directoryScanner.setBasedir( sourceDirectory ); List excludeList = new ArrayList(); - excludeList.add( "*.suo" ); - excludeList.add( "*.csproj" ); - excludeList.add( "*.sln" ); + //target files excludeList.add( "obj/**" ); + excludeList.add( "bin/**" ); + excludeList.add( "target/**" ); + //Misc + excludeList.add( "Resources/**" ); + excludeList.add( "Test/**" ); - if ( includes != null && includes.length > 0 ) + List includeList = new ArrayList(); + try + { + includeList.add( "*" + assemblerContext.getClassExtensionFor( language)); + } + catch ( PlatformUnsupportedException e ) { - directoryScanner.setIncludes( includes ); + throw new MojoExecutionException("NMAVEN-904-003: Language is not supported: Language = " + language, e); } + + directoryScanner.setIncludes( includeList.toArray( includes ) ); directoryScanner.setExcludes( excludeList.toArray( excludes ) ); directoryScanner.addDefaultExcludes(); + directoryScanner.scan(); String[] files = directoryScanner.getIncludedFiles(); getLog().info(