From nmaven-commits-return-850-apmail-incubator-nmaven-commits-archive=incubator.apache.org@incubator.apache.org Mon Sep 15 06:04:15 2008 Return-Path: Delivered-To: apmail-incubator-nmaven-commits-archive@locus.apache.org Received: (qmail 65962 invoked from network); 15 Sep 2008 06:04:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Sep 2008 06:04:15 -0000 Received: (qmail 35612 invoked by uid 500); 15 Sep 2008 06:04:12 -0000 Delivered-To: apmail-incubator-nmaven-commits-archive@incubator.apache.org Received: (qmail 35578 invoked by uid 500); 15 Sep 2008 06:04:11 -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 35569 invoked by uid 99); 15 Sep 2008 06:04:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 14 Sep 2008 23:04:11 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Sep 2008 06:03:09 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id EB9202388A22; Sun, 14 Sep 2008 23:03:41 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r695350 [2/2] - in /incubator/nmaven/trunk: ./ archetypes/maven-archetype-class-library/src/main/resources/archetype-resources/ archetypes/maven-archetype-console-application/src/main/resources/archetype-resources/ archetypes/maven-archetyp... Date: Mon, 15 Sep 2008 06:03:27 -0000 To: nmaven-commits@incubator.apache.org From: brett@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080915060341.EB9202388A22@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: incubator/nmaven/trunk/plugins/maven-dotnet-compiler-plugin/src/main/java/org/apache/maven/dotnet/plugin/compiler/AbstractSourceProcessorMojo.java URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/plugins/maven-dotnet-compiler-plugin/src/main/java/org/apache/maven/dotnet/plugin/compiler/AbstractSourceProcessorMojo.java?rev=695350&r1=695349&r2=695350&view=diff ============================================================================== --- incubator/nmaven/trunk/plugins/maven-dotnet-compiler-plugin/src/main/java/org/apache/maven/dotnet/plugin/compiler/AbstractSourceProcessorMojo.java (original) +++ incubator/nmaven/trunk/plugins/maven-dotnet-compiler-plugin/src/main/java/org/apache/maven/dotnet/plugin/compiler/AbstractSourceProcessorMojo.java Sun Sep 14 23:03:08 2008 @@ -1,166 +1,166 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.dotnet.plugin.compiler; - -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import org.apache.maven.dotnet.ProgrammingLanguage; -import org.apache.maven.plugin.AbstractMojo; -import org.apache.maven.plugin.MojoExecutionException; -import org.apache.maven.project.MavenProject; -import org.codehaus.plexus.util.DirectoryScanner; -import org.codehaus.plexus.util.FileUtils; - -public abstract class AbstractSourceProcessorMojo - extends AbstractMojo -{ - /** - * The maven project. - * - * @parameter expression="${project}" - * @required - */ - protected MavenProject project; - - /** - * @parameter expression = "${includes}" - */ - private String[] includes; - - /** - * @parameter expression = "${excludes}" - */ - 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; - - /** - * @return File The source directory to process - */ - protected abstract File getSourceDirectory(); - - /** - * @return File The output directory where the processed source - * will be placed - */ - protected abstract File getOutputDirectory(); - - /** - * @return String The key used to set the source up to date flag - * on the plugin context - */ - protected abstract String getSourceUpToDateKey(); - - protected abstract List getExcludesList(); - - protected abstract List getIncludesList( String classExtension ); - - protected void processSources() - throws MojoExecutionException - { - File sourceDirectory = getSourceDirectory(); - - if ( !sourceDirectory.exists() ) - { - getLog().info( "NMAVEN-904-001: No source files to copy" ); - return; - } - if(!getOutputDirectory().exists()) - { - getOutputDirectory().mkdirs(); - } - DirectoryScanner directoryScanner = new DirectoryScanner(); - directoryScanner.setBasedir( sourceDirectory ); - - List excludeList = new ArrayList(Arrays.asList(excludes)); - //target files - excludeList.add( "obj/**" ); - excludeList.add( "bin/**" ); - excludeList.add( "target/**" ); - - //Misc - excludeList.add( "*.suo" ); - excludeList.add( "*.csproj" ); - excludeList.add( "*.sln" ); - excludeList.add( "Resources/**" ); - excludeList.addAll( getExcludesList()); - - List includeList = new ArrayList(Arrays.asList(includes)); - includeList.addAll( getIncludesList(ProgrammingLanguage.valueOf( language ).getClassFileExtension()) ); - - directoryScanner.setIncludes( includeList.toArray( includes ) ); - directoryScanner.setExcludes( excludeList.toArray( excludes ) ); - directoryScanner.addDefaultExcludes(); - - File outputDirectory = getOutputDirectory(); - directoryScanner.scan(); - String[] files = directoryScanner.getIncludedFiles(); - getLog().info( "NMAVEN-904-002: Copying source files: From = " + sourceDirectory + ", To = " + - outputDirectory + ", File Count = " + files.length ); - - super.getPluginContext().put( getSourceUpToDateKey(), Boolean.TRUE ); - for ( String file : files ) - { - try - { - File sourceFile = new File( sourceDirectory, file ); - File targetFile = new File( outputDirectory, file ); - if ( sourceFile.lastModified() > targetFile.lastModified() ) - { - super.getPluginContext().put( getSourceUpToDateKey(), Boolean.FALSE ); - FileUtils.copyFile( sourceFile, targetFile ); - targetFile.setLastModified( System.currentTimeMillis() ); - } - } - catch ( IOException e ) - { - throw new MojoExecutionException( "NMAVEN-904-000: Unable to process sources", e ); - } - } - - directoryScanner.setBasedir( outputDirectory ); - directoryScanner.scan(); - - // Synchronize the target folder with the source. Specifically delete the targetFile if - // the source file no longer exists - for ( String file : directoryScanner.getIncludedFiles() ) - { - File sourceFile = new File( sourceDirectory, file ); - File targetFile = new File( outputDirectory, file ); - - if ( !sourceFile.exists() && targetFile.exists() ) - { - if ( !targetFile.delete() ) - { - getLog().warn( "Unable to delete stale target file " + targetFile.getPath() ); - } - } - } - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.maven.dotnet.plugin.compiler; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import org.apache.maven.dotnet.ProgrammingLanguage; +import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.project.MavenProject; +import org.codehaus.plexus.util.DirectoryScanner; +import org.codehaus.plexus.util.FileUtils; + +public abstract class AbstractSourceProcessorMojo + extends AbstractMojo +{ + /** + * The maven project. + * + * @parameter expression="${project}" + * @required + */ + protected MavenProject project; + + /** + * @parameter expression = "${includes}" + */ + private String[] includes; + + /** + * @parameter expression = "${excludes}" + */ + 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; + + /** + * @return File The source directory to process + */ + protected abstract File getSourceDirectory(); + + /** + * @return File The output directory where the processed source + * will be placed + */ + protected abstract File getOutputDirectory(); + + /** + * @return String The key used to set the source up to date flag + * on the plugin context + */ + protected abstract String getSourceUpToDateKey(); + + protected abstract List getExcludesList(); + + protected abstract List getIncludesList( String classExtension ); + + protected void processSources() + throws MojoExecutionException + { + File sourceDirectory = getSourceDirectory(); + + if ( !sourceDirectory.exists() ) + { + getLog().info( "NMAVEN-904-001: No source files to copy" ); + return; + } + if(!getOutputDirectory().exists()) + { + getOutputDirectory().mkdirs(); + } + DirectoryScanner directoryScanner = new DirectoryScanner(); + directoryScanner.setBasedir( sourceDirectory ); + + List excludeList = new ArrayList(Arrays.asList(excludes)); + //target files + excludeList.add( "obj/**" ); + excludeList.add( "bin/**" ); + excludeList.add( "target/**" ); + + //Misc + excludeList.add( "*.suo" ); + excludeList.add( "*.csproj" ); + excludeList.add( "*.sln" ); + excludeList.add( "Resources/**" ); + excludeList.addAll( getExcludesList()); + + List includeList = new ArrayList(Arrays.asList(includes)); + includeList.addAll( getIncludesList(ProgrammingLanguage.valueOf( language ).getClassFileExtension()) ); + + directoryScanner.setIncludes( includeList.toArray( includes ) ); + directoryScanner.setExcludes( excludeList.toArray( excludes ) ); + directoryScanner.addDefaultExcludes(); + + File outputDirectory = getOutputDirectory(); + directoryScanner.scan(); + String[] files = directoryScanner.getIncludedFiles(); + getLog().info( "NMAVEN-904-002: Copying source files: From = " + sourceDirectory + ", To = " + + outputDirectory + ", File Count = " + files.length ); + + super.getPluginContext().put( getSourceUpToDateKey(), Boolean.TRUE ); + for ( String file : files ) + { + try + { + File sourceFile = new File( sourceDirectory, file ); + File targetFile = new File( outputDirectory, file ); + if ( sourceFile.lastModified() > targetFile.lastModified() ) + { + super.getPluginContext().put( getSourceUpToDateKey(), Boolean.FALSE ); + FileUtils.copyFile( sourceFile, targetFile ); + targetFile.setLastModified( System.currentTimeMillis() ); + } + } + catch ( IOException e ) + { + throw new MojoExecutionException( "NMAVEN-904-000: Unable to process sources", e ); + } + } + + directoryScanner.setBasedir( outputDirectory ); + directoryScanner.scan(); + + // Synchronize the target folder with the source. Specifically delete the targetFile if + // the source file no longer exists + for ( String file : directoryScanner.getIncludedFiles() ) + { + File sourceFile = new File( sourceDirectory, file ); + File targetFile = new File( outputDirectory, file ); + + if ( !sourceFile.exists() && targetFile.exists() ) + { + if ( !targetFile.delete() ) + { + getLog().warn( "Unable to delete stale target file " + targetFile.getPath() ); + } + } + } + } +} Propchange: incubator/nmaven/trunk/plugins/maven-dotnet-compiler-plugin/src/main/java/org/apache/maven/dotnet/plugin/compiler/AbstractSourceProcessorMojo.java ------------------------------------------------------------------------------ svn:eol-style = native Modified: incubator/nmaven/trunk/plugins/maven-dotnet-compiler-plugin/src/main/java/org/apache/maven/dotnet/plugin/compiler/TestSourceProcessorMojo.java URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/plugins/maven-dotnet-compiler-plugin/src/main/java/org/apache/maven/dotnet/plugin/compiler/TestSourceProcessorMojo.java?rev=695350&r1=695349&r2=695350&view=diff ============================================================================== --- incubator/nmaven/trunk/plugins/maven-dotnet-compiler-plugin/src/main/java/org/apache/maven/dotnet/plugin/compiler/TestSourceProcessorMojo.java (original) +++ incubator/nmaven/trunk/plugins/maven-dotnet-compiler-plugin/src/main/java/org/apache/maven/dotnet/plugin/compiler/TestSourceProcessorMojo.java Sun Sep 14 23:03:08 2008 @@ -1,82 +1,82 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -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; - -/** - * Copies test source files to target directory. - * - * @goal process-test-sources - * @phase process-test-sources - * @description Copies source files to target directory. - */ -public class TestSourceProcessorMojo - extends AbstractSourceProcessorMojo -{ - - public void execute() - throws MojoExecutionException - { - String skipTest = System.getProperty( "maven.test.skip" ); - if ( "TRUE".equalsIgnoreCase( skipTest ) ) - { - getLog().info( "Skipping Test source processing " ); - return; - } - - processSources(); - } - - @Override - protected File getOutputDirectory() - { - return new File( project.getBuild().getDirectory(), - BuildDirectories.TEST_BUILD_SOURCES_MAIN.getBuildDirectoryName() ); - } - - @Override - protected File getSourceDirectory() - { - return new File( project.getBuild().getTestSourceDirectory() ); - } - - @Override - protected String getSourceUpToDateKey() - { - return "TEST_SOURCE_FILES_UP_TO_DATE"; - } - - protected List getExcludesList() - { - return new ArrayList(); - } - - protected List getIncludesList( String classExtension ) - { - List includeList = new ArrayList(); - includeList.add( "**/*." + classExtension ); - return includeList; - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +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; + +/** + * Copies test source files to target directory. + * + * @goal process-test-sources + * @phase process-test-sources + * @description Copies source files to target directory. + */ +public class TestSourceProcessorMojo + extends AbstractSourceProcessorMojo +{ + + public void execute() + throws MojoExecutionException + { + String skipTest = System.getProperty( "maven.test.skip" ); + if ( "TRUE".equalsIgnoreCase( skipTest ) ) + { + getLog().info( "Skipping Test source processing " ); + return; + } + + processSources(); + } + + @Override + protected File getOutputDirectory() + { + return new File( project.getBuild().getDirectory(), + BuildDirectories.TEST_BUILD_SOURCES_MAIN.getBuildDirectoryName() ); + } + + @Override + protected File getSourceDirectory() + { + return new File( project.getBuild().getTestSourceDirectory() ); + } + + @Override + protected String getSourceUpToDateKey() + { + return "TEST_SOURCE_FILES_UP_TO_DATE"; + } + + protected List getExcludesList() + { + return new ArrayList(); + } + + protected List getIncludesList( String classExtension ) + { + List includeList = new ArrayList(); + includeList.add( "**/*." + classExtension ); + return includeList; + } +} Propchange: incubator/nmaven/trunk/plugins/maven-dotnet-compiler-plugin/src/main/java/org/apache/maven/dotnet/plugin/compiler/TestSourceProcessorMojo.java ------------------------------------------------------------------------------ svn:eol-style = native Modified: incubator/nmaven/trunk/plugins/maven-dotnet-test-plugin/pom.xml URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/plugins/maven-dotnet-test-plugin/pom.xml?rev=695350&r1=695349&r2=695350&view=diff ============================================================================== --- incubator/nmaven/trunk/plugins/maven-dotnet-test-plugin/pom.xml (original) +++ incubator/nmaven/trunk/plugins/maven-dotnet-test-plugin/pom.xml Sun Sep 14 23:03:08 2008 @@ -1,65 +1,65 @@ - - - - - - org.apache.maven.dotnet.plugins - 0.16-incubating-SNAPSHOT - maven-dotnet-plugins - - 4.0.0 - org.apache.maven.dotnet.plugins - maven-dotnet-test-plugin - maven-plugin - Apache NMaven: maven-dotnet-test-plugin - Maven Plugin for .NET: Handles nunit test execution and reporting - - - org.apache.maven.dotnet - maven-dotnet-core - 0.16-incubating-SNAPSHOT - - - org.apache.maven.dotnet - maven-dotnet-toolchain - 0.16-incubating-SNAPSHOT - provided - - - org.apache.maven - maven-project - - - org.apache.maven - maven-plugin-api - - - org.codehaus.plexus - plexus-utils - - - - - nmaven-apache-site - NMaven Site - file://${basedir}/../../../www/plugins/maven-dotnet-test-plugin - - - + + + + + + org.apache.maven.dotnet.plugins + 0.16-incubating-SNAPSHOT + maven-dotnet-plugins + + 4.0.0 + org.apache.maven.dotnet.plugins + maven-dotnet-test-plugin + maven-plugin + Apache NMaven: maven-dotnet-test-plugin + Maven Plugin for .NET: Handles nunit test execution and reporting + + + org.apache.maven.dotnet + maven-dotnet-core + 0.16-incubating-SNAPSHOT + + + org.apache.maven.dotnet + maven-dotnet-toolchain + 0.16-incubating-SNAPSHOT + provided + + + org.apache.maven + maven-project + + + org.apache.maven + maven-plugin-api + + + org.codehaus.plexus + plexus-utils + + + + + nmaven-apache-site + NMaven Site + file://${basedir}/../../../www/plugins/maven-dotnet-test-plugin + + + Propchange: incubator/nmaven/trunk/plugins/maven-dotnet-test-plugin/pom.xml ------------------------------------------------------------------------------ svn:eol-style = native Modified: incubator/nmaven/trunk/plugins/maven-dotnet-test-plugin/src/main/java/org/apache/maven/dotnet/plugin/nunit/DotnetTestMojo.java URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/plugins/maven-dotnet-test-plugin/src/main/java/org/apache/maven/dotnet/plugin/nunit/DotnetTestMojo.java?rev=695350&r1=695349&r2=695350&view=diff ============================================================================== --- incubator/nmaven/trunk/plugins/maven-dotnet-test-plugin/src/main/java/org/apache/maven/dotnet/plugin/nunit/DotnetTestMojo.java (original) +++ incubator/nmaven/trunk/plugins/maven-dotnet-test-plugin/src/main/java/org/apache/maven/dotnet/plugin/nunit/DotnetTestMojo.java Sun Sep 14 23:03:08 2008 @@ -1,209 +1,209 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.maven.dotnet.plugin.nunit; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; - -import org.apache.maven.plugin.AbstractMojo; -import org.apache.maven.plugin.MojoExecutionException; -import org.apache.maven.plugin.MojoFailureException; -import org.apache.maven.plugin.logging.Log; -import org.apache.maven.project.MavenProject; - -import org.apache.maven.dotnet.BuildDirectories; -import org.apache.maven.dotnet.Vendor; - -import org.codehaus.plexus.util.cli.CommandLineException; -import org.codehaus.plexus.util.cli.CommandLineUtils; -import org.codehaus.plexus.util.cli.Commandline; -import org.codehaus.plexus.util.cli.StreamConsumer; - -/** - * Maven Mojo for executing nunit tests - * - * @goal test - * @phase test - * @description Maven Mojo for executing nunit tests - */ -public class DotnetTestMojo - extends AbstractMojo -{ - // Used to determine if nunit-console is not on the path - // TODO: This probably only works on Windows machines - private static final String COMMAND_NOT_FOUND_FRAGMENT = "is not recognized as an internal or external command"; - - /** - * The maven project. - * - * @parameter expression="${project}" - * @required - */ - private MavenProject project; - - /** - * The arguments to pass to nunit - * - * @parameter - */ - private List arguments; - - /** - * The Vendor. - * - * @parameter expression="${vendor}" - */ - private String vendorName; - - public void execute() - throws MojoExecutionException, MojoFailureException - { - String skipTest = System.getProperty( "maven.test.skip" ); - if ( "TRUE".equalsIgnoreCase( skipTest ) ) - { - getLog().info( "Skipping Test Execution" ); - return; - } - - // Verify that we have tests to run - File testAssembly = new File( project.getBuild().getDirectory(), getTestAssemblyName() ); - if ( !testAssembly.exists() ) - { - return; - } - - Vendor vendor; - if ( vendorName != null ) - { - vendor = Vendor.valueOf( vendorName.toUpperCase() ); - } - else - { - vendor = Vendor.getDefaultVendorForOS(); - } - - // The directory where the test artifact exists - File testAssemblies = - new File( project.getBuild().getDirectory(), BuildDirectories.TEST_ASSEMBLIES.getBuildDirectoryName() ); - - Commandline commandline = new Commandline(); - - getLog().debug( "NMaven-test: workingDirectory(" + testAssemblies.getAbsolutePath() + ")" ); - - commandline.setWorkingDirectory( testAssemblies.getAbsolutePath() ); - if ( vendor.equals( Vendor.MICROSOFT ) ) - { - commandline.setExecutable( "nunit-console" ); - } - else if ( vendor.equals( Vendor.NOVELL ) ) - { - commandline.setExecutable( "nunit-console2" ); - } - else - { - throw new MojoExecutionException("Vendor not found."); - } - commandline.addArguments( getNUnitArguments() ); - - NUnitStreamConsumer systemOut = new NUnitStreamConsumer( getLog() ); - NUnitStreamConsumer systemErr = new NUnitStreamConsumer( getLog() ); - - int commandLineResult; - - try - { - // Execute the commandline - commandLineResult = CommandLineUtils.executeCommandLine( commandline, systemOut, systemErr ); - - getLog().debug( "Executed command: " + commandline + ", Result = " + commandLineResult ); - - // Check if nunit-console is not in the path - if ( systemErr.isCommandNotFound() ) - { - throw new MojoExecutionException( "Please add nunit-console to your path" ); - } - else if ( commandLineResult != 0 ) - { - throw new MojoFailureException( "There were NUnit test failure(s)" ); - } - } - catch ( CommandLineException e ) - { - throw new MojoExecutionException( "Failure executing commandline, " + e.getMessage() ); - } - - getLog().info( "Done executing tests.." ); - } - - private String getTestAssemblyName() - { - File file = project.getArtifact().getFile(); - String pieces = file.getName().substring( 0, file.getName().lastIndexOf( '.' ) ); - String testAssemblyName = pieces + "-test.dll"; - - return testAssemblyName; - } - - private String[] getNUnitArguments() - { - List nunitArgs = new ArrayList(); - - nunitArgs.add( getTestAssemblyName() ); - if ( arguments != null ) - { - nunitArgs.addAll( arguments ); - } - - return nunitArgs.toArray( new String[0] ); - } - - private static class NUnitStreamConsumer - implements StreamConsumer - { - - private boolean commandNotFound; - - private StringBuilder consumedLines = new StringBuilder(); - - private Log log; - - private NUnitStreamConsumer( Log log ) - { - this.log = log; - } - - public void consumeLine( String line ) - { - consumedLines.append( line + "\n" ); - - log.info( line ); - - if ( line.contains( COMMAND_NOT_FOUND_FRAGMENT ) ) - { - commandNotFound = true; - } - } - - public boolean isCommandNotFound() - { - return commandNotFound; - } - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.maven.dotnet.plugin.nunit; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; + +import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugin.logging.Log; +import org.apache.maven.project.MavenProject; + +import org.apache.maven.dotnet.BuildDirectories; +import org.apache.maven.dotnet.Vendor; + +import org.codehaus.plexus.util.cli.CommandLineException; +import org.codehaus.plexus.util.cli.CommandLineUtils; +import org.codehaus.plexus.util.cli.Commandline; +import org.codehaus.plexus.util.cli.StreamConsumer; + +/** + * Maven Mojo for executing nunit tests + * + * @goal test + * @phase test + * @description Maven Mojo for executing nunit tests + */ +public class DotnetTestMojo + extends AbstractMojo +{ + // Used to determine if nunit-console is not on the path + // TODO: This probably only works on Windows machines + private static final String COMMAND_NOT_FOUND_FRAGMENT = "is not recognized as an internal or external command"; + + /** + * The maven project. + * + * @parameter expression="${project}" + * @required + */ + private MavenProject project; + + /** + * The arguments to pass to nunit + * + * @parameter + */ + private List arguments; + + /** + * The Vendor. + * + * @parameter expression="${vendor}" + */ + private String vendorName; + + public void execute() + throws MojoExecutionException, MojoFailureException + { + String skipTest = System.getProperty( "maven.test.skip" ); + if ( "TRUE".equalsIgnoreCase( skipTest ) ) + { + getLog().info( "Skipping Test Execution" ); + return; + } + + // Verify that we have tests to run + File testAssembly = new File( project.getBuild().getDirectory(), getTestAssemblyName() ); + if ( !testAssembly.exists() ) + { + return; + } + + Vendor vendor; + if ( vendorName != null ) + { + vendor = Vendor.valueOf( vendorName.toUpperCase() ); + } + else + { + vendor = Vendor.getDefaultVendorForOS(); + } + + // The directory where the test artifact exists + File testAssemblies = + new File( project.getBuild().getDirectory(), BuildDirectories.TEST_ASSEMBLIES.getBuildDirectoryName() ); + + Commandline commandline = new Commandline(); + + getLog().debug( "NMaven-test: workingDirectory(" + testAssemblies.getAbsolutePath() + ")" ); + + commandline.setWorkingDirectory( testAssemblies.getAbsolutePath() ); + if ( vendor.equals( Vendor.MICROSOFT ) ) + { + commandline.setExecutable( "nunit-console" ); + } + else if ( vendor.equals( Vendor.NOVELL ) ) + { + commandline.setExecutable( "nunit-console2" ); + } + else + { + throw new MojoExecutionException("Vendor not found."); + } + commandline.addArguments( getNUnitArguments() ); + + NUnitStreamConsumer systemOut = new NUnitStreamConsumer( getLog() ); + NUnitStreamConsumer systemErr = new NUnitStreamConsumer( getLog() ); + + int commandLineResult; + + try + { + // Execute the commandline + commandLineResult = CommandLineUtils.executeCommandLine( commandline, systemOut, systemErr ); + + getLog().debug( "Executed command: " + commandline + ", Result = " + commandLineResult ); + + // Check if nunit-console is not in the path + if ( systemErr.isCommandNotFound() ) + { + throw new MojoExecutionException( "Please add nunit-console to your path" ); + } + else if ( commandLineResult != 0 ) + { + throw new MojoFailureException( "There were NUnit test failure(s)" ); + } + } + catch ( CommandLineException e ) + { + throw new MojoExecutionException( "Failure executing commandline, " + e.getMessage() ); + } + + getLog().info( "Done executing tests.." ); + } + + private String getTestAssemblyName() + { + File file = project.getArtifact().getFile(); + String pieces = file.getName().substring( 0, file.getName().lastIndexOf( '.' ) ); + String testAssemblyName = pieces + "-test.dll"; + + return testAssemblyName; + } + + private String[] getNUnitArguments() + { + List nunitArgs = new ArrayList(); + + nunitArgs.add( getTestAssemblyName() ); + if ( arguments != null ) + { + nunitArgs.addAll( arguments ); + } + + return nunitArgs.toArray( new String[0] ); + } + + private static class NUnitStreamConsumer + implements StreamConsumer + { + + private boolean commandNotFound; + + private StringBuilder consumedLines = new StringBuilder(); + + private Log log; + + private NUnitStreamConsumer( Log log ) + { + this.log = log; + } + + public void consumeLine( String line ) + { + consumedLines.append( line + "\n" ); + + log.info( line ); + + if ( line.contains( COMMAND_NOT_FOUND_FRAGMENT ) ) + { + commandNotFound = true; + } + } + + public boolean isCommandNotFound() + { + return commandNotFound; + } + } +} Propchange: incubator/nmaven/trunk/plugins/maven-dotnet-test-plugin/src/main/java/org/apache/maven/dotnet/plugin/nunit/DotnetTestMojo.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/nmaven/trunk/plugins/maven-dotnet-wix-plugin/src/main/java/org/apache/maven/dotnet/plugin/wix/CandleMojo.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/nmaven/trunk/site/general/src/site/apt/index.apt ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/nmaven/trunk/site/general/src/site/apt/roadmap.apt ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/nmaven/trunk/site/versioned/src/site/apt/features.apt ------------------------------------------------------------------------------ svn:eol-style = native Modified: incubator/nmaven/trunk/site/versioned/src/site/apt/getting-started.apt URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/site/versioned/src/site/apt/getting-started.apt?rev=695350&r1=695349&r2=695350&view=diff ============================================================================== --- incubator/nmaven/trunk/site/versioned/src/site/apt/getting-started.apt (original) +++ incubator/nmaven/trunk/site/versioned/src/site/apt/getting-started.apt Sun Sep 14 23:03:08 2008 @@ -1,334 +1,334 @@ -Getting Started - -Sections - - * {{{getting-started.html#Building NMaven}Building NMaven}} - - * {{{getting-started.html#Signing Assemblies}Signing Assemblies}} - - * {{{getting-started.html#Assembly Info}Assembly Info}} - - * {{{getting-started.html#Compiling Projects} Compiling Projects}} - - * {{{getting-started.html#Project Dependencies} Project Dependencies}} - - * {{{getting-started.html#NUnit} NUnit}} - - * {{{getting-started.html#Archetypes} Archetypes}} - -* {Building NMaven} - -** Prerequisites - - Prior to building NMaven, make sure that you have the following installed on your system: - - [[1]] {{{ http://java.sun.com/javase/downloads/index_jdk5.jsp} JDK 5.0 Update x}} - - [[2]] For Microsoft builds you will need both {{{http://msdn2.microsoft.com/en-us/downloads/default.aspx} Microsoft .NET Framework}} (1.1+) - AND {{{http://msdn2.microsoft.com/en-us/downloads/default.aspx} NET Framework SDK}}. For Mono builds, you will need - {{{http://www.mono-project.com} Mono}} (tested with 1.2.3.1+). - - [[3]] Subversion client 1.3+. Click here for - {{{ http://subversion.tigris.org/servlets/ProjectDocumentView?documentID=35379&showInfo=true} Windows Subversion Client}}. - - [[4]] {{{http://maven.apache.org/download.html} Maven 2.0.9+}} - -[] - - Optional programs: - - [[1]] {{{http://nunit.org/index.php?p=download} NUnit 2.4.x+}} (Currently only supported building with Microsoft) - -** Toolchains - - To use NMaven you will need to configure the Maven Toolchains support. The following example gives you some guidance on - how to configure the various executables. The file should be placed in <<<~/.m2/toolchains.xml>>> - ----- - - - - - dotnet - - 2.0 - 2.0.50727 - MICROSOFT - .NET Framework 2.0 - - - C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc.exe - C:\Program Files\NUnit 2.4.8\bin\nunit-console.exe - C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 - C:\Program Files\Microsoft.NET\SDK\v2.0 - - - ----- - -** Paths - - You will need to make sure that you have both the SDK and the .NET framework locations within your path. - On Linux distributions, this should already be in your path. Typical locations for Microsoft include: - - * install root: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 - - * SDK root: C:\Program Files\Microsoft.NET\SDK\v2.0\ - - [] - - On Windows, Mono looks something like: - - * install root/SDK path: C:\Program Files\Mono-1.2.3.1\bin - - [] - - If you are using NUnit, add the NUnit bin to your path. - -** Build - - To build NMaven: - - [[1]] Do an SVN checkout - -+----+ - svn co https://svn.apache.org/repos/asf/incubator/nmaven/trunk nmaven -+----+ - - [[2]] Run - -+----+ - mvn install -+----+ - - To run with integration tests: - -+----+ - mvn install -P run-its -+----+ - -** Linux Specific Setup - - Building on Linux, may take some extra steps. By default, on many Linux environments, the GNU Compiler for Java is already - installed. The current GNU version may not work with NMaven, which requires JDK 1.5. To check which version the system uses, type "java -version" - on the command line. If you see something similar to the following, you will need to take additional steps to get the - build setup: - -+----+ - -java version "1.4.2" -gij (GNU libgcj) version 4.1.1 20060525 (Red Hat 4.1.1-1) -+----+ - - Create a file "/etc/profile.d/java.sh" with the following entries: - -+----+ - - export JAVA_HOME=/usr/java/jdk1.5.0_09 - export PATH=$JAVA_HOME/bin:$PATH -+----+ - - Type "mvn -version" from the command line. You should see the following: - -+----+ - -java version "1.5.0_09" -Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_09-b01) -Java HotSpot(TM) Client VM (build 1.5.0_09-b01, mixed mode, sharing) -+----+ - - You can try to build with the default version of Mono installed. If it doesn't work, - type "mono -V" on the command line to see what version you are running. If it is below 1.2.3.1, then download the - latest mono version, unzip and run rpm from the commandline. Detailed instructions are located here: - {{{ http://www.mono-project.com/Getting_Mono}Installing Mono}}. Make sure to su to root before installing with these - instructions! - -* {Signing Assemblies} - - To create a key - -+----+ - sn -k sgKey.snk -+----+ - - NMaven supports compile-time signing of assemblies. You can sign assemblies by using the keyfile field in the - maven-dotnet-compiler-plugin. - -+----+ - - . - - - org.apache.maven.dotnet.plugins - maven-dotnet-compiler-plugin - true - - sgKey.snk/keyfile> - - - - -+----+ - - Key signing is currently only supported for .NET framework 2.0. - -* {Assembly Info} - - Provided that you do not have your own AssemblyInfo class in your project, NMaven will automatically generate - an AssemblyInfo.* for you. It does the following mapping: - -*-------------------------+--------------------------------------------+ -| AssemblyDescription | $\{project.description\} | -*-------------------------+--------------------------------------------+ -| AssemblyVersion | $\{project.version\} | -*-------------------------+--------------------------------------------+ -| AssemblyTitle | $\{project.name\} | -*-------------------------+--------------------------------------------+ -| AssemblyCompany | $\{project.organization.name\} | -*-------------------------+--------------------------------------------+ -| AssemblyProduct | $\{project.organization.name\}-$\{project.name\} | -*-------------------------+--------------------------------------------+ -| AssemblyCopyright | place a COPYRIGHT.txt file in your module directory and NMaven will pick it up and put it in the assembly | -*-------------------------+--------------------------------------------+ - - Since the pom version is mapped to the assembly manifest, you MUST follow the 0.0.0.0 version convention or the build - will fail. You may, however, optionally add additional tags after the 0.0.0.0 version, such as -SNAPSHOT, alpha, etc. - Valid versions would include 1.3.4 or 1.2-SNAPSHOT or 1.2-RC1. - -* {Compiling Projects} - - NMaven supports compiling of exe, winexe, library, and netmodule projects. - -*-------------------------+--------------------------------------------+ -| <> | <> | -*-------------------------+--------------------------------------------+ -| exe | dotnet:exe | -*-------------------------+--------------------------------------------+ -| winexe | dotnet:winexe | -*-------------------------+--------------------------------------------+ -| library | dotnet:library | -*-------------------------+--------------------------------------------+ -| netmodule | dotnet:module | -*-------------------------+--------------------------------------------+ - - For example, the pom for compiling a library would look like: - -+----+ - - - - 4.0.0 - NMaven.Its - NMaven.It.It0000 - dotnet:library - 1.0.0 - NMaven.It.It0000 - - . - Test - - - org.apache.maven.dotnet.plugins - maven-dotnet-compiler-plugin - true - - - - -+----+ - - If you are using Mono on Windows, then set the vendor tag. If you are compiling on a non-Windows platform, then you do not need to set the - tag. - -+----+ - - - org.apache.maven.dotnet.plugins - maven-dotnet-compiler-plugin - true - - NOVELL - - - -+----+ - -* {Project Dependencies} - - To use a gac dependency, you will need to set a GAC_ROOT environment variable to point to either the Microsoft or Mono - GAC root location. Then use the system scope as shown below. You can also use types: dotnet:gac_32 and dotnet:gac. - -+----+ - - System.Windows.Forms - System.Windows.Forms - 2.0.0.0 - dotnet:gac_msil - system - b77a5c561934e089 - - ${env.GAC_ROOT}\GAC_MSIL\System.Windows.Forms\2.0.0.0__b77a5c561934e089\System.Windows.Forms.dll - - -+----+ - - A typical dependency would look like. - -+----+ - - - NMaven.Its - NMaven.It.It0004 - 1.0.0 - dotnet:library - - -+----+ - - dotnet:winexe and dotnet:exe can also be used as dependency types. dotnet:module can also be used but will not be transitive. - -* {NUnit} - - NUnit is currently only supported building with Microsoft, not Mono. To use, add the following dependency to the pom. - -+----+ - - org.apache.maven.dotnet - NUnit.Framework - 2.4.6-incubating-SNAPSHOT - dotnet:library - test - -+----+ - - And also set the test source directory to where your test classes are located. - -+----+ - - . - Test -... - -+----+ - -* {Archetypes} - - To create a library project: - -+----+ -mvn archetype:create -DarchetypeGroupId=org.apache.maven.dotnet.csharp / - -DarchetypeArtifactId=maven-archetype-class-library / - -DarchetypeVersion=0.15-incubating-SNAPSHOT / - -DgroupId=<> / - -DartifactId=<> -+----+ - - The archetypeArtifactId can be specified as any of the following: - - [[1]] maven-archetype-class-library - - [[2]] maven-archetype-console-application - - [[3]] maven-archetype-windows-application - - [[4]] maven-archetype-windows-control +Getting Started + +Sections + + * {{{getting-started.html#Building NMaven}Building NMaven}} + + * {{{getting-started.html#Signing Assemblies}Signing Assemblies}} + + * {{{getting-started.html#Assembly Info}Assembly Info}} + + * {{{getting-started.html#Compiling Projects} Compiling Projects}} + + * {{{getting-started.html#Project Dependencies} Project Dependencies}} + + * {{{getting-started.html#NUnit} NUnit}} + + * {{{getting-started.html#Archetypes} Archetypes}} + +* {Building NMaven} + +** Prerequisites + + Prior to building NMaven, make sure that you have the following installed on your system: + + [[1]] {{{ http://java.sun.com/javase/downloads/index_jdk5.jsp} JDK 5.0 Update x}} + + [[2]] For Microsoft builds you will need both {{{http://msdn2.microsoft.com/en-us/downloads/default.aspx} Microsoft .NET Framework}} (1.1+) + AND {{{http://msdn2.microsoft.com/en-us/downloads/default.aspx} NET Framework SDK}}. For Mono builds, you will need + {{{http://www.mono-project.com} Mono}} (tested with 1.2.3.1+). + + [[3]] Subversion client 1.3+. Click here for + {{{ http://subversion.tigris.org/servlets/ProjectDocumentView?documentID=35379&showInfo=true} Windows Subversion Client}}. + + [[4]] {{{http://maven.apache.org/download.html} Maven 2.0.9+}} + +[] + + Optional programs: + + [[1]] {{{http://nunit.org/index.php?p=download} NUnit 2.4.x+}} (Currently only supported building with Microsoft) + +** Toolchains + + To use NMaven you will need to configure the Maven Toolchains support. The following example gives you some guidance on + how to configure the various executables. The file should be placed in <<<~/.m2/toolchains.xml>>> + +---- + + + + + dotnet + + 2.0 + 2.0.50727 + MICROSOFT + .NET Framework 2.0 + + + C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc.exe + C:\Program Files\NUnit 2.4.8\bin\nunit-console.exe + C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 + C:\Program Files\Microsoft.NET\SDK\v2.0 + + + +---- + +** Paths + + You will need to make sure that you have both the SDK and the .NET framework locations within your path. + On Linux distributions, this should already be in your path. Typical locations for Microsoft include: + + * install root: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 + + * SDK root: C:\Program Files\Microsoft.NET\SDK\v2.0\ + + [] + + On Windows, Mono looks something like: + + * install root/SDK path: C:\Program Files\Mono-1.2.3.1\bin + + [] + + If you are using NUnit, add the NUnit bin to your path. + +** Build + + To build NMaven: + + [[1]] Do an SVN checkout + ++----+ + svn co https://svn.apache.org/repos/asf/incubator/nmaven/trunk nmaven ++----+ + + [[2]] Run + ++----+ + mvn install ++----+ + + To run with integration tests: + ++----+ + mvn install -P run-its ++----+ + +** Linux Specific Setup + + Building on Linux, may take some extra steps. By default, on many Linux environments, the GNU Compiler for Java is already + installed. The current GNU version may not work with NMaven, which requires JDK 1.5. To check which version the system uses, type "java -version" + on the command line. If you see something similar to the following, you will need to take additional steps to get the + build setup: + ++----+ + +java version "1.4.2" +gij (GNU libgcj) version 4.1.1 20060525 (Red Hat 4.1.1-1) ++----+ + + Create a file "/etc/profile.d/java.sh" with the following entries: + ++----+ + + export JAVA_HOME=/usr/java/jdk1.5.0_09 + export PATH=$JAVA_HOME/bin:$PATH ++----+ + + Type "mvn -version" from the command line. You should see the following: + ++----+ + +java version "1.5.0_09" +Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_09-b01) +Java HotSpot(TM) Client VM (build 1.5.0_09-b01, mixed mode, sharing) ++----+ + + You can try to build with the default version of Mono installed. If it doesn't work, + type "mono -V" on the command line to see what version you are running. If it is below 1.2.3.1, then download the + latest mono version, unzip and run rpm from the commandline. Detailed instructions are located here: + {{{ http://www.mono-project.com/Getting_Mono}Installing Mono}}. Make sure to su to root before installing with these + instructions! + +* {Signing Assemblies} + + To create a key + ++----+ + sn -k sgKey.snk ++----+ + + NMaven supports compile-time signing of assemblies. You can sign assemblies by using the keyfile field in the + maven-dotnet-compiler-plugin. + ++----+ + + . + + + org.apache.maven.dotnet.plugins + maven-dotnet-compiler-plugin + true + + sgKey.snk/keyfile> + + + + ++----+ + + Key signing is currently only supported for .NET framework 2.0. + +* {Assembly Info} + + Provided that you do not have your own AssemblyInfo class in your project, NMaven will automatically generate + an AssemblyInfo.* for you. It does the following mapping: + +*-------------------------+--------------------------------------------+ +| AssemblyDescription | $\{project.description\} | +*-------------------------+--------------------------------------------+ +| AssemblyVersion | $\{project.version\} | +*-------------------------+--------------------------------------------+ +| AssemblyTitle | $\{project.name\} | +*-------------------------+--------------------------------------------+ +| AssemblyCompany | $\{project.organization.name\} | +*-------------------------+--------------------------------------------+ +| AssemblyProduct | $\{project.organization.name\}-$\{project.name\} | +*-------------------------+--------------------------------------------+ +| AssemblyCopyright | place a COPYRIGHT.txt file in your module directory and NMaven will pick it up and put it in the assembly | +*-------------------------+--------------------------------------------+ + + Since the pom version is mapped to the assembly manifest, you MUST follow the 0.0.0.0 version convention or the build + will fail. You may, however, optionally add additional tags after the 0.0.0.0 version, such as -SNAPSHOT, alpha, etc. + Valid versions would include 1.3.4 or 1.2-SNAPSHOT or 1.2-RC1. + +* {Compiling Projects} + + NMaven supports compiling of exe, winexe, library, and netmodule projects. + +*-------------------------+--------------------------------------------+ +| <> | <> | +*-------------------------+--------------------------------------------+ +| exe | dotnet:exe | +*-------------------------+--------------------------------------------+ +| winexe | dotnet:winexe | +*-------------------------+--------------------------------------------+ +| library | dotnet:library | +*-------------------------+--------------------------------------------+ +| netmodule | dotnet:module | +*-------------------------+--------------------------------------------+ + + For example, the pom for compiling a library would look like: + ++----+ + + + + 4.0.0 + NMaven.Its + NMaven.It.It0000 + dotnet:library + 1.0.0 + NMaven.It.It0000 + + . + Test + + + org.apache.maven.dotnet.plugins + maven-dotnet-compiler-plugin + true + + + + ++----+ + + If you are using Mono on Windows, then set the vendor tag. If you are compiling on a non-Windows platform, then you do not need to set the + tag. + ++----+ + + + org.apache.maven.dotnet.plugins + maven-dotnet-compiler-plugin + true + + NOVELL + + + ++----+ + +* {Project Dependencies} + + To use a gac dependency, you will need to set a GAC_ROOT environment variable to point to either the Microsoft or Mono + GAC root location. Then use the system scope as shown below. You can also use types: dotnet:gac_32 and dotnet:gac. + ++----+ + + System.Windows.Forms + System.Windows.Forms + 2.0.0.0 + dotnet:gac_msil + system + b77a5c561934e089 + + ${env.GAC_ROOT}\GAC_MSIL\System.Windows.Forms\2.0.0.0__b77a5c561934e089\System.Windows.Forms.dll + + ++----+ + + A typical dependency would look like. + ++----+ + + + NMaven.Its + NMaven.It.It0004 + 1.0.0 + dotnet:library + + ++----+ + + dotnet:winexe and dotnet:exe can also be used as dependency types. dotnet:module can also be used but will not be transitive. + +* {NUnit} + + NUnit is currently only supported building with Microsoft, not Mono. To use, add the following dependency to the pom. + ++----+ + + org.apache.maven.dotnet + NUnit.Framework + 2.4.6-incubating-SNAPSHOT + dotnet:library + test + ++----+ + + And also set the test source directory to where your test classes are located. + ++----+ + + . + Test +... + ++----+ + +* {Archetypes} + + To create a library project: + ++----+ +mvn archetype:create -DarchetypeGroupId=org.apache.maven.dotnet.csharp / + -DarchetypeArtifactId=maven-archetype-class-library / + -DarchetypeVersion=0.15-incubating-SNAPSHOT / + -DgroupId=<> / + -DartifactId=<> ++----+ + + The archetypeArtifactId can be specified as any of the following: + + [[1]] maven-archetype-class-library + + [[2]] maven-archetype-console-application + + [[3]] maven-archetype-windows-application + + [[4]] maven-archetype-windows-control Propchange: incubator/nmaven/trunk/site/versioned/src/site/apt/getting-started.apt ------------------------------------------------------------------------------ svn:eol-style = native Modified: incubator/nmaven/trunk/site/versioned/src/site/apt/index.apt URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/site/versioned/src/site/apt/index.apt?rev=695350&r1=695349&r2=695350&view=diff ============================================================================== --- incubator/nmaven/trunk/site/versioned/src/site/apt/index.apt (original) +++ incubator/nmaven/trunk/site/versioned/src/site/apt/index.apt Sun Sep 14 23:03:08 2008 @@ -1,13 +1,13 @@ -About NMaven - - NMaven provides Maven 2.x plugins to support building of .NET applications. - - [] - -Reporting Bugs/Requesting Features - - * {{{http://jira.codehaus.org/browse/NMAVEN} NMaven Issue Tracking}} - - * {{{mailto:nmaven-dev@incubator.apache.org} Post to Mailing List}} - - +About NMaven + + NMaven provides Maven 2.x plugins to support building of .NET applications. + + [] + +Reporting Bugs/Requesting Features + + * {{{http://jira.codehaus.org/browse/NMAVEN} NMaven Issue Tracking}} + + * {{{mailto:nmaven-dev@incubator.apache.org} Post to Mailing List}} + + Propchange: incubator/nmaven/trunk/site/versioned/src/site/apt/index.apt ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/nmaven/trunk/src/main/assembly/src.xml ------------------------------------------------------------------------------ svn:eol-style = native