| <?xml version="1.0"?> |
| <!-- $Id$ --> |
| <!-- Top-level buildfile for the Tapestry module. --> |
| <project name="Tapestry Web Application Framework" default="install"> |
| <property name="root.dir" value="./"/> |
| <property name="config.dir" value="${root.dir}/config"/> |
| <property file="${config.dir}/Version.properties"/> |
| <property file="${config.dir}/build.properties"/> |
| <property file="${config.dir}/common.properties"/> |
| <property name="javadoc.dir" value="web/doc/api"/> |
| <property name="private.dir" value="private"/> |
| <property environment="env"/> |
| |
| <path id="jetty.classpath"> |
| <fileset dir="${jetty.dir}"> |
| <include name="lib/javax.servlet.jar"/> |
| <include name="lib/org.mortbay.jetty-jdk1.2.jar"/> |
| <include name="ext/*.jar"/> |
| </fileset> |
| <!-- Needed to support JSP compilation --> |
| <pathelement location="${env.JAVA_HOME}/lib/tools.jar"/> |
| </path> |
| |
| <path id="ext.dist.classpath"> |
| <fileset dir="${ext.dist.dir}"> |
| <include name="*.jar"/> |
| </fileset> |
| </path> |
| |
| <path id="workbench.classpath"> |
| <fileset dir="${root.lib.dir}"> |
| <include name="${framework.jar}"/> |
| <include name="${contrib.jar}"/> |
| <include name="${ext.dir}/*.jar"/> |
| <include name="${runtime.dir}/*.jar"/> |
| </fileset> |
| <pathelement location="config"/> |
| </path> |
| |
| <path id="vlib.classpath"> |
| <pathelement location="${vlibbeans.jar}"/> |
| <pathelement location="examples/VlibBeans/jboss"/> |
| <pathelement location="${jboss.client.dir}/jboss-j2ee.jar"/> |
| <pathelement location="${jboss.client.dir}/jboss-client.jar"/> |
| <pathelement location="${jboss.client.dir}/jnp-client.jar"/> |
| <path refid="workbench.classpath"/> |
| </path> |
| <target name="clean" description="Cleans all sub-projects."> |
| <ant dir="framework" target="clean"/> |
| <ant dir="contrib" target="clean"/> |
| <ant dir="junit" target="clean"/> |
| <ant dir="examples" target="clean"/> |
| <ant dir="doc/src" target="clean"/> |
| <delete dir="${private.dir}" quiet="true"/> |
| </target> |
| <target name="clean-all" depends="clean" |
| description="Cleans all subprojects and deletes installed frameworks and WARs." |
| > |
| <delete quiet="true"> |
| <fileset dir="${root.lib.dir}"> |
| <include name="*.jar"/> |
| <include name="examples/**"/> |
| </fileset> |
| </delete> |
| <delete dir="web/doc" quiet="true"/> |
| </target> |
| <target name="install" description="Builds all frameworks and examples."> |
| <!-- Each project has its own definitions for many properties. |
| inheritAll="false" ensures that definitions in this buildfile |
| doesn't override definitions in each project's buildfile. --> |
| <ant dir="framework" target="install" inheritAll="false"/> |
| <ant dir="contrib" target="install" inheritAll="false"/> |
| <ant dir="examples" target="install" inheritAll="false"/> |
| </target> |
| <target name="documentation" |
| description="Builds the Tapestry documentation."> |
| <ant dir="doc/src" target="install" inheritAll="false"/> |
| </target> |
| |
| <target name="junit" depends="check-for-jython-dir" |
| description="Run the JUnit test suite for Tapestry."> |
| <ant dir="junit" target="run" inheritAll="false"/> |
| </target> |
| |
| <target name="clover" depends="check-for-clover-dir,check-for-jython-dir" |
| description="Execute the JUnit tests and generate Code Coverage report." |
| > |
| <ant dir="junit" target="clover" inheritAll="false"/> |
| </target> |
| |
| <target name="dist" |
| description="Builds the Tapestry distribution from scratch." |
| depends="clean-all,install,junit,documentation,clover,javadoc"> |
| <!-- After building, clean all the subprojects. --> |
| <antcall target="clean"/> |
| <!-- Now, build that actual distribution. --> |
| <antcall target="build-dist"/> |
| </target> |
| |
| <property name="dist.root.dir" value="dist"/> |
| <property name="dist.base" value="Tapestry-${framework.version}"/> |
| <property name="dist.dir" value="${dist.root.dir}/${dist.base}"/> |
| |
| <target name="build-dist" |
| description="Builds the Tapestry distribution files."> |
| <!-- Delete the base directory. --> |
| <delete dir="${dist.root.dir}" quiet="true"/> |
| <antcall target="build-dist-tarball"/> |
| </target> |
| |
| <target name="build-dist-copy"> |
| <!-- Copy all the relevant files to the base directory. --> |
| <copy todir="${dist.dir}" includeEmptyDirs="false"> |
| <fileset dir="."> |
| <include name="*.xml"/> |
| <include name="*.html"/> |
| <include name="LICENSE.*"/> |
| <include name="KEYS"/> |
| <!-- Skip HTML files in web, since those need |
| a seperate path, to provide filtering. --> |
| <exclude name="Readme.html"/> |
| <exclude name="web/*.html"/> |
| <include name="web/**"/> |
| <include name="config/**"/> |
| <include name="ext-dist/README.html"/> |
| <exclude name="lib/*"/> |
| <exclude name="lib/**"/> |
| <!-- Exclude class files left around by IDEs. --> |
| <exclude name="**/*.class"/> |
| <!-- Exclude Paint Shop Pro files (used to generate images |
| in various places) --> |
| <exclude name="**/*.psp"/> |
| <exclude name="**/*.jbf"/> |
| <!-- Don't include build.properties; that's specific to this build |
| environment. We ship a sample file instead. --> |
| <exclude name="config/build.properties"/> |
| <!-- This is where Eclipse puts classes. --> |
| <exclude name="bin/**"/> |
| <!-- It isn't a good idea to generate a distribution from a normal working |
| directory, since the <copy> will include things like backup files created |
| while editting. Better to check out the Tapestry module via anon CVS to |
| a temporary directory, configure build.properties, and build the |
| release there. --> |
| </fileset> |
| </copy> |
| <!-- The Readme.html file and several of the web pages |
| include a version number; copy w/ filtering. --> |
| <copy todir="${dist.dir}" includeEmptyDirs="false"> |
| <fileset dir="."> |
| <include name="Readme.html"/> |
| <include name="web/*.html"/> |
| </fileset> |
| <filterset> |
| <filter token="VERSION" value="${framework.version}"/> |
| <filter token="OS_NAME" value="${os.name}"/> |
| <filter token="OS_VERSION" value="${os.version}"/> |
| <filter token="JAVA_VENDOR" value="${java.vendor}"/> |
| <filter token="JAVA_VM_VERSION" value="${java.vm.version}"/> |
| <filter token="COPY_YEARS" value="${copyright.years}"/> |
| <filter token="HOME_PAGE_URL" |
| value="http://jakarta.apache.org/proposals/tapestry"/> |
| </filterset> |
| </copy> |
| <copy todir="${dist.dir}/lib"> |
| <fileset dir="${root.lib.dir}"> |
| <include name="**/*.war"/> |
| <include name="**/*.ear"/> |
| <include name="**/*.jar"/> |
| <include name="**/LICENSE*"/> |
| <exclude name="${vlibbeans.jar}"/> |
| </fileset> |
| </copy> |
| |
| <copy todir="${dist.dir}/lib" flatten="true"> |
| <fileset dir="examples"> |
| <include name="**/*.tld"/> |
| </fileset> |
| </copy> |
| |
| <copy todir="${dist.dir}"> |
| <fileset dir="."> |
| <include name="framework/**"/> |
| <include name="contrib/**"/> |
| <include name="examples/**"/> |
| <!-- These two aren't quite ready for primetime. --> |
| <exclude name="examples/DevelopmentEnvironment/**"/> |
| <exclude name="examples/Tutorial2/**"/> |
| </fileset> |
| </copy> |
| <property name="web.dir" value="${dist.dir}/web"/> |
| <property name="dtd.dir" value="${web.dir}/dtd"/> |
| <copy todir="${dtd.dir}" flatten="true"> |
| <fileset dir="framework/src"> |
| <include name="**/*.dtd"/> |
| </fileset> |
| </copy> |
| </target> |
| <target name="build-dist-tarball" |
| description="Builds the tarball distributions." |
| depends="build-dist-copy"> |
| |
| <property name="bin.tar.gz" value="${dist.dir}-bin.tar.gz"/> |
| <property name="src.tar.gz" value="${dist.dir}-src.tar.gz"/> |
| <tar tarfile="${bin.tar.gz}" longfile="gnu" compression="gzip"> |
| <tarfileset dir="${dist.root.dir}"> |
| <include name="${dist.base}/**"/> |
| <!-- Don't ship the code coverage report; it's huge. --> |
| <exclude name="${dist.base}/framework/**"/> |
| <exclude name="${dist.base}/contrib/**"/> |
| <exclude name="${dist.base}/examples/**"/> |
| <exclude name="${dist.base}/web/doc/clover/**"/> |
| </tarfileset> |
| </tar> |
| <tar tarfile="${src.tar.gz}" longfile="gnu" compression="gzip"> |
| <tarfileset dir="${dist.root.dir}"> |
| <!-- Include the sub-projects excluded from the -bin distro. --> |
| <include name="${dist.base}/framework/**"/> |
| <include name="${dist.base}/contrib/**"/> |
| <include name="${dist.base}/examples/**"/> |
| </tarfileset> |
| </tar> |
| |
| <property name="bin.zip" value="${dist.dir}-bin.zip"/> |
| <property name="src.zip" value="${dist.dir}-src.zip"/> |
| |
| <zip destfile="${bin.zip}"> |
| <zipfileset dir="${dist.root.dir}"> |
| <include name="${dist.base}/**"/> |
| <!-- Don't ship the code coverage report; it's huge. --> |
| <exclude name="${dist.base}/framework/**"/> |
| <exclude name="${dist.base}/contrib/**"/> |
| <exclude name="${dist.base}/examples/**"/> |
| <exclude name="${dist.base}/web/doc/clover/**"/> |
| </zipfileset> |
| </zip> |
| |
| <zip destfile="${src.zip}"> |
| <zipfileset dir="${dist.root.dir}"> |
| <!-- Include the sub-projects excluded from the -bin distro. --> |
| <include name="${dist.base}/framework/**"/> |
| <include name="${dist.base}/contrib/**"/> |
| <include name="${dist.base}/examples/**"/> |
| </zipfileset> |
| </zip> |
| |
| <!-- Create the web distribution (to be put up on the web site). This *does* |
| include the code coverage report. --> |
| <property name="web.tar.gz" |
| value="${dist.root.dir}/Tapestry-Web-${framework.version}.tar.gz"/> |
| <tar basedir="${web.dir}" tarfile="${web.tar.gz}" longfile="gnu" |
| compression="gzip"/> |
| </target> |
| |
| <target name="javadoc" |
| description="Generate API documentation for the framework and examples." |
| > |
| <mkdir dir="${javadoc.dir}"/> |
| <javadoc author="true" version="true" destdir="${javadoc.dir}" |
| splitindex="true" windowtitle="Tapestry API ${framework.version}"> |
| <doctitle>Tapestry ${framework.version} API</doctitle> |
| <package name="org.apache.tapestry.*"/> |
| |
| <link href="http://java.sun.com/products/jdk/1.2/docs/api/" |
| offline="true" packageListLoc="package-lists/jdk"/> |
| |
| <link href="http://java.sun.com/j2ee/sdk_1.2.1/techdocs/api/" |
| offline="true" packageListLoc="package-lists/j2ee"/> |
| |
| <link href="http://jakarta.apache.org/log4j/docs/api/" |
| offline="true" packageListLoc="package-lists/log4j"/> |
| |
| <link href="http://www.junit.org/junit/javadoc/3.7/" offline="true" |
| packageListLoc="package-lists/junit"/> |
| |
| <link href="http://jakarta.apache.org/oro/api/" offline="true" |
| packageListLoc="package-lists/jakarta-oro"/> |
| |
| <group title="Tapestry Framework" |
| packages="org.apache.tapestry:org.apache.tapestry.*"/> |
| <group title="Tapestry Contributions Framework" |
| packages="org.apache.tapestry.contrib.*"/> |
| |
| <sourcepath> |
| <pathelement location="framework/src"/> |
| <pathelement location="contrib/src"/> |
| </sourcepath> |
| |
| <classpath> |
| <path refid="vlib.classpath"/> |
| <path refid="ext.dist.classpath"/> |
| <pathelement location="${servlet.jar.path}"/> |
| <pathelement location="${j2ee.jar.path}"/> |
| </classpath> |
| </javadoc> |
| </target> |
| |
| <target name="run-workbench" depends="check-for-jetty-dir" |
| description="Runs the Tapestry Workbench using Jetty."> |
| <delete dir="${private.dir}" quiet="true"/> |
| <mkdir dir="${private.dir}"/> |
| <echo>Running Tapestry Workbench on port 8080 ...</echo> |
| <java classname="org.mortbay.jetty.Server" fork="true" maxmemory="128MB" |
| > |
| <classpath> |
| <path refid="jetty.classpath"/> |
| </classpath> |
| <arg value="config/jetty-workbench.xml"/> |
| <!-- Enable debugging when running the tutorial --> |
| <jvmarg line="-showversion -Xdebug -Xnoagent"/> |
| <jvmarg |
| line="-Xrunjdwp:transport=dt_socket,suspend=n,server=y,address=20150" |
| /> |
| <!-- Jetty can get easily confused (under NT) unless this is turned off. --> |
| <sysproperty key="org.mortbay.util.FileResource.checkAliases" |
| value="false"/> |
| <sysproperty key="org.apache.tapestry.asset.dir" value="${private.dir}" |
| /> |
| <sysproperty key="org.apache.tapestry.asset.URL" value="/private"/> |
| </java> |
| </target> |
| |
| <!-- =================================================================================== |
| |
| JBoss 3.0.4 auto configuration |
| |
| Configures a JBoss 3.0.4 with a new configuration, tapestry. Part of the configuration |
| comes with the Tapestry distribution; part is copied from the JBoss default server |
| configuration. |
| |
| This only works with JBoss 3.0.4; other releases differ enough that this |
| simple script is broken. |
| |
| ==================================================================================== --> |
| <property name="tapestry.dir" value="${jboss.dir}/server/tapestry"/> |
| <property name="tapestry.conf.dir" value="${tapestry.dir}/conf"/> |
| <property name="tapestry.lib.dir" value="${tapestry.dir}/lib"/> |
| <property name="tapestry.db.dir" value="${tapestry.dir}/db"/> |
| <property name="tapestry.deploy.dir" value="${tapestry.dir}/deploy"/> |
| <property name="tapestry.private.dir" |
| value="${tapestry.dir}/tmp/${private.dir}"/> |
| <property name="jboss.server.default.dir" |
| value="${jboss.dir}/server/default"/> |
| <target name="configure" depends="check-for-jboss-dir" |
| description="Configure the JBoss 3.0.4 server and setup the Tapestry database." |
| > |
| <delete dir="${tapestry.lib.dir}" quiet="true"/> |
| <mkdir dir="${tapestry.lib.dir}"/> |
| <copy todir="${tapestry.lib.dir}" flatten="true"> |
| <fileset dir="${root.lib.dir}"> |
| <include name="*-${framework.version}.jar"/> |
| <include name="${ext.dir}/*.jar"/> |
| </fileset> |
| <fileset dir="${ext.dist.dir}"> |
| <include name="mckoidb*.jar"/> |
| </fileset> |
| <fileset dir="${jboss.server.default.dir}/lib"> |
| <!-- Could do a careful analysis of just what we need and copy only that, |
| but this is good for now. --> |
| <include name="*.jar"/> |
| </fileset> |
| </copy> |
| <!-- Delete, recreate and copy --> |
| <delete dir="${tapestry.conf.dir}" quiet="true"/> |
| <mkdir dir="${tapestry.conf.dir}"/> |
| <copy todir="${tapestry.conf.dir}" filtering="true"> |
| <fileset dir="config/jboss/conf"/> |
| <filterset> |
| <filter token="jboss.dir" value="${jboss.dir}"/> |
| <filter token="user.dir" value="${user.dir}"/> |
| </filterset> |
| </copy> |
| <mkdir dir="${tapestry.deploy.dir}"/> |
| <copy todir="${tapestry.deploy.dir}"> |
| <fileset dir="${jboss.server.default.dir}/deploy"> |
| <!-- Skip one file that is replaced --> |
| <exclude name="jbossweb.sar/META-INF/jboss-service.xml"/> |
| <include name="*"/> |
| <include name="**/*"/> |
| </fileset> |
| </copy> |
| <!-- Technically, this isn't necessary any longer (the filtering part), |
| but it does no harm, and may be needed again in the future. --> |
| <copy todir="${tapestry.deploy.dir}" filtering="true"> |
| <fileset dir="config/jboss/deploy"/> |
| <filterset> |
| <filter token="user.dir" value="${user.dir}"/> |
| <filter token="jboss.dir" value="${jboss.dir}"/> |
| </filterset> |
| </copy> |
| <!-- Set a flag if the vlib already exists, then extract it if necessary. --> |
| <mkdir dir="${tapestry.db.dir}"/> |
| <available file="${tapestry.db.dir}/tapestry.conf" |
| property="tapestry.db.exists"/> |
| <antcall target="unpack-tapestry-database"/> |
| </target> |
| |
| <target name="unpack-tapestry-database" |
| description="Unpacks the Tapestry demos database." |
| unless="tapestry.db.exists"> |
| <unzip src="config/jboss/tapestry-db.zip" dest="${tapestry.db.dir}"/> |
| </target> |
| |
| <target name="deploy-jboss-demos" depends="check-for-jboss-dir" |
| description="Deploys the demos and Tapestry frameworks into JBoss."> |
| <copy todir="${tapestry.deploy.dir}"> |
| <fileset dir="${examples.dir}"> |
| <include name="${vlib.ear}"/> |
| <include name="${workbench.war}"/> |
| </fileset> |
| </copy> |
| </target> |
| |
| <target name="run-jboss" depends="deploy-jboss-demos" |
| description="Launch the JBoss application server."> |
| <delete dir="${tapestry.private.dir}" quiet="true"/> |
| <mkdir dir="${tapestry.private.dir}"/> |
| <java fork="true" dir="${jboss.dir}/bin" classname="org.jboss.Main"> |
| <!-- Launch using the tapestry configuration, not the default. --> |
| <arg line="--configuration=tapestry"/> |
| <classpath> |
| <pathelement location="${jboss.dir}/bin/run.jar"/> |
| <!-- Include this so that the JMX control panel (based on JSPs) can work. --> |
| <pathelement location="${java.home}/../lib/tools.jar"/> |
| </classpath> |
| <!-- Enable debugging --> |
| <jvmarg line="-showversion -Xdebug -Xnoagent"/> |
| <jvmarg |
| line="-Xrunjdwp:transport=dt_socket,suspend=n,server=y,address=20500" |
| /> |
| <!-- These allow private assets to be exported as static |
| files. This coordinates with portions of |
| config/deploy/jbossweb.sar/META-INF/jboss-service.xml --> |
| <sysproperty key="org.apache.tapestry.asset.dir" |
| value="${tapestry.private.dir}"/> |
| <sysproperty key="org.apache.tapestry.asset.URL" value="/private"/> |
| <!-- The following is probably only necessary under Windows. Jetty gets |
| tripped up by the fact that pathnames are case-insensitive. --> |
| <sysproperty key="org.mortbay.util.FileResource.checkAliases" |
| value="false"/> |
| </java> |
| </target> |
| |
| <!-- Unpacks the Workbench ('cause Tomcat does that anyway), and copies |
| all the necessary JARs into the WEB-INF/libs folder. --> |
| |
| <target name="deploy-tomcat" |
| depends="check-for-tomcat-dir" |
| description="Deploys the Workbench application into Tomcat."> |
| |
| <copy file="${examples.dir}/${workbench.war}" todir="${tomcat.dir}/webapps"/> |
| |
| </target> |
| |
| <target name="check-for-jboss-dir"> |
| <available property="exists.jboss.dir" type="dir" file="${jboss.dir}"/> |
| <fail unless="jboss.dir" |
| message="Property jboss.dir not specified in config/build.properties." |
| /> |
| <fail unless="exists.jboss.dir" |
| message="Directory ${jboss.dir} (jboss.dir from config/build.properties) does not exist." |
| /> |
| </target> |
| <target name="check-for-tomcat-dir"> |
| <available property="exists.tomcat.dir" type="dir" file="${tomcat.dir}" |
| /> |
| <fail unless="tomcat.dir" |
| message="Property tomcat.dir not specified in config/build.properties." |
| /> |
| <fail unless="exists.tomcat.dir" |
| message="Directory ${tomcat.dir} (tomcat.dir from config/build.properties) does not exist." |
| /> |
| </target> |
| <target name="check-for-clover-dir"> |
| <available property="exists.clover.dir" type="dir" file="${clover.dir}" |
| /> |
| <fail unless="clover.dir" |
| message="Property clover.dir not specified in config/build.properties." |
| /> |
| <fail unless="exists.clover.dir" |
| message="Directory ${clover.dir} (clover.dir from config/build.properties) does not exist." |
| /> |
| </target> |
| <target name="check-for-jython-dir"> |
| <available property="exists.jython.dir" type="dir" file="${jython.dir}" |
| /> |
| <fail unless="jython.dir" |
| message="Property jython.dir not specified in config/build.properties." |
| /> |
| <fail unless="exists.jython.dir" |
| message="Directory ${jython.dir} (jython.dir from config/build.properties) does not exist." |
| /> |
| </target> |
| <target name="check-for-jetty-dir"> |
| <available property="exists.jetty.dir" type="dir" file="${jetty.dir}" /> |
| <fail unless="jetty.dir" |
| message="Property jetty.dir not specified in config/build.properties." |
| /> |
| <fail unless="exists.jetty.dir" |
| message="Directory ${jetty.dir} (jetty.dir from config/build.properties) does not exist." |
| /> |
| </target> |
| </project> |