incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mat...@apache.org
Subject svn commit: r452923 - /incubator/adffaces/trunk/plugins/maven-javascript-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/javascript/ObfuscateJavascriptMojo.java
Date Wed, 04 Oct 2006 16:14:43 GMT
Author: matzew
Date: Wed Oct  4 09:14:41 2006
New Revision: 452923

URL: http://svn.apache.org/viewvc?view=rev&rev=452923
Log:
JavaScript Obfuscator plugin supports multiple input paths (see ADFFACES-212). thx to Mike
Elges for the patch.

Modified:
    incubator/adffaces/trunk/plugins/maven-javascript-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/javascript/ObfuscateJavascriptMojo.java

Modified: incubator/adffaces/trunk/plugins/maven-javascript-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/javascript/ObfuscateJavascriptMojo.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/plugins/maven-javascript-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/javascript/ObfuscateJavascriptMojo.java?view=diff&rev=452923&r1=452922&r2=452923
==============================================================================
--- incubator/adffaces/trunk/plugins/maven-javascript-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/javascript/ObfuscateJavascriptMojo.java
(original)
+++ incubator/adffaces/trunk/plugins/maven-javascript-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/javascript/ObfuscateJavascriptMojo.java
Wed Oct  4 09:14:41 2006
@@ -28,8 +28,8 @@
 //~--- JDK imports ------------------------------------------------------------
 
 import java.io.File;
+
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 
 
@@ -51,33 +51,32 @@
   public void execute()
     throws MojoExecutionException
   {
-    List compileSourceRoots = new ArrayList();
-    compileSourceRoots.add(sourceDirectory);
+// List compileSourceRoots = new ArrayList();
+// compileSourceRoots.add(sourceDirectory);
 
     try
     {
-      _obfuscator =
-        new Obfuscator(obfuscate, stripComments, stripWhitespaces,
-                       stripNewlines, stripSpecialKeywords, replaceCharLiterals,
-                       obfuscatorConfig);
+      _obfuscator = 
+          new Obfuscator(obfuscate, stripComments, stripWhitespaces, 
+                         stripNewlines, stripSpecialKeywords, 
+                         replaceCharLiterals, obfuscatorConfig);
 
-      File outputDirectory = new File(targetDirectory, targetPath);
+//      File outputDirectory = new File(targetDirectory, targetPath);
 
-      outputDirectory.mkdirs();
+      targetDirectory.mkdirs();
 
-      for (Iterator i = compileSourceRoots.iterator(); i.hasNext(); )
+      for (File sourceRoot: sourceDirectory)
       {
-        File sourceRoot = (File) i.next();
-        File sourceDirectory = new File(sourceRoot, sourcePath);
-        if (sourceDirectory.exists())
+//        File sourceDirectory = new File(sourceRoot, sourcePath);
+        if (sourceRoot.exists())
         {
-          _obfuscator.process(sourceDirectory, outputDirectory);
+          _obfuscator.process(sourceRoot, targetDirectory);
         }
       }
     }
     catch (ConfigException e)
     {
-      throw new MojoExecutionException("Invalid configuration parameters",
+      throw new MojoExecutionException("Invalid configuration parameters", 
                                        e);
     }
   }
@@ -121,16 +120,11 @@
   private boolean stripWhitespaces = false;
 
   /**
-   * @parameter expression="src/main/javascript"
+   * @parameter 
    * @required
    */
-  private File sourceDirectory;
+  private File[] sourceDirectory;
 
-  /**
-   * @parameter
-   * @required
-   */
-  private String sourcePath;
 
   /**
    * @parameter expression="${project.build.directory}/classes"
@@ -142,12 +136,6 @@
    * @parameter
    * @required
    */
-  private String targetPath;
-
- /**
-  * @parameter
-  * @required
-  */
   private ObfuscatorConfig obfuscatorConfig;
 }
 



Mime
View raw message