Author: reinhard Date: Fri Mar 25 05:26:32 2005 New Revision: 159008 URL: http://svn.apache.org/viewcvs?view=rev&rev=159008 Log: correct target dependencies; don't copy unnecessary resources for development builds
Modified: cocoon/trunk/tools/external-project-build/generic-build.xml Modified: cocoon/trunk/tools/external-project-build/generic-build.xml URL: http://svn.apache.org/viewcvs/cocoon/trunk/tools/external-project-build/generic-build.xml?view=diff&r1=159007&r2=159008 ============================================================================== --- cocoon/trunk/tools/external-project-build/generic-build.xml (original) +++ cocoon/trunk/tools/external-project-build/generic-build.xml Fri Mar 25 05:26:32 2005 @@ -29,8 +29,14 @@ <condition property="cocoon.cond.container.use"> <istrue value="${cocoon.container.use}"/> </condition> + <condition property="cocoon.cond.webapp.in.context"> + <equals arg1="${cocoon.webapp.path}" arg2=""/> + </condition> <condition property="cocoon.cond.classesToJAR"> - <istrue value="${cocoon.classesToJAR}"/> + <and> + <istrue value="${cocoon.cond.webapp.in.context}"/> + <istrue value="${cocoon.classesToJAR}"/> + </and> </condition> <!-- repository directory structure --> @@ -41,7 +47,7 @@ <property name="cocoon.rep.cocoon.db.dir" value="${cocoon.rep.cocoon.webapp.dir}/WEB-INF/db"/> <property name="cocoon.rep.container.dir" value="${cocoon.rep}/container/${cocoon.container.version}"/> - <!-- container properties --> + <!-- container properties --> <property file="${cocoon.rep.container.dir}/server.properties"/> <!-- target directory structure --> @@ -64,11 +70,7 @@ <property name="cocoon.compiler.nowarn" value="on"/> <property name="cocoon.compiler.source.vm" value="1.3"/> <property name="cocoon.compiler.target.vm" value="1.3"/> - - <!-- run/stop properties (have to be set by user) --> - <property name="cocoon.container.run" value=""/> - <property name="cocoon.container.stop" value=""/> - + </target> <target name="cocoon:init" depends="cocoon:setProperties, cocoon:setFilters"> @@ -86,12 +88,8 @@ </fileset> </copy> - <!-- copy local resources --> - <copy todir="${cocoon.build.webapp.dir}" filtering="off"> - <fileset dir="${cocoon.local.webapp.dir}"> - <exclude name="sitemap.xmap"/> - </fileset> - </copy> + <!-- copy local resources if the application runs *within* the servlet context --> + <antcall target="cocoon:copyWebapp"/> <copy todir="${cocoon.build.webapp.dir}" filtering="on"> <fileset dir="${cocoon.local.webapp.dir}"> @@ -115,6 +113,15 @@ <fileset dir="${cocoon.local.lib.dir}"/> </copy> </target> + + <target name="cocoon:copyWebapp" if="cocoon.cond.webapp.in.context"> + <echo message=".... copyWebapp"/> + <copy todir="${cocoon.build.webapp.dir}" filtering="off"> + <fileset dir="${cocoon.local.webapp.dir}"> + <exclude name="sitemap.xmap"/> + </fileset> + </copy> + </target> <target name="cocoon:classesToJAR" if="cocoon.cond.classesToJAR"> <zip destfile="${cocoon.build.webapp.dir}/WEB-INF/lib/_project.jar"> @@ -134,7 +141,6 @@ target="cocoon:create" inheritall="true"/> </target> - <!-- TODO: run and stop have to support *nix --> <target name="cocoon:core-run" depends="cocoon:before-run"> <ant antfile="${cocoon.rep.container.dir}/container-build.xml" target="cocoon:run" inheritall="true"/> @@ -145,7 +151,8 @@ target="cocoon:stop" inheritall="true"/> </target> - <target name="cocoon:core-compile" depends="cocoon:before-compile"> + <target name="cocoon:core-compile" depends="cocoon:before-compile" if="cocoon.cond.webapp.in.context"> + <!-- TODO support more than one directory with Java classes --> <path id="cocoon:classpath"> <fileset dir="${cocoon.rep.cocoon.lib.dir}"> @@ -194,14 +201,14 @@ <target name="cocoon:after-webapp" depends="cocoon:core-webapp"/> <target name="cocoon:before-war" depends="cocoon:webapp"/> <target name="cocoon:after-war" depends="cocoon:core-war"/> - <target name="cocoon:before-container" depends="cocoon:init" if="cond.container.use"/> - <target name="cocoon:after-container" depends="cocoon:core-container" if="cond.container.use"/> + <target name="cocoon:before-container" depends="cocoon:init"/> + <target name="cocoon:after-container" depends="cocoon:core-container"/> <target name="cocoon:before-run" depends="cocoon:init"/> <target name="cocoon:after-run" depends="cocoon:core-run"/> <target name="cocoon:before-stop" depends="cocoon:init"/> <target name="cocoon:after-stop" depends="cocoon:core-stop"/> - <target name="cocoon:before-compile" depends="cocoon:init"/> - <target name="cocoon:after-compile" depends="cocoon:core-compile"/> + <target name="cocoon:before-compile" depends="cocoon:init" if="cocoon.cond.webapp.in.context"/> + <target name="cocoon:after-compile" depends="cocoon:core-compile" if="cocoon.cond.webapp.in.context"/> <target name="cocoon:before-clean" depends="cocoon:init"/> <target name="cocoon:after-clean" depends="cocoon:core-clean"/> <target name="cocoon:before-clean-all" depends="cocoon:init"/> @@ -210,12 +217,12 @@ <!-- public available targets DO NOT OVERRIDE THEM but use the before/after/core targets for this purpose --> - <target name="cocoon:container" depends="cocoon:after-container" if="cond.container.use" description="screate a container (uses the property 'container.version')"/> + <target name="cocoon:container" depends="cocoon:after-container" description="screate a container (uses the property 'container.version')"/> <target name="cocoon:webapp" depends="cocoon:after-webapp" description="create the web application"/> <target name="cocoon:war" depends="cocoon:after-war" description="create a web archive (WAR)"/> <target name="cocoon:run" depends="cocoon:after-run" description="run the container (currently it only works on windows boxes)"/> <target name="cocoon:stop" depends="cocoon:after-stop" description="run the container (currently it only works on windows boxes)"/> - <target name="cocoon:compile" depends="cocoon:after-compile" description="Compile Java classes"/> + <target name="cocoon:compile" depends="cocoon:after-compile" description="Compile Java classes" if="cocoon.cond.webapp.in.context"/> <target name="cocoon:clean" depends="cocoon:after-clean" description="clean webapps and container"/> <target name="cocoon:clean-all" depends="cocoon:after-clean-all" description="clean *everything* in the build dir"/> @@ -226,7 +233,7 @@ <target name="war" depends="cocoon:war" description="short version for cocoon:war"/> <target name="run" depends="cocoon:run" description="short version for cocoon:run"/> <target name="stop" depends="cocoon:stop" description="short version for cocoon:stop"/> - <target name="compile" depends="cocoon:compile" description="short version for cocoon:compile"/> + <target name="compile" depends="cocoon:compile" description="short version for cocoon:compile" if="cocoon.cond.webapp.in.context"/> <target name="clean" depends="cocoon:clean" description="short version for cocoon:clean"/> <target name="clean-all" depends="cocoon:clean-all" description="short version for cocoon:clean-all"/>