incubator-nmaven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sisb...@apache.org
Subject svn commit: r518030 - in /incubator/nmaven/branches/SI_IDE/components/dotnet-assembler: ./ src/main/java/org/apache/maven/dotnet/assembler/ src/main/java/org/apache/maven/dotnet/assembler/impl/
Date Wed, 14 Mar 2007 06:08:06 GMT
Author: sisbell
Date: Tue Mar 13 23:08:03 2007
New Revision: 518030

URL: http://svn.apache.org/viewvc?view=rev&rev=518030
Log:
 Added support for getting the extension of a language from the context. This is needed because
some plugins need know the language extension to know what to copy from the source directory
into the build directory (this in turn is related the project structure necessary for IDE).

Modified:
    incubator/nmaven/branches/SI_IDE/components/dotnet-assembler/pom.xml
    incubator/nmaven/branches/SI_IDE/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/AssemblerContext.java
    incubator/nmaven/branches/SI_IDE/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/impl/AssemblerContextImpl.java
    incubator/nmaven/branches/SI_IDE/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/impl/AssemblyPluginsRepository.java
    incubator/nmaven/branches/SI_IDE/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/impl/JavaAssemblyInfoMarshaller.java
    incubator/nmaven/branches/SI_IDE/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/impl/VBAssemblyInfoMarshaller.java

Modified: incubator/nmaven/branches/SI_IDE/components/dotnet-assembler/pom.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/components/dotnet-assembler/pom.xml?view=diff&rev=518030&r1=518029&r2=518030
==============================================================================
--- incubator/nmaven/branches/SI_IDE/components/dotnet-assembler/pom.xml (original)
+++ incubator/nmaven/branches/SI_IDE/components/dotnet-assembler/pom.xml Tue Mar 13 23:08:03
2007
@@ -1,57 +1,43 @@
-<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">
-    <parent>
-        <groupId>org.apache.maven.dotnet</groupId>
-        <version>0.14-SNAPSHOT</version>
-        <artifactId>dotnet-components</artifactId>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
+<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">
+  <parent>
     <groupId>org.apache.maven.dotnet</groupId>
-    <artifactId>dotnet-assembler</artifactId>
     <version>0.14-SNAPSHOT</version>
-    <name>dotnet-assembler</name>
-    <description>
-        NMaven
-    </description>
-
-    <dependencies>
-        
-        <dependency>
-            <groupId>org.apache.maven</groupId>
-            <artifactId>maven-plugin-api</artifactId>
-            <version>2.0.4</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.maven</groupId>
-            <artifactId>maven-project</artifactId>
-            <version>2.0.4</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.maven.dotnet</groupId>
-            <artifactId>dotnet-model-assembly-plugins</artifactId>
-            <version>0.14-SNAPSHOT</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.maven.dotnet</groupId>
-            <artifactId>dotnet-artifact</artifactId>
-            <version>0.14-SNAPSHOT</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.maven.dotnet</groupId>
-            <artifactId>dotnet-core</artifactId>
-            <version>0.14-SNAPSHOT</version>
-        </dependency>
-    </dependencies>
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <configuration>
-                    <source>1.5</source>
-                    <target>1.5</target>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
+    <artifactId>dotnet-components</artifactId>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.dotnet</groupId>
+  <artifactId>dotnet-assembler</artifactId>
+  <version>0.14-SNAPSHOT</version>
+  <name>dotnet-assembler</name>
+  <description>
+    NMaven
+  </description>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-plugin-api</artifactId>
+      <version>2.0.4</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-project</artifactId>
+      <version>2.0.4</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.dotnet</groupId>
+      <artifactId>dotnet-model-assembly-plugins</artifactId>
+      <version>0.14-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.dotnet</groupId>
+      <artifactId>dotnet-artifact</artifactId>
+      <version>0.14-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.dotnet</groupId>
+      <artifactId>dotnet-core</artifactId>
+      <version>0.14-SNAPSHOT</version>
+    </dependency>
+  </dependencies>
 </project>

Modified: incubator/nmaven/branches/SI_IDE/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/AssemblerContext.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/AssemblerContext.java?view=diff&rev=518030&r1=518029&r2=518030
==============================================================================
--- incubator/nmaven/branches/SI_IDE/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/AssemblerContext.java
(original)
+++ incubator/nmaven/branches/SI_IDE/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/AssemblerContext.java
Tue Mar 13 23:08:03 2007
@@ -19,6 +19,7 @@
 package org.apache.maven.dotnet.assembler;
 
 import org.apache.maven.dotnet.InitializationException;
+import org.apache.maven.dotnet.PlatformUnsupportedException;
 import org.apache.maven.project.MavenProject;
 
 /**
@@ -50,6 +51,15 @@
      */
     AssemblyInfoMarshaller getAssemblyInfoMarshallerFor( String language )
         throws AssemblyInfoException;
+
+    /**
+     * Returns the class extension (cs, vb) for the specified language.
+     *
+     * @param language the class language. Must match language within the assembly-plugins.xml
file.
+     * @return the class extension (cs, vb) for the specified language.
+     * @throws PlatformUnsupportedException the language is not supported
+     */
+    String getClassExtensionFor(String language) throws PlatformUnsupportedException;
 
     /**
      * Initializes the context

Modified: incubator/nmaven/branches/SI_IDE/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/impl/AssemblerContextImpl.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/impl/AssemblerContextImpl.java?view=diff&rev=518030&r1=518029&r2=518030
==============================================================================
--- incubator/nmaven/branches/SI_IDE/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/impl/AssemblerContextImpl.java
(original)
+++ incubator/nmaven/branches/SI_IDE/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/impl/AssemblerContextImpl.java
Tue Mar 13 23:08:03 2007
@@ -23,6 +23,7 @@
 import org.apache.maven.dotnet.assembler.AssemblyInfoMarshaller;
 import org.apache.maven.dotnet.assembler.AssemblyInfoException;
 import org.apache.maven.dotnet.InitializationException;
+import org.apache.maven.dotnet.PlatformUnsupportedException;
 import org.apache.maven.dotnet.model.assembly.plugins.AssemblyPlugin;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.model.Organization;
@@ -161,6 +162,21 @@
         }
 
         return marshaller;
+    }
+
+    /**
+     * @see AssemblerContext#getClassExtensionFor(String)
+     */
+    public String getClassExtensionFor(String language) throws PlatformUnsupportedException
+    {
+        try
+        {
+            return repository.getAssemblyPluginFor( language ).getExtension();
+        }
+        catch ( AssemblyInfoException e )
+        {
+            throw new PlatformUnsupportedException("NMAVEN-020-006: Language not supported:
Language = " + language, e);
+        }
     }
 
     /**

Modified: incubator/nmaven/branches/SI_IDE/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/impl/AssemblyPluginsRepository.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/impl/AssemblyPluginsRepository.java?view=diff&rev=518030&r1=518029&r2=518030
==============================================================================
--- incubator/nmaven/branches/SI_IDE/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/impl/AssemblyPluginsRepository.java
(original)
+++ incubator/nmaven/branches/SI_IDE/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/impl/AssemblyPluginsRepository.java
Tue Mar 13 23:08:03 2007
@@ -38,7 +38,7 @@
  *
  * @author Shane Isbell
  */
-public class AssemblyPluginsRepository
+public final class AssemblyPluginsRepository
     implements Repository
 {
 
@@ -87,6 +87,9 @@
         }
     }
 
+    /**
+     * @see Repository#setRepositoryRegistry(org.apache.maven.dotnet.registry.RepositoryRegistry)
+     */
     public void setRepositoryRegistry( RepositoryRegistry repositoryRegistry )
     {
     }
@@ -106,7 +109,7 @@
      * Returns an assembly plugin for the specified programming language.
      *
      * @param language the programming language to use for matching an assembly plugin
-     * @return assembly plugin for the specified programming language
+     * @return assembly plugin for the specified programming language. May not be null.
      * @throws AssemblyInfoException if there is no plugin for the specified language
      */
     public AssemblyPlugin getAssemblyPluginFor( String language )

Modified: incubator/nmaven/branches/SI_IDE/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/impl/JavaAssemblyInfoMarshaller.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/impl/JavaAssemblyInfoMarshaller.java?view=diff&rev=518030&r1=518029&r2=518030
==============================================================================
--- incubator/nmaven/branches/SI_IDE/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/impl/JavaAssemblyInfoMarshaller.java
(original)
+++ incubator/nmaven/branches/SI_IDE/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/impl/JavaAssemblyInfoMarshaller.java
Tue Mar 13 23:08:03 2007
@@ -67,9 +67,11 @@
         FileOutputStream man = null;
         try
         {
-            File file = new File( src + "/META-INF/net/sf/nmaven" );
+            String groupIdAsDir = mavenProject.getGroupId().replace( ".", File.separator
);
+            File file = new File( src + "/META-INF/" + groupIdAsDir );
             file.mkdirs();
-            man = new FileOutputStream( src + "/META-INF/net/sf/nmaven/AssemblyInfo." + plugin.getExtension()
);
+            man = new FileOutputStream(
+                src + "/META-INF/" + groupIdAsDir + File.separator + "AssemblyInfo." + plugin.getExtension()
);
             man.write( sb.toString().getBytes() );
         }
         catch ( IOException e )

Modified: incubator/nmaven/branches/SI_IDE/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/impl/VBAssemblyInfoMarshaller.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/impl/VBAssemblyInfoMarshaller.java?view=diff&rev=518030&r1=518029&r2=518030
==============================================================================
--- incubator/nmaven/branches/SI_IDE/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/impl/VBAssemblyInfoMarshaller.java
(original)
+++ incubator/nmaven/branches/SI_IDE/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/impl/VBAssemblyInfoMarshaller.java
Tue Mar 13 23:08:03 2007
@@ -68,9 +68,11 @@
         FileOutputStream man = null;
         try
         {
-            File file = new File( src + "/META-INF/net/sf/nmaven" );
+            String groupIdAsDir = mavenProject.getGroupId().replace( ".", File.separator
);
+            File file = new File( src + "/META-INF/" + groupIdAsDir );
             file.mkdirs();
-            man = new FileOutputStream( src + "/META-INF/net/sf/nmaven/AssemblyInfo." + plugin.getExtension()
);
+            man = new FileOutputStream(
+                src + "/META-INF/" + groupIdAsDir + File.separator + "AssemblyInfo." + plugin.getExtension()
);
             man.write( sb.toString().getBytes() );
         }
         catch ( IOException e )



Mime
View raw message