You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by Greg Brown <gk...@mac.com> on 2009/08/21 17:58:12 UTC
[REVIEW] Proposed build script change
Please review...
I have created a simple shell script for launching WTKX files via the
ScriptApplication class, and I want to integrate it into the build
process so it always refers to the right JARs. I have also added JSP
template processing for the demos, tutorials, and web test projects.
Index: build.xml
===================================================================
--- build.xml (revision 806183)
+++ build.xml (working copy)
@@ -173,6 +173,7 @@
<delete>
<fileset dir="@{project}/www">
<include name="*.html"/>
+ <include name="*.jsp"/>
<include name="*.jnlp"/>
<exclude name="*.template.*"/>
<exclude name="index.html"/>
@@ -193,6 +194,13 @@
<target name="clean" description="Removes all build artifacts"
depends="charts-clean, core-clean, web-clean, wtk-clean,
tutorials-clean, demos-clean, tools-clean">
+ <delete>
+ <fileset dir="bin">
+ <include name="*.sh"/>
+ <include name="*.bat"/>
+ <exclude name="*.template.*"/>
+ </fileset>
+ </delete>
<delete dir="${folder.dist}"/>
<delete dir="${folder.doc}"/>
<delete dir="${folder.install}"/>
@@ -584,6 +592,23 @@
<filter token="project_name" value="${ant.project.name}"/>
<filter token="version" value="${version}"/>
+ <!-- Generate Pivot shell scripts -->
+ <copy todir="bin" filtering="true">
+ <fileset dir="bin">
+ <include name="*.template.sh"/>
+ </fileset>
+ <mapper type="glob" from="*.template.sh" to="*.sh"/>
+ </copy>
+
+ <chmod file="bin/pivot.sh" perm="ugo+x"/>
+
+ <copy todir="bin" filtering="true">
+ <fileset dir="bin">
+ <include name="*.template.bat"/>
+ </fileset>
+ <mapper type="glob" from="*.template.bat" to="*.bat"/>
+ </copy>
+
<!-- Deploy demos -->
<mkdir dir="demos/www/lib"/>
<copy todir="demos/www/lib">
@@ -617,7 +642,7 @@
<delete dir="demos/lib/signed"/>
- <!-- Generate demo HTML and JNLP files -->
+ <!-- Generate demo HTML, JSP, and JNLP files -->
<copy todir="demos/www" filtering="true">
<fileset dir="demos/www">
<include name="*.template.html"/>
@@ -627,6 +652,13 @@
<copy todir="demos/www" filtering="true">
<fileset dir="demos/www">
+ <include name="*.template.jsp"/>
+ </fileset>
+ <mapper type="glob" from="*.template.jsp" to="*.jsp"/>
+ </copy>
+
+ <copy todir="demos/www" filtering="true">
+ <fileset dir="demos/www">
<include name="*.template.jnlp"/>
</fileset>
<mapper type="glob" from="*.template.jnlp" to="*.jnlp"/>
@@ -649,7 +681,7 @@
</fileset>
</copy>
- <!-- Generate tutorial HTML and JNLP files -->
+ <!-- Generate tutorial HTML, JSP, and JNLP files -->
<copy todir="tutorials/www" filtering="true">
<fileset dir="tutorials/www">
<include name="*.template.html"/>
@@ -659,6 +691,13 @@
<copy todir="tutorials/www" filtering="true">
<fileset dir="tutorials/www">
+ <include name="*.template.jsp"/>
+ </fileset>
+ <mapper type="glob" from="*.template.jsp" to="*.jsp"/>
+ </copy>
+
+ <copy todir="tutorials/www" filtering="true">
+ <fileset dir="tutorials/www">
<include name="*.template.jnlp"/>
</fileset>
<mapper type="glob" from="*.template.jnlp" to="*.jnlp"/>
@@ -695,7 +734,7 @@
</fileset>
</copy>
- <!-- Generate web test HTML and JNLP files -->
+ <!-- Generate web test HTML, JSP, and JNLP files -->
<copy todir="web/www" filtering="true">
<fileset dir="web/www">
<include name="*.template.html"/>
@@ -705,6 +744,13 @@
<copy todir="web/www" filtering="true">
<fileset dir="web/www">
+ <include name="*.template.jsp"/>
+ </fileset>
+ <mapper type="glob" from="*.template.jsp" to="*.jsp"/>
+ </copy>
+
+ <copy todir="web/www" filtering="true">
+ <fileset dir="web/www">
<include name="*.template.jnlp"/>
</fileset>
<mapper type="glob" from="*.template.jnlp" to="*.jnlp"/>
Index: bin/pivot.template.sh
===================================================================
--- bin/pivot.template.sh (revision 0)
+++ bin/pivot.template.sh (revision 0)
@@ -0,0 +1,7 @@
+#!/bin/bash
+if [ -z "$1" ];
+then
+echo "WTKX source argument is required."
+else
+java -cp ${PIVOT_HOME}/lib/@project_name@-core-@version@.jar:$
{PIVOT_HOME}/lib/@project_name@-web-@version@.jar:${PIVOT_HOME}/lib/
@project_name@-wtk-@version@.jar:${PIVOT_HOME}/lib/@project_name@-wtk-
@version@.terra.jar:. org.apache.pivot.wtk.ScriptApplication --src=$1
+fi
Re: [REVIEW] Proposed build script change
Posted by Greg Brown <gk...@mac.com>.
OK. I have reverted this change. I think the possibility of an Eclipse
launcher is worth looking into, though.
On Aug 21, 2009, at 12:39 PM, Todd Volkert wrote:
> I don't think you need a template sh file to do this - with a little
> beefier
> shell script, you can do the right thing all in the shell script.
> I'd vote
> for that solution, as changing the build script to build a shell
> script
> seems like a more convoluted solution.
> -T
>
> On Fri, Aug 21, 2009 at 8:58 AM, Greg Brown <gk...@mac.com> wrote:
>
>> Please review...
>> I have created a simple shell script for launching WTKX files via the
>> ScriptApplication class, and I want to integrate it into the build
>> process
>> so it always refers to the right JARs. I have also added JSP template
>> processing for the demos, tutorials, and web test projects.
>>
>>
>> Index: build.xml
>> ===================================================================
>> --- build.xml (revision 806183)
>> +++ build.xml (working copy)
>> @@ -173,6 +173,7 @@
>> <delete>
>> <fileset dir="@{project}/www">
>> <include name="*.html"/>
>> + <include name="*.jsp"/>
>> <include name="*.jnlp"/>
>> <exclude name="*.template.*"/>
>> <exclude name="index.html"/>
>> @@ -193,6 +194,13 @@
>>
>> <target name="clean" description="Removes all build artifacts"
>> depends="charts-clean, core-clean, web-clean, wtk-clean,
>> tutorials-clean, demos-clean, tools-clean">
>> + <delete>
>> + <fileset dir="bin">
>> + <include name="*.sh"/>
>> + <include name="*.bat"/>
>> + <exclude name="*.template.*"/>
>> + </fileset>
>> + </delete>
>> <delete dir="${folder.dist}"/>
>> <delete dir="${folder.doc}"/>
>> <delete dir="${folder.install}"/>
>> @@ -584,6 +592,23 @@
>> <filter token="project_name" value="${ant.project.name}"/>
>> <filter token="version" value="${version}"/>
>>
>> + <!-- Generate Pivot shell scripts -->
>> + <copy todir="bin" filtering="true">
>> + <fileset dir="bin">
>> + <include name="*.template.sh"/>
>> + </fileset>
>> + <mapper type="glob" from="*.template.sh" to="*.sh"/>
>> + </copy>
>> +
>> + <chmod file="bin/pivot.sh" perm="ugo+x"/>
>> +
>> + <copy todir="bin" filtering="true">
>> + <fileset dir="bin">
>> + <include name="*.template.bat"/>
>> + </fileset>
>> + <mapper type="glob" from="*.template.bat" to="*.bat"/>
>> + </copy>
>> +
>> <!-- Deploy demos -->
>> <mkdir dir="demos/www/lib"/>
>> <copy todir="demos/www/lib">
>> @@ -617,7 +642,7 @@
>>
>> <delete dir="demos/lib/signed"/>
>>
>> - <!-- Generate demo HTML and JNLP files -->
>> + <!-- Generate demo HTML, JSP, and JNLP files -->
>> <copy todir="demos/www" filtering="true">
>> <fileset dir="demos/www">
>> <include name="*.template.html"/>
>> @@ -627,6 +652,13 @@
>>
>> <copy todir="demos/www" filtering="true">
>> <fileset dir="demos/www">
>> + <include name="*.template.jsp"/>
>> + </fileset>
>> + <mapper type="glob" from="*.template.jsp" to="*.jsp"/>
>> + </copy>
>> +
>> + <copy todir="demos/www" filtering="true">
>> + <fileset dir="demos/www">
>> <include name="*.template.jnlp"/>
>> </fileset>
>> <mapper type="glob" from="*.template.jnlp" to="*.jnlp"/>
>> @@ -649,7 +681,7 @@
>> </fileset>
>> </copy>
>>
>> - <!-- Generate tutorial HTML and JNLP files -->
>> + <!-- Generate tutorial HTML, JSP, and JNLP files -->
>> <copy todir="tutorials/www" filtering="true">
>> <fileset dir="tutorials/www">
>> <include name="*.template.html"/>
>> @@ -659,6 +691,13 @@
>>
>> <copy todir="tutorials/www" filtering="true">
>> <fileset dir="tutorials/www">
>> + <include name="*.template.jsp"/>
>> + </fileset>
>> + <mapper type="glob" from="*.template.jsp" to="*.jsp"/>
>> + </copy>
>> +
>> + <copy todir="tutorials/www" filtering="true">
>> + <fileset dir="tutorials/www">
>> <include name="*.template.jnlp"/>
>> </fileset>
>> <mapper type="glob" from="*.template.jnlp" to="*.jnlp"/>
>> @@ -695,7 +734,7 @@
>> </fileset>
>> </copy>
>>
>> - <!-- Generate web test HTML and JNLP files -->
>> + <!-- Generate web test HTML, JSP, and JNLP files -->
>> <copy todir="web/www" filtering="true">
>> <fileset dir="web/www">
>> <include name="*.template.html"/>
>> @@ -705,6 +744,13 @@
>>
>> <copy todir="web/www" filtering="true">
>> <fileset dir="web/www">
>> + <include name="*.template.jsp"/>
>> + </fileset>
>> + <mapper type="glob" from="*.template.jsp" to="*.jsp"/>
>> + </copy>
>> +
>> + <copy todir="web/www" filtering="true">
>> + <fileset dir="web/www">
>> <include name="*.template.jnlp"/>
>> </fileset>
>> <mapper type="glob" from="*.template.jnlp" to="*.jnlp"/>
>> Index: bin/pivot.template.sh
>> ===================================================================
>> --- bin/pivot.template.sh (revision 0)
>> +++ bin/pivot.template.sh (revision 0)
>> @@ -0,0 +1,7 @@
>> +#!/bin/bash
>> +if [ -z "$1" ];
>> +then
>> +echo "WTKX source argument is required."
>> +else
>> +java -cp ${PIVOT_HOME}/lib/@project_name@-core-@version
>> @.jar:${PIVOT_HOME}/lib/@project_name@-web-@version
>> @.jar:${PIVOT_HOME}/lib/@project_name@-wtk-@version
>> @.jar:${PIVOT_HOME}/lib/@project_name@-wtk-@version@.terra.jar:.
>> org.apache.pivot.wtk.ScriptApplication --src=$1
>> +fi
>>
>>
Re: [REVIEW] Proposed build script change
Posted by Todd Volkert <tv...@gmail.com>.
I don't think you need a template sh file to do this - with a little beefier
shell script, you can do the right thing all in the shell script. I'd vote
for that solution, as changing the build script to build a shell script
seems like a more convoluted solution.
-T
On Fri, Aug 21, 2009 at 8:58 AM, Greg Brown <gk...@mac.com> wrote:
> Please review...
> I have created a simple shell script for launching WTKX files via the
> ScriptApplication class, and I want to integrate it into the build process
> so it always refers to the right JARs. I have also added JSP template
> processing for the demos, tutorials, and web test projects.
>
>
> Index: build.xml
> ===================================================================
> --- build.xml (revision 806183)
> +++ build.xml (working copy)
> @@ -173,6 +173,7 @@
> <delete>
> <fileset dir="@{project}/www">
> <include name="*.html"/>
> + <include name="*.jsp"/>
> <include name="*.jnlp"/>
> <exclude name="*.template.*"/>
> <exclude name="index.html"/>
> @@ -193,6 +194,13 @@
>
> <target name="clean" description="Removes all build artifacts"
> depends="charts-clean, core-clean, web-clean, wtk-clean,
> tutorials-clean, demos-clean, tools-clean">
> + <delete>
> + <fileset dir="bin">
> + <include name="*.sh"/>
> + <include name="*.bat"/>
> + <exclude name="*.template.*"/>
> + </fileset>
> + </delete>
> <delete dir="${folder.dist}"/>
> <delete dir="${folder.doc}"/>
> <delete dir="${folder.install}"/>
> @@ -584,6 +592,23 @@
> <filter token="project_name" value="${ant.project.name}"/>
> <filter token="version" value="${version}"/>
>
> + <!-- Generate Pivot shell scripts -->
> + <copy todir="bin" filtering="true">
> + <fileset dir="bin">
> + <include name="*.template.sh"/>
> + </fileset>
> + <mapper type="glob" from="*.template.sh" to="*.sh"/>
> + </copy>
> +
> + <chmod file="bin/pivot.sh" perm="ugo+x"/>
> +
> + <copy todir="bin" filtering="true">
> + <fileset dir="bin">
> + <include name="*.template.bat"/>
> + </fileset>
> + <mapper type="glob" from="*.template.bat" to="*.bat"/>
> + </copy>
> +
> <!-- Deploy demos -->
> <mkdir dir="demos/www/lib"/>
> <copy todir="demos/www/lib">
> @@ -617,7 +642,7 @@
>
> <delete dir="demos/lib/signed"/>
>
> - <!-- Generate demo HTML and JNLP files -->
> + <!-- Generate demo HTML, JSP, and JNLP files -->
> <copy todir="demos/www" filtering="true">
> <fileset dir="demos/www">
> <include name="*.template.html"/>
> @@ -627,6 +652,13 @@
>
> <copy todir="demos/www" filtering="true">
> <fileset dir="demos/www">
> + <include name="*.template.jsp"/>
> + </fileset>
> + <mapper type="glob" from="*.template.jsp" to="*.jsp"/>
> + </copy>
> +
> + <copy todir="demos/www" filtering="true">
> + <fileset dir="demos/www">
> <include name="*.template.jnlp"/>
> </fileset>
> <mapper type="glob" from="*.template.jnlp" to="*.jnlp"/>
> @@ -649,7 +681,7 @@
> </fileset>
> </copy>
>
> - <!-- Generate tutorial HTML and JNLP files -->
> + <!-- Generate tutorial HTML, JSP, and JNLP files -->
> <copy todir="tutorials/www" filtering="true">
> <fileset dir="tutorials/www">
> <include name="*.template.html"/>
> @@ -659,6 +691,13 @@
>
> <copy todir="tutorials/www" filtering="true">
> <fileset dir="tutorials/www">
> + <include name="*.template.jsp"/>
> + </fileset>
> + <mapper type="glob" from="*.template.jsp" to="*.jsp"/>
> + </copy>
> +
> + <copy todir="tutorials/www" filtering="true">
> + <fileset dir="tutorials/www">
> <include name="*.template.jnlp"/>
> </fileset>
> <mapper type="glob" from="*.template.jnlp" to="*.jnlp"/>
> @@ -695,7 +734,7 @@
> </fileset>
> </copy>
>
> - <!-- Generate web test HTML and JNLP files -->
> + <!-- Generate web test HTML, JSP, and JNLP files -->
> <copy todir="web/www" filtering="true">
> <fileset dir="web/www">
> <include name="*.template.html"/>
> @@ -705,6 +744,13 @@
>
> <copy todir="web/www" filtering="true">
> <fileset dir="web/www">
> + <include name="*.template.jsp"/>
> + </fileset>
> + <mapper type="glob" from="*.template.jsp" to="*.jsp"/>
> + </copy>
> +
> + <copy todir="web/www" filtering="true">
> + <fileset dir="web/www">
> <include name="*.template.jnlp"/>
> </fileset>
> <mapper type="glob" from="*.template.jnlp" to="*.jnlp"/>
> Index: bin/pivot.template.sh
> ===================================================================
> --- bin/pivot.template.sh (revision 0)
> +++ bin/pivot.template.sh (revision 0)
> @@ -0,0 +1,7 @@
> +#!/bin/bash
> +if [ -z "$1" ];
> +then
> +echo "WTKX source argument is required."
> +else
> +java -cp ${PIVOT_HOME}/lib/@project_name@-core-@version
> @.jar:${PIVOT_HOME}/lib/@project_name@-web-@version
> @.jar:${PIVOT_HOME}/lib/@project_name@-wtk-@version
> @.jar:${PIVOT_HOME}/lib/@project_name@-wtk-@version@.terra.jar:.
> org.apache.pivot.wtk.ScriptApplication --src=$1
> +fi
>
>