Source

webwork / build.xml

Diff from to

build.xml

     <property name="build.java-test" value="${build}/java-test"/>
     <property name="build.java" value="${build}/java"/>
     <property name="build.example" value="${build}/example"/>
+    <property name="build.example.jars" value="${build}/example-jars"/>
     <property name="build.example-war" value="${build}/example-war"/>
+    <property name="build.example.client.jar" value="${build}/example-client.jar"/>
     <property name="build.config-browser" value="${build}/config-browser"/>
     <property name="build.config-browser.jar" value="${build}/webwork-config-browser.jar"/>
     <property name="build.migration" value="${build}/migration"/>
     <property name="build.dist" value="${build}/dist"/>
     <property name="build.webwork.tld" value="${src.webapp}/WEB-INF/webwork.tld"/>
 
+    <property name="demo.keystore.password" value="webwork"/>
+    <property name="demo.keystore" value="${src.etc}/security/demoKeystore"/>
+
     <property name="docs" value="docs"/>
 
     <target name="clean">
         <jar basedir="${build.migration}" jarfile="${build.migration.jar}"/>
     </target>
 
-    <target name="example-war" depends="java, jar, config-browser">
+    <target name="example-jar" depends="java, jar, config-browser">
         <mkdir dir="${build.example}"/>
         <javac srcdir="${src.example}" destdir="${build.example}" classpath="${build.java}" classpathref="cp" debug="on"/>
         <copy filtering="no" todir="${build.example}">
 
         <copy file="${src.etc}/taglib.tld" tofile="${build}/webwork.tld"/>
 
+        <jar basedir="${build.example}" jarfile="${build.example.client.jar}">
+                <include name="**/client/**"/>
+                <include name="**/log4j.properties"/>
+        </jar>
+
+        <jar basedir="${src.etc}/example/client" jarfile="${build.example.client.jar}" update="true">
+                <include name="*.xml"/>
+        </jar>
+    </target>
+
+    <target name="signjar" depends="example-jar">
+        <!-- Copy the jars for the client before signing them - we don't want the server jars signed -->
+        <mkdir dir="${build.example.jars}"/>
+        <copy todir="${build.example.jars}">
+            <fileset dir="${lib.core}">
+                <include name="cglib-full-2.0.2.jar"/>
+                <include name="commons-logging.jar"/>
+                <include name="ognl.jar"/>
+                <include name="oscore.jar"/>
+                <include name="xwork.jar"/>
+            </fileset>
+            <fileset file="${build}/${name}-${version}.jar"/>
+            <fileset file="${build.example.client.jar}"/>
+            <fileset file="${lib.build}/servlet.jar"/>
+            <fileset dir="${lib.optional}">
+                <include name="object-dispatcher.jar"/>
+                <include name="commons-digester.jar"/>
+                <include name="commons-collections.jar"/>
+                <include name="commons-beanutils.jar"/>
+                <include name="log4j-1.2.8.jar"/>
+            </fileset>
+        </copy>
+        <signjar
+           keystore="${demo.keystore}" alias="demo"
+              storepass="${demo.keystore.password}"
+           verbose="false"
+        >
+            <fileset dir="${build.example.jars}">
+                <include name="cglib-full-2.0.2.jar"/>
+                <include name="commons-logging.jar"/>
+                <include name="commons-digester.jar"/>
+                <include name="commons-collections.jar"/>
+                <include name="commons-beanutils.jar"/>
+                <include name="ognl.jar"/>
+                <include name="oscore.jar"/>
+                <include name="xwork.jar"/>
+                <include name="${name}-${version}.jar"/>
+                <include name="example-client.jar"/>
+                <include name="servlet.jar"/>
+                <include name="object-dispatcher.jar"/>
+                <include name="log4j-1.2.8.jar"/>
+            </fileset>
+        </signjar>
+    </target>
+
+    <target name="example-war" depends="signjar">
+
         <war destfile="${build}/${name}-example.war" webxml="${src.webapp}/WEB-INF/web.xml">
             <fileset dir="${src.webapp}">
                 <exclude name="**/web.xml"/>
             </fileset>
+            <fileset dir="${build.example.jars}">
+                <include name="cglib-full-2.0.2.jar"/>
+                <include name="commons-logging.jar"/>
+                <include name="commons-digester.jar"/>
+                <include name="commons-collections.jar"/>
+                <include name="commons-beanutils.jar"/>
+                <include name="ognl.jar"/>
+                <include name="oscore.jar"/>
+                <include name="xwork.jar"/>
+                <include name="${name}-${version}.jar"/>
+                <include name="example-client.jar"/>
+                <include name="servlet.jar"/>
+                <include name="object-dispatcher.jar"/>
+                <include name="log4j-1.2.8.jar"/>
+            </fileset>
             <lib dir="${lib.core}"/>
             <lib dir="${lib.optional}"/>
             <lib dir="${lib.example}"/>
             <lib file="${build}/${name}-${version}.jar"/>
             <lib file="${build.config-browser.jar}"/>
+            <lib file="${build.example.client.jar}"/>
             <webinf file="${build}/webwork.tld"/>
             <classes dir="${build.example}"/>
             <classes dir="${src.etc}/example"/>