You are viewing a plain text version of this content. The canonical link for it is here.
Posted to nmaven-commits@incubator.apache.org by si...@apache.org on 2007/04/24 05:39:55 UTC

svn commit: r531744 - in /incubator/nmaven/branches/SI_XPT/archetypes: ./ maven-archetype-netexecutable/ maven-archetype-netexecutable/src/ maven-archetype-netexecutable/src/main/ maven-archetype-netexecutable/src/main/resources/ maven-archetype-netexe...

Author: sisbell
Date: Mon Apr 23 22:39:54 2007
New Revision: 531744

URL: http://svn.apache.org/viewvc?view=rev&rev=531744
Log:
Initial import of the netexecutable archetype.

Added:
    incubator/nmaven/branches/SI_XPT/archetypes/
    incubator/nmaven/branches/SI_XPT/archetypes/maven-archetype-netexecutable/
    incubator/nmaven/branches/SI_XPT/archetypes/maven-archetype-netexecutable/pom.xml   (with props)
    incubator/nmaven/branches/SI_XPT/archetypes/maven-archetype-netexecutable/src/
    incubator/nmaven/branches/SI_XPT/archetypes/maven-archetype-netexecutable/src/main/
    incubator/nmaven/branches/SI_XPT/archetypes/maven-archetype-netexecutable/src/main/resources/
    incubator/nmaven/branches/SI_XPT/archetypes/maven-archetype-netexecutable/src/main/resources/META-INF/
    incubator/nmaven/branches/SI_XPT/archetypes/maven-archetype-netexecutable/src/main/resources/META-INF/maven/
    incubator/nmaven/branches/SI_XPT/archetypes/maven-archetype-netexecutable/src/main/resources/META-INF/maven/archetype.xml   (with props)
    incubator/nmaven/branches/SI_XPT/archetypes/maven-archetype-netexecutable/src/main/resources/archetype-resources/
    incubator/nmaven/branches/SI_XPT/archetypes/maven-archetype-netexecutable/src/main/resources/archetype-resources/pom.xml   (with props)
    incubator/nmaven/branches/SI_XPT/archetypes/maven-archetype-netexecutable/src/main/resources/archetype-resources/src/
    incubator/nmaven/branches/SI_XPT/archetypes/maven-archetype-netexecutable/src/main/resources/archetype-resources/src/main/
    incubator/nmaven/branches/SI_XPT/archetypes/maven-archetype-netexecutable/src/main/resources/archetype-resources/src/main/java/
    incubator/nmaven/branches/SI_XPT/archetypes/maven-archetype-netexecutable/src/main/resources/archetype-resources/src/main/java/NetExecutableMojo.java   (with props)

Added: incubator/nmaven/branches/SI_XPT/archetypes/maven-archetype-netexecutable/pom.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/archetypes/maven-archetype-netexecutable/pom.xml?view=auto&rev=531744
==============================================================================
--- incubator/nmaven/branches/SI_XPT/archetypes/maven-archetype-netexecutable/pom.xml (added)
+++ incubator/nmaven/branches/SI_XPT/archetypes/maven-archetype-netexecutable/pom.xml Mon Apr 23 22:39:54 2007
@@ -0,0 +1,9 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.dotnet</groupId>
+  <artifactId>maven-archetype-netexecutable</artifactId>
+  <version>0.14-SNAPSHOT</version>
+  <name>Archetype - maven-archetype-netexecutable</name>
+  <url>http://maven.apache.org</url>
+</project>

Propchange: incubator/nmaven/branches/SI_XPT/archetypes/maven-archetype-netexecutable/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/nmaven/branches/SI_XPT/archetypes/maven-archetype-netexecutable/src/main/resources/META-INF/maven/archetype.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/archetypes/maven-archetype-netexecutable/src/main/resources/META-INF/maven/archetype.xml?view=auto&rev=531744
==============================================================================
--- incubator/nmaven/branches/SI_XPT/archetypes/maven-archetype-netexecutable/src/main/resources/META-INF/maven/archetype.xml (added)
+++ incubator/nmaven/branches/SI_XPT/archetypes/maven-archetype-netexecutable/src/main/resources/META-INF/maven/archetype.xml Mon Apr 23 22:39:54 2007
@@ -0,0 +1,6 @@
+<archetype>
+  <id>maven-archetype-netexecutable</id>
+  <sources>
+    <source>src/main/java/NetExecutableMojo.java</source>
+  </sources>
+</archetype>

Propchange: incubator/nmaven/branches/SI_XPT/archetypes/maven-archetype-netexecutable/src/main/resources/META-INF/maven/archetype.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/nmaven/branches/SI_XPT/archetypes/maven-archetype-netexecutable/src/main/resources/archetype-resources/pom.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/archetypes/maven-archetype-netexecutable/src/main/resources/archetype-resources/pom.xml?view=auto&rev=531744
==============================================================================
--- incubator/nmaven/branches/SI_XPT/archetypes/maven-archetype-netexecutable/src/main/resources/archetype-resources/pom.xml (added)
+++ incubator/nmaven/branches/SI_XPT/archetypes/maven-archetype-netexecutable/src/main/resources/archetype-resources/pom.xml Mon Apr 23 22:39:54 2007
@@ -0,0 +1,15 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>${groupId}</groupId>
+  <artifactId>${artifactId}</artifactId>
+  <version>${version}</version>
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+</project>

Propchange: incubator/nmaven/branches/SI_XPT/archetypes/maven-archetype-netexecutable/src/main/resources/archetype-resources/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/nmaven/branches/SI_XPT/archetypes/maven-archetype-netexecutable/src/main/resources/archetype-resources/src/main/java/NetExecutableMojo.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/archetypes/maven-archetype-netexecutable/src/main/resources/archetype-resources/src/main/java/NetExecutableMojo.java?view=auto&rev=531744
==============================================================================
--- incubator/nmaven/branches/SI_XPT/archetypes/maven-archetype-netexecutable/src/main/resources/archetype-resources/src/main/java/NetExecutableMojo.java (added)
+++ incubator/nmaven/branches/SI_XPT/archetypes/maven-archetype-netexecutable/src/main/resources/archetype-resources/src/main/java/NetExecutableMojo.java Mon Apr 23 22:39:54 2007
@@ -0,0 +1,103 @@
+package $package;
+
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.dotnet.executable.ExecutionException;
+import org.apache.maven.dotnet.PlatformUnsupportedException;
+import org.apache.maven.project.MavenProject;
+
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * To complete the implementation:
+ * 1) Make sure to add an entry in the net-executables.xml file, located within the dotnet-core module. Replace each
+ * param: ${vendor}, ${exe}, .. with the appropriate values.
+<pre>
+  <executablePlugin>
+    <identifier>${ID}</identifier>
+    <pluginClass>org.apache.maven.dotnet.executable.impl.DefaultNetExecutable</pluginClass>
+    <vendor>${vendor}</vendor>
+    <executable>${exe}</executable>
+    <profile>${profile}</profile>
+    <frameworkVersions>
+      <frameworkVersion>2.0.50727</frameworkVersion>
+      <frameworkVersion>1.1.4322</frameworkVersion>
+    </frameworkVersions>
+    <platforms>
+      <platform>
+        <operatingSystem>Windows</operatingSystem>
+      </platform>
+    </platforms>
+  </executablePlugin>
+</pre>
+ * 2) Add profile <<ADD_PROFILE>> to the meta-data of the profile field of this class. This profile name should match
+ * the ${profile} within the net-executables.xml.
+ * 3) Add any special commands to the getCommands method.
+ * 4) Recompile the dotnet-core component.
+ * 5) Rename this class and install this Mojo component.
+ */
+public class NetExecutableMojo
+    extends AbstractMojo
+{
+    /**
+     * @component
+     */
+    private org.apache.maven.dotnet.executable.NetExecutableFactory netExecutableFactory;
+
+    /**
+     * The maven project.
+     *
+     * @parameter expression="${project}"
+     * @required
+     */
+    private MavenProject project;
+
+    /**
+     * The Vendor for the executable.
+     *
+     * @parameter expression="${vendor}"
+     */
+    private String vendor;
+
+    /**
+     * @parameter expression = "${frameworkVersion}"
+     */
+    private String frameworkVersion;
+
+    /**
+     * The profile that the executable should use.
+     *
+     * @parameter expression = "${profile}" default-value = "<<ADD_PROFILE>>"
+     */
+    private String profile;
+
+    public void execute()
+        throws MojoExecutionException
+    {
+        try
+        {
+            netExecutableFactory.getNetExecutableFor( vendor, frameworkVersion, profile, project, getCommands(),
+                                                      null ).execute();
+        }
+        catch ( ExecutionException e )
+        {
+            throw new MojoExecutionException( "NMAVEN-xxx-000: Unable to execute gacutil: Vendor " + vendor +
+                ", frameworkVersion = " + frameworkVersion + ", Profile = " + profile, e );
+        }
+        catch ( PlatformUnsupportedException e )
+        {
+            throw new MojoExecutionException( "NMAVEN-xxx-001: Platform Unsupported: Vendor " + vendor +
+                ", frameworkVersion = " + frameworkVersion + ", Profile = " + profile, e );
+        }
+    }
+
+    public List<String> getCommands()
+        throws MojoExecutionException
+    {
+        List<String> commands = new ArrayList<String>();
+        //<<ADD COMMANDS HERE>>
+        return commands;
+    }
+
+}

Propchange: incubator/nmaven/branches/SI_XPT/archetypes/maven-archetype-netexecutable/src/main/resources/archetype-resources/src/main/java/NetExecutableMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native