commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nia...@apache.org
Subject svn commit: r367303 - in /jakarta/commons/proper/validator/trunk: build.properties.sample maven.xml project.properties xdocs/changes.xml
Date Mon, 09 Jan 2006 14:33:19 GMT
Author: niallp
Date: Mon Jan  9 06:33:05 2006
New Revision: 367303

URL: http://svn.apache.org/viewcvs?rev=367303&view=rev
Log:
Fix for Bug 37580 - Modify build to create compressed JavaScript file using Dojo/Rhino - suggested
by Michael Rush

Modified:
    jakarta/commons/proper/validator/trunk/build.properties.sample
    jakarta/commons/proper/validator/trunk/maven.xml
    jakarta/commons/proper/validator/trunk/project.properties
    jakarta/commons/proper/validator/trunk/xdocs/changes.xml

Modified: jakarta/commons/proper/validator/trunk/build.properties.sample
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/validator/trunk/build.properties.sample?rev=367303&r1=367302&r2=367303&view=diff
==============================================================================
--- jakarta/commons/proper/validator/trunk/build.properties.sample (original)
+++ jakarta/commons/proper/validator/trunk/build.properties.sample Mon Jan  9 06:33:05 2006
@@ -1,4 +1,4 @@
-#   Copyright 2003-2005 The Apache Software Foundation
+#   Copyright 2003-2006 The Apache Software Foundation
 #
 #   Licensed under the Apache License, Version 2.0 (the "License");
 #   you may not use this file except in compliance with the License.
@@ -21,6 +21,14 @@
 # contains the "build.xml" file.
 # -----------------------------------------------------------------------------
 apache.dir=D:/Java/Programs/Apache
+
+# The JAR file containing the Dojo Custom Rhino jar for compressing JavaScript files
+# See Bug 37580 and http://dojotoolkit.org/docs/compressor_system.html
+# 
+# N.B. This jar needs to be downloaded
+dojo_custom_rhino.jar=/dojo-0.1.0/custom_rhino.jar
+
+
 # The JAR file containing version 1.7.0 (or later) of the Beanutils package
 # from the Jakarta Commons project.
 commons-beanutils.jar=../beanutils/dist/commons-beanutils.jar

Modified: jakarta/commons/proper/validator/trunk/maven.xml
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/validator/trunk/maven.xml?rev=367303&r1=367302&r2=367303&view=diff
==============================================================================
--- jakarta/commons/proper/validator/trunk/maven.xml (original)
+++ jakarta/commons/proper/validator/trunk/maven.xml Mon Jan  9 06:33:05 2006
@@ -1,5 +1,5 @@
 <!--
-   Copyright 2003-2005 The Apache Software Foundation
+   Copyright 2003-2006 The Apache Software Foundation
 
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
@@ -15,7 +15,9 @@
 -->
 
 <project default="java:jar"
-  xmlns:ant="jelly:ant">
+  xmlns:ant="jelly:ant"
+  xmlns:j="jelly:core"
+  xmlns:util="jelly:util">
 
   <!-- ================================================================== -->
   <!-- START : C O M M O N S - B U I L D                                  -->
@@ -54,6 +56,9 @@
       <fileset dir="src/javascript"
           includes="**/*.js"/>
     </copy>
+ 
+    <!-- Use Dojo/Rhino to create compressed JavaScript files -->
+    <attainGoal name="dojo.compress.files"/>
 
   </postGoal>
 
@@ -67,8 +72,41 @@
       <fileset file='${basedir}/NOTICE.txt'/>
     </copy>
 
+    <!-- Create Single file of static JavaScript -->
+    <ant:concat destfile="${maven.dist.bin.assembly.dir}/${pom.artifactId}-${pom.currentVersion}.js">
+      <fileset dir="${basedir}/src/javascript/org/apache/commons/validator/javascript"
includes="*.js"/>
+    </ant:concat>
+
+    <!-- Use Dojo/Rhino to create single compressed JavaScript file -->
+    <attainGoal name="dojo.compress.single"/>
+
   </postGoal>
 
+  <!-- ================================================================== -->
+  <!-- Uses Dojo/Rhino to created compressed JavaScript files             -->
+  <!-- 1) Download Dojo/Rhino jar from:                                   -->
+  <!--         http://dojotoolkit.org/docs/compressor_system.html         -->
+  <!-- 2) set dojo_custom_rhino.jar in build.properties to jar location   -->
+  <!-- ================================================================== -->
+  <goal name="dojo.compress.single">
+    <ant:java jar="${dojo_custom_rhino.jar}" fork="true"
+              output="${maven.dist.bin.assembly.dir}/${pom.artifactId}-${pom.currentVersion}-compress.js">
+        <ant:arg value="-c"/> 
+        <ant:arg value="${maven.dist.bin.assembly.dir}/${pom.artifactId}-${pom.currentVersion}.js"/>

+    </ant:java>
+  </goal>
+
+  <goal name="dojo.compress.files">
+    <j:set var="scriptDir" value="${maven.build.dir}/classes/org/apache/commons/validator/javascript"
/>
+    <util:tokenize var="scriptFiles" delim=",">${validator.script.files}</util:tokenize>
+    <j:forEach items="${scriptFiles}" var="scriptFile">
+        <ant:java jar="${dojo_custom_rhino.jar}" fork="true"
+              output="${scriptDir}/${scriptFile}-compress.js">
+            <ant:arg value="-c"/> 
+            <ant:arg value="${scriptDir}/${scriptFile}.js"/> 
+        </ant:java>
+    </j:forEach> 
+  </goal>
 
   <!-- ================================================================== -->
   <!-- Copy into the source distribution                                  -->

Modified: jakarta/commons/proper/validator/trunk/project.properties
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/validator/trunk/project.properties?rev=367303&r1=367302&r2=367303&view=diff
==============================================================================
--- jakarta/commons/proper/validator/trunk/project.properties (original)
+++ jakarta/commons/proper/validator/trunk/project.properties Mon Jan  9 06:33:05 2006
@@ -23,6 +23,23 @@
 
 maven.checkstyle.properties = conf/share/ValidatorCheckStyle.xml
 
+# JavaScript file names - used in maven.xml to generate
+# the compressed versions using dojo/rhino
+validator.script.files = validateByte,\
+                         validateCreditCard,\
+                         validateDate,\
+                         validateEmail,\
+                         validateFloat,\
+                         validateFloatRange,\
+                         validateInteger,\
+                         validateIntRange,\
+                         validateMask,\
+                         validateMaxLength,\
+                         validateMinLength,\
+                         validateRequired,\
+                         validateShort,\
+                         validateUtilities
+
 # Keep ant and maven directories seperate.
 maven.build.dir=m-target
 maven.compile.source=1.3

Modified: jakarta/commons/proper/validator/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/validator/trunk/xdocs/changes.xml?rev=367303&r1=367302&r2=367303&view=diff
==============================================================================
--- jakarta/commons/proper/validator/trunk/xdocs/changes.xml (original)
+++ jakarta/commons/proper/validator/trunk/xdocs/changes.xml Mon Jan  9 06:33:05 2006
@@ -39,6 +39,12 @@
   <body>
 
     <release version="1.2.1 (alpha)" date="in SVN">
+      <action dev="niallp" type="add" issue="37580" due-to="Michael Rush">
+         Use the Dojo/Rhino JavaScript compressor to created compressed
+         versions of the static JavaScript files. Additionally create single
+         file distros of all the static JavaScript in un-compressed and compressed
+         format. See http://dojotoolkit.org/docs/compressor_system.html.
+      </action>
       <action dev="niallp" type="fix">
          Prefix remaining JavaScript utility methods with "jcv_" to reduce 
          the likelihood of clashes with other libraries - validator still



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message