changeset 1683:2d62e4960c40

RT-23525 : iOS CSS Loading is parsing the CSS file
author mickf
date Thu, 23 Aug 2012 19:01:57 +0100
parents 141474e431c7
children 6870d35ffbf5
files javafx-ui-controls/build-common.xml
diffstat 1 files changed, 31 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-controls/build-common.xml	Wed Aug 22 16:18:29 2012 -0700
+++ b/javafx-ui-controls/build-common.xml	Thu Aug 23 19:01:57 2012 +0100
@@ -6,25 +6,38 @@
         <uptodate property="binaryCssUpToDate" targetfile="${build.dir}/classes/com/sun/javafx/scene/control/skin/caspian/caspian.bss">
             <srcfiles dir="${src.dir}/com/sun/javafx/scene/control/skin/caspian" includes="caspian.css"/>
         </uptodate>
-    </target> 
+    </target>
 
-    <target name="-pre-init" depends="check-binary-css" unless="binaryCssUpToDate">
+    <target name="-pre-init" depends="check-binary-css, compile-java-css" unless="binaryCssUpToDate">
         <mkdir dir="${build.dir}/classes/com/sun/javafx/scene/control/skin/caspian"/>
-        <java classname="com.sun.javafx.css.parser.Css2Bin" fork="true" failonerror="true">
-          <jvmarg value="-Djavafx.toolkit=com.sun.javafx.tk.DummyToolkit"/>
-          <classpath> 
-            <pathelement location="${rt.dist.root.dir}/javafx-ui-common/dist/javafx-ui-common.jar"/>
-            <pathelement location="${runtime.dist.root.dir}/javafx-beans/dist/javafx-beans.jar"/>
-            <pathelement location="${runtime.dist.root.dir}/javafx-anim/dist/javafx-anim.jar"/>
-            <pathelement location="${runtime.dist.root.dir}/javafx-common/dist/javafx-common.jar"/>
-            <pathelement location="${runtime.dist.root.dir}/javafx-logging/dist/javafx-logging.jar"/>
-            <pathelement location="${JFXRT_HOME}/jfxrt.jar"/>
-          </classpath> 
-          <arg value="${src.dir}/com/sun/javafx/scene/control/skin/caspian/caspian.css"/>
-          <arg value="${build.dir}/classes/com/sun/javafx/scene/control/skin/caspian/caspian.bss"/>
-        </java>
+
+        <!-- copy all .css files in the caspian dir to the build dir -->
+        <copy todir="${build.dir}/classes/com/sun/javafx/scene/control/skin/caspian">
+          <fileset dir="${src.dir}/com/sun/javafx/scene/control/skin/caspian" includes="*.css"/>
+        </copy>
+
+        <!-- compile all .css files in the build dir to .bss files, for faster startup -->
+        <for param="cssFile">
+          <path>
+            <fileset dir="${build.dir}/classes/com/sun/javafx/scene/control/skin/caspian" includes="**/*.css"/>
+          </path>
+          <sequential>
+            <java classname="com.sun.javafx.css.parser.Css2Bin" fork="true" failonerror="true">
+              <jvmarg value="-Djavafx.toolkit=com.sun.javafx.tk.DummyToolkit"/>
+              <classpath> 
+                <pathelement location="${rt.dist.root.dir}/javafx-ui-common/dist/javafx-ui-common.jar"/>
+                <pathelement location="${runtime.dist.root.dir}/javafx-beans/dist/javafx-beans.jar"/>
+                <pathelement location="${runtime.dist.root.dir}/javafx-anim/dist/javafx-anim.jar"/>
+                <pathelement location="${runtime.dist.root.dir}/javafx-common/dist/javafx-common.jar"/>
+                <pathelement location="${runtime.dist.root.dir}/javafx-logging/dist/javafx-logging.jar"/>
+                <pathelement location="${JFXRT_HOME}/jfxrt.jar"/>
+              </classpath> 
+              <arg value="@{cssFile}"/>
+            </java>
+          </sequential>
+        </for>
     </target>
-    
+
     <!-- .css -> .java -->
     <target name="check-java-css">
         <uptodate property="javaCssUpToDate" targetfile="${build.dir}/classes/com/sun/javafx/scene/control/skin/caspian/caspian.java">
@@ -32,7 +45,7 @@
         </uptodate>
     </target> 
     
-    <target name="-pre-init" depends="check-java-css" unless="javaCssUpToDate">
+    <target name="compile-java-css" depends="check-java-css" unless="javaCssUpToDate">
         <mkdir dir="${build.dir}/classes/com/sun/javafx/scene/control/skin/caspian"/>
         <java classname="com.sun.javafx.css.parser.Css2Java" fork="true" failonerror="true">
           <jvmarg value="-Djavafx.toolkit=com.sun.javafx.tk.DummyToolkit"/>
@@ -49,7 +62,7 @@
           <arg value="${build.dir}/classes/com/sun/javafx/scene/control/skin/caspian/Caspian.java"/>
         </java>
     </target>
-    
+
     <!-- misc -->
     <target name="debug-test-file" depends="jar">
         <echo message="${run.test.classpath}" />