incubator-nmaven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sisb...@apache.org
Subject svn commit: r540833 - in /incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable: ./ compiler/impl/ impl/
Date Wed, 23 May 2007 04:04:16 GMT
Author: sisbell
Date: Tue May 22 21:04:15 2007
New Revision: 540833

URL: http://svn.apache.org/viewvc?view=rev&rev=540833
Log:
Added reset command for the netexecutable interface. Need this so that I can match an executable/compiler
and reuse it with different commands. This 1) more efficient; 2) less burden on the plugin
developer.

Modified:
    incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/NetExecutable.java
    incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/BaseCompiler.java
    incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/CSharpCompilerForProfile.java
    incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/DefaultCompiler.java
    incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/DotGNUCompiler.java
    incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/NemerleCompiler.java
    incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/PhpCompiler.java
    incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/RubyCompiler.java
    incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/DefaultNetExecutable.java
    incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/DefaultRepositoryNetExecutable.java
    incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/ThreadedNetExecutable.java

Modified: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/NetExecutable.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/NetExecutable.java?view=diff&rev=540833&r1=540832&r2=540833
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/NetExecutable.java
(original)
+++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/NetExecutable.java
Tue May 22 21:04:15 2007
@@ -34,14 +34,21 @@
 {
 
     /**
-     * Returns the commands that this compiler will use to compile the application. This
is not a live list and any changes
-     * in it, will not be used by the compiler.
+     * Returns the commands that this compiler will use to compile the application. This
list is unmodifiable.
      *
      * @return the commands that this compiler will use to compile the application
      * @throws ExecutionException
      */
     List<String> getCommands()
         throws ExecutionException;
+
+    /**
+     * Resets the commands to be used by the executable. This should only be used if the
executable is being reused with
+     * different commands from the one that it was initialized with.
+     *
+     * @param commands
+     */
+    void resetCommands(List<String> commands);
 
     /**
      * Compiles class files.

Modified: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/BaseCompiler.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/BaseCompiler.java?view=diff&rev=540833&r1=540832&r2=540833
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/BaseCompiler.java
(original)
+++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/BaseCompiler.java
Tue May 22 21:04:15 2007
@@ -63,13 +63,7 @@
     public File getCompiledArtifact()
         throws InvalidArtifactException
     {
-        File file = compilerContext.getArtifact();
-  //      if ( !file.exists() )
-  //      {
-  //          throw new InvalidArtifactException(
-  //              "NMAVEN-068-004: Artifact does not exist: Artifact = " + file.getAbsolutePath()
);
-  //      }
-        return file;
+        return compilerContext.getArtifact();
     }
 
     /**

Modified: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/CSharpCompilerForProfile.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/CSharpCompilerForProfile.java?view=diff&rev=540833&r1=540832&r2=540833
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/CSharpCompilerForProfile.java
(original)
+++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/CSharpCompilerForProfile.java
Tue May 22 21:04:15 2007
@@ -68,6 +68,11 @@
         return commands;
     }
 
+    public void resetCommands( List<String> commands )
+    {
+        
+    }
+
     public void init( NMavenContext nmavenContext )
     {
         super.init( nmavenContext);

Modified: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/DefaultCompiler.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/DefaultCompiler.java?view=diff&rev=540833&r1=540832&r2=540833
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/DefaultCompiler.java
(original)
+++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/DefaultCompiler.java
Tue May 22 21:04:15 2007
@@ -149,4 +149,9 @@
         CommandFilter filter = compilerContext.getCommandFilter();
         return filter.filter( commands );
     }
+
+    public void resetCommands( List<String> commands )
+    {
+        
+    }
 }

Modified: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/DotGNUCompiler.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/DotGNUCompiler.java?view=diff&rev=540833&r1=540832&r2=540833
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/DotGNUCompiler.java
(original)
+++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/DotGNUCompiler.java
Tue May 22 21:04:15 2007
@@ -94,4 +94,9 @@
         //TODO: Apply command filter
         return commands;
     }
+
+    public void resetCommands( List<String> commands )
+    {
+        
+    }
 }

Modified: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/NemerleCompiler.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/NemerleCompiler.java?view=diff&rev=540833&r1=540832&r2=540833
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/NemerleCompiler.java
(original)
+++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/NemerleCompiler.java
Tue May 22 21:04:15 2007
@@ -83,4 +83,9 @@
         commands.addAll( config.getCommands() );
         return commands;
     }
+
+    public void resetCommands( List<String> commands )
+    {
+        
+    }
 }

Modified: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/PhpCompiler.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/PhpCompiler.java?view=diff&rev=540833&r1=540832&r2=540833
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/PhpCompiler.java
(original)
+++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/PhpCompiler.java
Tue May 22 21:04:15 2007
@@ -69,4 +69,9 @@
         }
         return commands;
     }
+
+    public void resetCommands( List<String> commands )
+    {
+        
+    }
 }

Modified: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/RubyCompiler.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/RubyCompiler.java?view=diff&rev=540833&r1=540832&r2=540833
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/RubyCompiler.java
(original)
+++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/RubyCompiler.java
Tue May 22 21:04:15 2007
@@ -66,9 +66,11 @@
                 commands.add( command );
             }
         }
-        // commands.add("-Cdirectory");
-        // commands.add();
-        //commands.addAll( config.getCommands() );
         return commands;
+    }
+
+    public void resetCommands( List<String> commands )
+    {
+        
     }
 }

Modified: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/DefaultNetExecutable.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/DefaultNetExecutable.java?view=diff&rev=540833&r1=540832&r2=540833
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/DefaultNetExecutable.java
(original)
+++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/DefaultNetExecutable.java
Tue May 22 21:04:15 2007
@@ -25,6 +25,8 @@
 import org.codehaus.plexus.logging.Logger;
 
 import java.util.List;
+import java.util.Collections;
+import java.util.ArrayList;
 import java.io.File;
 
 /**
@@ -43,11 +45,19 @@
      */
     private Logger logger;
 
+    private List<String> commands;
+
     public List<String> getCommands()
         throws ExecutionException
     {
         CommandFilter filter = executableContext.getCommandFilter();
-        return filter.filter( executableContext.getExecutableConfig().getCommands() );
+        return Collections.unmodifiableList(filter.filter( commands ));
+    }
+
+    public void resetCommands(List<String> commands)
+    {
+        this.commands = new ArrayList<String>();
+        this.commands.addAll(commands);//TODO: should be unmodifiable here: fail on filter?
     }
 
     public File getExecutionPath()
@@ -118,5 +128,6 @@
     {
         this.executableContext = (ExecutableContext) nmavenContext;
         this.logger = executableContext.getLogger();
+        commands = executableContext.getExecutableConfig().getCommands();
     }
 }

Modified: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/DefaultRepositoryNetExecutable.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/DefaultRepositoryNetExecutable.java?view=diff&rev=540833&r1=540832&r2=540833
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/DefaultRepositoryNetExecutable.java
(original)
+++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/DefaultRepositoryNetExecutable.java
Tue May 22 21:04:15 2007
@@ -26,6 +26,8 @@
 import org.codehaus.plexus.logging.Logger;
 
 import java.util.List;
+import java.util.Collections;
+import java.util.ArrayList;
 import java.io.File;
 
 /**
@@ -42,10 +44,19 @@
      */
     private Logger logger;
 
+    private List<String> commands;
+
     public List<String> getCommands()
         throws ExecutionException
     {
-        return executableContext.getExecutableConfig().getCommands();
+        return commands;
+    }
+
+    public void resetCommands( List<String> commands )
+    {
+        List<String> tmp = new ArrayList<String>();
+        tmp.addAll(commands);
+        this.commands = Collections.unmodifiableList( tmp );
     }
 
     public File getExecutionPath()
@@ -109,7 +120,7 @@
             for ( String executablePath : executablePaths )
             {
                 File exe = new File( executablePath );
-                logger.debug("NMAVEN-063-004: Checking executable path = " + exe.getAbsolutePath());
+                logger.debug( "NMAVEN-063-004: Checking executable path = " + exe.getAbsolutePath()
);
                 if ( exe.exists() )
                 {
                     return new File( executablePath ).getName();
@@ -139,5 +150,6 @@
     {
         this.executableContext = (RepositoryExecutableContext) nmavenContext;
         this.logger = executableContext.getLogger();
+        commands = Collections.unmodifiableList( executableContext.getExecutableConfig().getCommands()
);
     }
 }

Modified: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/ThreadedNetExecutable.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/ThreadedNetExecutable.java?view=diff&rev=540833&r1=540832&r2=540833
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/ThreadedNetExecutable.java
(original)
+++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/ThreadedNetExecutable.java
Tue May 22 21:04:15 2007
@@ -71,6 +71,12 @@
         return filter.filter( executableContext.getExecutableConfig().getCommands() );
     }
 
+    public void resetCommands( List<String> commands )
+    {
+
+    }
+
+
     public File getExecutionPath()
     {
         String executable;



Mime
View raw message