svn commit: r619598 - /incubator/nmaven/trunk/README.txt
Author: sisbell Date: Thu Feb 7 11:41:33 2008 New Revision: 619598 URL: http://svn.apache.org/viewvc?rev=619598&view=rev Log: Updated readme Modified: incubator/nmaven/trunk/README.txt Modified: incubator/nmaven/trunk/README.txt URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/README.txt?rev=619598&r1=619597&r2=619598&view=diff == --- incubator/nmaven/trunk/README.txt (original) +++ incubator/nmaven/trunk/README.txt Thu Feb 7 11:41:33 2008 @@ -1,5 +1,294 @@ Disclaimer: Apache NMaven is undergoing incubation at the ASF. -Prerequisites -* csc.exe must be available on your PATH. Usually it can be found in C:\WINDOWS\Microsoft.NET\Framework\[version] +Getting Started + +* {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.7+}} + +[] + + Optional programs: + + [[1]] {{{http://nunit.org/index.php?p=download} NUnit 2.4.x+}} (Currently only supported building with Microsoft) + +** 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\} | +*-++ +| AssemblyTi
svn commit: r619596 - /incubator/nmaven/trunk/site/versioned/src/site/apt/getting-started.apt
Author: sisbell Date: Thu Feb 7 11:40:34 2008 New Revision: 619596 URL: http://svn.apache.org/viewvc?rev=619596&view=rev Log: Updates docs. Modified: incubator/nmaven/trunk/site/versioned/src/site/apt/getting-started.apt 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=619596&r1=619595&r2=619596&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 Thu Feb 7 11:40:34 2008 @@ -26,12 +26,20 @@ [[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}} (1.2.3.1+). + {{{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.7 or higher}} + [[4]] {{{http://maven.apache.org/download.html} Maven 2.0.7+}} + +[] + + Optional programs: + + [[1]] {{{http://nunit.org/index.php?p=download} NUnit 2.4.x+}} (Currently only supported building with Microsoft) + +** 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: @@ -46,6 +54,10 @@ * 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: @@ -62,10 +74,16 @@ 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 will not work with NMaven. To check which version the system uses, type "java -version" + 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: @@ -92,9 +110,9 @@ Java HotSpot(TM) Client VM (build 1.5.0_09-b01, mixed mode, sharing) ++ - On Linux, you also need Mono version 2.1.3.1 or higher. Type "mono -V" on the command line to see what version you - are running. If it is below 2.1.3.1, then download the latest mono version, unzip and run rpm from the commandline. - Detailed instructions are located here: + 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! @@ -111,7 +129,7 @@ ++ -src/main/csharp +. org.apache.maven.dotnet.plugins @@ -127,7 +145,6 @@ 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 @@ -181,6 +198,7 @@ NMaven.It.It . +Test org.apache.maven.dotnet.plugins @@ -192,6 +210,22 @@ ++ + 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 @@ -228,7 +262,27 @@ * {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}
svn commit: r619597 - /incubator/nmaven/trunk/plugins/maven-dotnet-test-plugin/src/main/java/org/apache/maven/dotnet/plugin/nunit/DotnetTestMojo.java
Author: sisbell Date: Thu Feb 7 11:41:19 2008 New Revision: 619597 URL: http://svn.apache.org/viewvc?rev=619597&view=rev Log: Test mojo can now accept vendor tag. Modified: incubator/nmaven/trunk/plugins/maven-dotnet-test-plugin/src/main/java/org/apache/maven/dotnet/plugin/nunit/DotnetTestMojo.java 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=619597&r1=619596&r2=619597&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 Thu Feb 7 11:41:19 2008 @@ -28,6 +28,7 @@ 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; @@ -35,7 +36,7 @@ /** * Maven Mojo for executing nunit tests - * + * * @goal test * @phase test * @description Maven Mojo for executing nunit tests @@ -47,22 +48,28 @@ // 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"; -private static final String NUNIT_EXECUTABLE = "nunit-console"; - /** * 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 { @@ -72,14 +79,24 @@ 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() ); @@ -89,21 +106,31 @@ getLog().debug( "NMaven-test: workingDirectory(" + testAssemblies.getAbsolutePath() + ")" ); commandline.setWorkingDirectory( testAssemblies.getAbsolutePath() ); -commandline.setExecutable( NUNIT_EXECUTABLE ); +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 = -999; - +int commandLineResult; + try { // Execute the commandline -commandLineResult = -CommandLineUtils.executeCommandLine( commandline, systemOut, systemErr ); - -getLog().debug( "Executed command: " + commandline + ", Result = " + commandLineResult); +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() ) @@ -120,7 +147,6 @@ throw new MojoExecutionException( "Failure executing commandline, " + e.getMessage() ); } - getLog().info( "Done executing tests.." ); } @@ -132,15 +158,17 @@ return testAssemblyName; } - -private String[] getNUnitArguments
svn commit: r619771 - in /incubator/nmaven/trunk/core-integration-tests/src/test/resources/MavenITmng-0020-ShareTestSource: ./ A/ A/pom.xml A/test/ A/test/A.cs B/ B/pom.xml B/test/ B/test/B.cs
Author: eworley Date: Thu Feb 7 21:23:22 2008 New Revision: 619771 URL: http://svn.apache.org/viewvc?rev=619771&view=rev Log: Adding IT0020, which tests having a test scoped dependency on another module. This is not currently working. Added: incubator/nmaven/trunk/core-integration-tests/src/test/resources/MavenITmng-0020-ShareTestSource/ incubator/nmaven/trunk/core-integration-tests/src/test/resources/MavenITmng-0020-ShareTestSource/A/ incubator/nmaven/trunk/core-integration-tests/src/test/resources/MavenITmng-0020-ShareTestSource/A/pom.xml incubator/nmaven/trunk/core-integration-tests/src/test/resources/MavenITmng-0020-ShareTestSource/A/test/ incubator/nmaven/trunk/core-integration-tests/src/test/resources/MavenITmng-0020-ShareTestSource/A/test/A.cs incubator/nmaven/trunk/core-integration-tests/src/test/resources/MavenITmng-0020-ShareTestSource/B/ incubator/nmaven/trunk/core-integration-tests/src/test/resources/MavenITmng-0020-ShareTestSource/B/pom.xml incubator/nmaven/trunk/core-integration-tests/src/test/resources/MavenITmng-0020-ShareTestSource/B/test/ incubator/nmaven/trunk/core-integration-tests/src/test/resources/MavenITmng-0020-ShareTestSource/B/test/B.cs Added: incubator/nmaven/trunk/core-integration-tests/src/test/resources/MavenITmng-0020-ShareTestSource/A/pom.xml URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/core-integration-tests/src/test/resources/MavenITmng-0020-ShareTestSource/A/pom.xml?rev=619771&view=auto == --- incubator/nmaven/trunk/core-integration-tests/src/test/resources/MavenITmng-0020-ShareTestSource/A/pom.xml (added) +++ incubator/nmaven/trunk/core-integration-tests/src/test/resources/MavenITmng-0020-ShareTestSource/A/pom.xml Thu Feb 7 21:23:22 2008 @@ -0,0 +1,60 @@ + + + + 4.0.0 + NMaven.Its + NMaven.It.It0020A + dotnet:library + 1.0.0 + NMaven.It.It0020A + + +src +test + + +org.apache.maven.dotnet.plugins +maven-dotnet-compiler-plugin +true + + +org.apache.maven.dotnet.plugins +maven-dotnet-test-plugin + + +/nologo +/labels + + + + + + + + org.apache.maven.dotnet + NUnit.Framework + 2.4.6-incubating-SNAPSHOT + dotnet:library + test + + + + NMaven.Its + NMaven.It.It0020B + test + 1.0.0 + dotnet:library + + + + + + m2-snapshot + Maven2 Snapshot Repository + http://people.apache.org/repo/m2-snapshot-repository/ + +true + + + + Added: incubator/nmaven/trunk/core-integration-tests/src/test/resources/MavenITmng-0020-ShareTestSource/A/test/A.cs URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/core-integration-tests/src/test/resources/MavenITmng-0020-ShareTestSource/A/test/A.cs?rev=619771&view=auto == --- incubator/nmaven/trunk/core-integration-tests/src/test/resources/MavenITmng-0020-ShareTestSource/A/test/A.cs (added) +++ incubator/nmaven/trunk/core-integration-tests/src/test/resources/MavenITmng-0020-ShareTestSource/A/test/A.cs Thu Feb 7 21:23:22 2008 @@ -0,0 +1,13 @@ +using System; +using NUnit.Framework; + +namespace NMaven.IT { + +[TestFixture] + public class A { + [Test] + public void testUsingB() { +B b = new B(); + } + } +} Added: incubator/nmaven/trunk/core-integration-tests/src/test/resources/MavenITmng-0020-ShareTestSource/B/pom.xml URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/core-integration-tests/src/test/resources/MavenITmng-0020-ShareTestSource/B/pom.xml?rev=619771&view=auto == --- incubator/nmaven/trunk/core-integration-tests/src/test/resources/MavenITmng-0020-ShareTestSource/B/pom.xml (added) +++ incubator/nmaven/trunk/core-integration-tests/src/test/resources/MavenITmng-0020-ShareTestSource/B/pom.xml Thu Feb 7 21:23:22 2008 @@ -0,0 +1,52 @@ + + + + 4.0.0 + NMaven.Its + NMaven.It.It0020B + dotnet:library + 1.0.0 + NMaven.It.It0020B + + +src +test + + +org.apache.maven.dotnet.plugins +maven-dotnet-compiler-plugin +true + + +org.apache.maven.dotnet.plugins +maven-dotnet-test-plugin + + +/nologo +/labels + + + + + + + + org.apache.maven.dotnet + NUnit.Framework + 2.4.6-incubating-SNAPSHOT + dotnet:library + test + + + + + + m2-snapshot + Maven2 Snapshot Repository + http://people.apache.org/repo/m2-snapshot-repository/ + +true + + + + Added: incubato