incubator-nmaven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sisb...@apache.org
Subject svn commit: r629620 - in /incubator/nmaven/trunk: ./ components/maven-dotnet-extensions/ components/maven-dotnet-extensions/src/main/java/org/apache/maven/dotnet/extensions/toolchain/ components/maven-dotnet-extensions/src/main/resources/META-INF/plexu...
Date Wed, 20 Feb 2008 21:36:35 GMT
Author: sisbell
Date: Wed Feb 20 13:36:29 2008
New Revision: 629620

URL: http://svn.apache.org/viewvc?rev=629620&view=rev
Log:
Setup stubs for onbtaining a toolchain.

Added:
    incubator/nmaven/trunk/components/maven-dotnet-extensions/src/main/java/org/apache/maven/dotnet/extensions/toolchain/
    incubator/nmaven/trunk/components/maven-dotnet-extensions/src/main/java/org/apache/maven/dotnet/extensions/toolchain/DotnetToolchain.java
    incubator/nmaven/trunk/components/maven-dotnet-extensions/src/main/java/org/apache/maven/dotnet/extensions/toolchain/DotnetToolchainFactory.java
    incubator/nmaven/trunk/components/maven-dotnet-extensions/src/main/resources/META-INF/plexus/
    incubator/nmaven/trunk/components/maven-dotnet-extensions/src/main/resources/META-INF/plexus/components.xml
Modified:
    incubator/nmaven/trunk/README.txt
    incubator/nmaven/trunk/components/maven-dotnet-extensions/pom.xml
    incubator/nmaven/trunk/maven-dotnet.iml
    incubator/nmaven/trunk/plugins/maven-dotnet-compiler-plugin/pom.xml
    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/README.txt
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/README.txt?rev=629620&r1=629619&r2=629620&view=diff
==============================================================================
--- incubator/nmaven/trunk/README.txt (original)
+++ incubator/nmaven/trunk/README.txt Wed Feb 20 13:36:29 2008
@@ -1,6 +1,9 @@
 Disclaimer:
 Apache NMaven is undergoing incubation at the ASF.
 
+NOTE: For the current trunk, you will need to use maven 2.0.9-snapshot. After building NMaven,
place maven-toolchain-1.0-SNAPSHOT
+ in  the MAVEN_HOME/lib directory.
+
 Getting Started
 
 * {Building NMaven}

Modified: incubator/nmaven/trunk/components/maven-dotnet-extensions/pom.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/maven-dotnet-extensions/pom.xml?rev=629620&r1=629619&r2=629620&view=diff
==============================================================================
--- incubator/nmaven/trunk/components/maven-dotnet-extensions/pom.xml (original)
+++ incubator/nmaven/trunk/components/maven-dotnet-extensions/pom.xml Wed Feb 20 13:36:29
2008
@@ -46,6 +46,11 @@
       <version>0.16-incubating-SNAPSHOT</version>
     </dependency>
     <dependency>
+      <groupId>org.apache.maven.shared</groupId>
+      <artifactId>maven-toolchain</artifactId>
+      <version>1.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-artifact</artifactId>
     </dependency>

Added: incubator/nmaven/trunk/components/maven-dotnet-extensions/src/main/java/org/apache/maven/dotnet/extensions/toolchain/DotnetToolchain.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/maven-dotnet-extensions/src/main/java/org/apache/maven/dotnet/extensions/toolchain/DotnetToolchain.java?rev=629620&view=auto
==============================================================================
--- incubator/nmaven/trunk/components/maven-dotnet-extensions/src/main/java/org/apache/maven/dotnet/extensions/toolchain/DotnetToolchain.java
(added)
+++ incubator/nmaven/trunk/components/maven-dotnet-extensions/src/main/java/org/apache/maven/dotnet/extensions/toolchain/DotnetToolchain.java
Wed Feb 20 13:36:29 2008
@@ -0,0 +1,24 @@
+package org.apache.maven.dotnet.extensions.toolchain;
+
+import org.apache.maven.toolchain.DefaultToolchain;
+import org.apache.maven.toolchain.model.ToolchainModel;
+import org.codehaus.plexus.logging.Logger;
+
+public final class DotnetToolchain
+    extends DefaultToolchain
+{
+    public DotnetToolchain( ToolchainModel model, Logger logger )
+    {
+        super(model, logger);
+    }
+
+    public DotnetToolchain( ToolchainModel model, String type, Logger logger )
+    {
+        super(model, type, logger);
+    }
+
+    public String findTool( String toolName )
+    {
+        return null;
+    }
+}

Added: incubator/nmaven/trunk/components/maven-dotnet-extensions/src/main/java/org/apache/maven/dotnet/extensions/toolchain/DotnetToolchainFactory.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/maven-dotnet-extensions/src/main/java/org/apache/maven/dotnet/extensions/toolchain/DotnetToolchainFactory.java?rev=629620&view=auto
==============================================================================
--- incubator/nmaven/trunk/components/maven-dotnet-extensions/src/main/java/org/apache/maven/dotnet/extensions/toolchain/DotnetToolchainFactory.java
(added)
+++ incubator/nmaven/trunk/components/maven-dotnet-extensions/src/main/java/org/apache/maven/dotnet/extensions/toolchain/DotnetToolchainFactory.java
Wed Feb 20 13:36:29 2008
@@ -0,0 +1,35 @@
+package org.apache.maven.dotnet.extensions.toolchain;
+
+import org.apache.maven.toolchain.ToolchainFactory;
+import org.apache.maven.toolchain.ToolchainPrivate;
+import org.apache.maven.toolchain.MisconfiguredToolchainException;
+import org.apache.maven.toolchain.model.ToolchainModel;
+import org.codehaus.plexus.logging.LogEnabled;
+import org.codehaus.plexus.logging.Logger;
+
+public final class DotnetToolchainFactory implements ToolchainFactory, LogEnabled
+{
+    private Logger logger;
+
+    public ToolchainPrivate createToolchain( ToolchainModel model )
+        throws MisconfiguredToolchainException
+    {
+        if(model == null)
+        {
+            return null;
+        }
+
+        DotnetToolchain dotnetToolchain = new DotnetToolchain(model, logger);
+        return dotnetToolchain;  
+    }
+
+    public ToolchainPrivate createDefaultToolchain()
+    {
+        return null;
+    }
+
+    public void enableLogging( Logger logger )
+    {
+        this.logger = logger;
+    }
+}

Added: incubator/nmaven/trunk/components/maven-dotnet-extensions/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/maven-dotnet-extensions/src/main/resources/META-INF/plexus/components.xml?rev=629620&view=auto
==============================================================================
--- incubator/nmaven/trunk/components/maven-dotnet-extensions/src/main/resources/META-INF/plexus/components.xml
(added)
+++ incubator/nmaven/trunk/components/maven-dotnet-extensions/src/main/resources/META-INF/plexus/components.xml
Wed Feb 20 13:36:29 2008
@@ -0,0 +1,28 @@
+<!--
+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.
+-->
+
+<component-set>
+  <components>
+    <component>
+      <role>org.apache.maven.toolchain.ToolchainFactory</role>
+      <role-hint>dotnet</role-hint>
+      <implementation>org.apache.maven.dotnet.extensions.toolchain.DotnetToolchainFactory</implementation>
+    </component>
+  </components>
+</component-set>
\ No newline at end of file

Modified: incubator/nmaven/trunk/maven-dotnet.iml
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/maven-dotnet.iml?rev=629620&r1=629619&r2=629620&view=diff
==============================================================================
--- incubator/nmaven/trunk/maven-dotnet.iml (original)
+++ incubator/nmaven/trunk/maven-dotnet.iml Wed Feb 20 13:36:29 2008
@@ -12,6 +12,10 @@
       <sourceFolder url="file://$MODULE_DIR$/components/maven-dotnet-core/src/main/java"
isTestSource="false" />
       <sourceFolder url="file://$MODULE_DIR$/components/maven-dotnet-extensions/src/main/java"
isTestSource="false" />
       <sourceFolder url="file://$MODULE_DIR$/core-integration-tests/src/test/java" isTestSource="true"
/>
+      <sourceFolder url="file://$MODULE_DIR$/imports/maven-toolchain-plugin/src/main/java"
isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/imports/maven-toolchain/src/main/java" isTestSource="false"
/>
+      <sourceFolder url="file://$MODULE_DIR$/imports/maven-toolchain/src/test/java" isTestSource="true"
/>
+      <sourceFolder url="file://$MODULE_DIR$/imports/maven-toolchain/target/generated-sources/modello"
isTestSource="false" />
       <sourceFolder url="file://$MODULE_DIR$/plugins/maven-dotnet-compiler-plugin/src/main/java"
isTestSource="false" />
       <sourceFolder url="file://$MODULE_DIR$/plugins/maven-dotnet-test-plugin/src/main/java"
isTestSource="false" />
     </content>

Modified: incubator/nmaven/trunk/plugins/maven-dotnet-compiler-plugin/pom.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/plugins/maven-dotnet-compiler-plugin/pom.xml?rev=629620&r1=629619&r2=629620&view=diff
==============================================================================
--- incubator/nmaven/trunk/plugins/maven-dotnet-compiler-plugin/pom.xml (original)
+++ incubator/nmaven/trunk/plugins/maven-dotnet-compiler-plugin/pom.xml Wed Feb 20 13:36:29
2008
@@ -50,7 +50,6 @@
       <groupId>org.apache.maven.dotnet</groupId>
       <artifactId>maven-dotnet-extensions</artifactId>
       <version>0.16-incubating-SNAPSHOT</version>
-      <scope>runtime</scope>
     </dependency>
     <dependency>
       <groupId>org.apache.maven</groupId>
@@ -58,6 +57,10 @@
     </dependency>
     <dependency>
       <groupId>org.apache.maven</groupId>
+      <artifactId>maven-core</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
       <artifactId>maven-plugin-api</artifactId>
     </dependency>
     <dependency>
@@ -68,6 +71,11 @@
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-utils</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.apache.maven.shared</groupId>
+      <artifactId>maven-toolchain</artifactId>
+      <version>1.0-SNAPSHOT</version>
+    </dependency>    
   </dependencies>
   <distributionManagement>
     <site>

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=629620&r1=629619&r2=629620&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
Wed Feb 20 13:36:29 2008
@@ -31,7 +31,12 @@
 import org.apache.maven.dotnet.BuildDirectories;
 import org.apache.maven.dotnet.ArtifactType;
 import org.apache.maven.dotnet.InitializationException;
+import org.apache.maven.dotnet.extensions.toolchain.DotnetToolchain;
 import org.apache.maven.project.MavenProject;
+import org.apache.maven.execution.MavenSession;
+import org.apache.maven.toolchain.ToolchainManager;
+import org.apache.maven.toolchain.ToolchainManagerPrivate;
+import org.apache.maven.toolchain.MisconfiguredToolchainException;
 
 import java.io.File;
 import java.io.IOException;
@@ -103,10 +108,27 @@
      */
     private DotnetCompilerContext dotnetCompilerContext;
 
+    /**
+     * @component
+     */
+    private ToolchainManager toolchainManager;
+
+    /**
+     * @parameter expression="${session}"
+     */
+    private MavenSession mavenSession;
+
     public void execute()
         throws MojoExecutionException, MojoFailureException
     {
+        DotnetToolchain dotnetToolchain =
+            (DotnetToolchain) toolchainManager.getToolchainFromBuildContext( "toolchain-dotnet",
mavenSession );
 
+        if ( dotnetToolchain == null )
+        {
+            this.getLog().info( "Could not find dotnet toolchain." );
+        }
+        
         File sourceDir =
             new File( project.getBuild().getDirectory(), BuildDirectories.BUILD_SOURCES.getBuildDirectoryName()
);
 
@@ -130,7 +152,7 @@
         DotnetCompilerConfig compilerConfig = DotnetCompilerConfig.Factory.createDefaultCompilerConfig();
 
         String packaging = project.getPackaging();
-        
+
         // If this is a dotnet type, remove the "dotnet:" portion
         if ( packaging.contains( ":" ) )
         {

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=629620&r1=629619&r2=629620&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
Wed Feb 20 13:36:29 2008
@@ -27,6 +27,9 @@
       </implementation>
       <configuration>
         <phases>
+          <validate>
+            org.apache.maven.plugins:maven-toolchains-plugin:toolchain 
+          </validate>
           <generate-sources>
             org.apache.maven.dotnet.plugins:maven-dotnet-compiler-plugin:generate-assembly-info
           </generate-sources>



Mime
View raw message