[jboss-cvs] jboss-seam/examples ...

Peter Muir peter at bleepbleep.org.uk
Thu Jun 28 07:56:38 EDT 2007


  User: pmuir   
  Date: 07/06/28 07:56:38

  Modified:    examples  build.xml
  Log:
  Add tomcat targets
  
  Revision  Changes    Path
  1.2       +111 -133  jboss-seam/examples/build.xml
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: build.xml
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/build.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- build.xml	27 Jun 2007 18:30:33 -0000	1.1
  +++ build.xml	28 Jun 2007 11:56:38 -0000	1.2
  @@ -31,8 +31,8 @@
   
   	<!-- Deployment directories -->
   	<property name="deploy.dir" value="${jboss.home}/server/default/deploy" />
  +	<property name="tomcat.deploy.dir" value="${tomcat.home}/webapps" />
   	<property name="conf.dir" value="${jboss.home}/server/default/conf" />
  -	<property name="webroot.dir" value="${deploy.dir}/jbossweb-tomcat55.sar/ROOT.war" />
   
   	<!-- Library directories -->
   	<property name="lib.dir" value="${seam.dir}/lib" />
  @@ -254,7 +254,7 @@
   	</patternset>
   
   
  -	<!-- ############### RESOURCES FOR EXAMPLES (JBOSS AS) ################ -->
  +	<!-- ############### RESOURCES FOR EXAMPLES ################ -->
   	<!--
   	  A number of configuration files are needed for Seam, and it's 
   	  dependencies.  The examples place all their configuration files in the
  @@ -290,6 +290,11 @@
   		<include name="META-INF/standard-jaxws-endpoint-config.xml" />
   	</fileset>
   
  +	<!-- resources to go in the jar for tomcat  -->
  +	<fileset id="tomcat.jar.resources" dir="${resources.dir}">
  +		<include name="${example.ds}" />
  +	</fileset>
  +
   	<!-- Resources to go in the ear -->
   	<fileset id="ear.resources" dir="${resources.dir}">
   		<include name="META-INF/application.xml" />
  @@ -323,10 +328,9 @@
   	</path>
   
   
  -	<!-- #################### BUILD TARGETS (JBOSS AS) #################### -->
  +	<!-- ##################### BUILD TARGETS (COMMON) ##################### -->
   	<!-- 
  -	  The build targets for the examples.  Both unexploded (deploy, undeploy)
  -	  and unexploded (explode, unexplode, restart) deployment is possible.
  +	  The build targets which are used for both JBoss AS and  Tomcat
   	-->
   
   	<!-- Initialize the build -->
  @@ -338,25 +342,28 @@
   		<mkdir dir="${dist.dir}" />
   	</target>
   
  +	<!-- Use the Eclipse compiler, if it is available -->
   	<target name="select-compiler">
   		<available classname="org.eclipse.jdt.core.JDTCompilerAdapter" property="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter" />
   	</target>
   
   	<!-- Compile the source code, directly into the jar -->
  -	<target name="compile" depends="init, select-compiler" description="Compile the Java source code">
  +	<target name="compile" depends="init, select-compiler">
   		<javac classpathref="build.classpath" destdir="${jar.dir}" debug="${javac.debug}" deprecation="${javac.deprecation}" nowarn="on">
   			<src path="${src.java.dir}" />
   		</javac>
   	</target>
   
  -	<target name="jar" depends="compile" description="Build the distribution .jar file">
  +	<!-- Build the exploded jar -->
  +	<target name="jar" depends="compile">
   		<copy todir="${jar.dir}">
   			<fileset refid="jar.resources" />
   			<fileset refid="jar.extras" />
   		</copy>
   	</target>
   
  -	<target name="war" depends="compile" description="Build the distribution .war file">
  +	<!-- Build the exploded war -->
  +	<target name="war" depends="compile">
   		<copy todir="${war.dir}">
   			<fileset refid="war.view" />
   			<fileset refid="war.extras" />
  @@ -373,6 +380,37 @@
   			<fileset refid="ajax4jsf.jar" />
   			<mapper type="flatten" />
   		</copy>
  +		<!-- Put messages into the classpath -->
  +		<copy todir="${war.dir}/WEB-INF/classes">
  +			<fileset dir="${resources.dir}">
  +				<include name="messages*.properties" />
  +			</fileset>
  +		</copy>
  +	</target>
  +
  +	<target name="clean" description="Cleans up the build directory">
  +		<delete dir="${dist.dir}" />
  +		<delete dir="${ear.dir}" />
  +		<delete dir="${war.dir}" />
  +		<delete dir="${jar.dir}" />
  +		<delete dir="${basedir}/test-report" />
  +		<delete dir="${basedir}/test-output" />
  +		<delete failonerror="no">
  +			<fileset dir="${test.dir}">
  +				<exclude name="**/*.class" if="eclipse.running" />
  +			</fileset>
  +		</delete>
  +	</target>
  +
  +
  +	<!-- #################### BUILD TARGETS (JBOSS AS) #################### -->
  +	<!-- 
  +	  The build targets for the examples.  Both unexploded (deploy, undeploy)
  +	  and unexploded (explode, unexplode, restart) deployment is possible.
  +	-->
  +
  +	<!-- Extend the standard war target to add extras which JBoss needs -->
  +	<target name="jboss.war" depends="war">
   		<!-- Copy in resources, with filtering -->
   		<copy todir="${war.dir}">
   			<fileset refid="war.resources" />
  @@ -382,15 +420,10 @@
   				<filter token="embeddedEjb" value="false" />
   			</filterset>
   		</copy>
  -		<!-- Put messages into the classpath -->
  -		<copy todir="${war.dir}/WEB-INF/classes">
  -			<fileset dir="${resources.dir}">
  -				<include name="messages*.properties" />
  -			</fileset>
  -		</copy>
   	</target>
   
  -	<target name="ear" description="Build the distribution .ear">
  +	<!-- Build the exploded ear -->
  +	<target name="ear">
   		<copy todir="${ear.dir}">
   			<fileset refid="seam.jar" />
   			<fileset refid="ear.extras" />
  @@ -410,7 +443,7 @@
   		</copy>
   	</target>
   
  -	<target name="archive" depends="jar,war,ear" description="Package the archives">
  +	<target name="archive" depends="jar,jboss.war,ear" description="Package the archives">
   		<jar jarfile="${dist.dir}/${example.name}.jar" basedir="${jar.dir}" />
   		<jar jarfile="${dist.dir}/${example.name}.war" basedir="${war.dir}" />
   		<jar jarfile="${dist.dir}/${example.name}.ear">
  @@ -430,6 +463,7 @@
   		<copy file="${dist.dir}/${example.name}.ear" todir="${deploy.dir}" />
   	</target>
   
  +	<!-- Deploy meldware to JBoss AS -->
   	<target name="meldware">
   		<copy todir="${deploy.dir}">
   			<fileset dir="${meldware.dir}">
  @@ -453,6 +487,7 @@
   		</delete>
   	</target>
   
  +	<!-- Copy the data source to JBoss AS -->
   	<target name="datasource">
   		<fail unless="jboss.home">jboss.home not set</fail>
   		<copy todir="${deploy.dir}">
  @@ -493,80 +528,66 @@
   		<touch file="${ear.deploy.dir}/META-INF/application.xml" />
   	</target>
   
  -	<!-- ################# RESOURCES FOR EXAMPLE (TOMCAT) ################# -->
  +	<!-- #################### BUILD TARGETS (TOMCAT) #################### -->
  +
   
  -	<!-- Tomcat war resources -->
  -	<!--	<fileset id="tomcat.war.resources" dir="resources">-->
  -	<!--		<include name="WEB-INF/**/*.*" />-->
  -	<!--	</fileset>-->
  +	<target name="tomcat.warn">
  +		<echo message="If you built for JBoss AS, remember to run clean before building for Tomcat" />
  +		<echo message="Remember to configure Embedded JBoss" />
  +	</target>
   
  +	<target name="tomcat.jar" depends="jar">
  +		<copy todir="${jar.dir}">
  +			<fileset refid="tomcat.jar.resources" />
  +		</copy>
  +	</target>
   
  -	<!-- #################### BUILD TARGETS (TOMCAT) #################### -->
  +	<!-- Extend the standard war target to add extras which Tomcat needs -->
  +	<target name="tomcat.war" depends="war">
  +		<copy todir="${war.dir}/WEB-INF/lib">
  +			<fileset refid="seam.jar" />
  +			<fileset refid="tomcat.war.extras" />
  +			<fileset refid="drools.jar" />
  +			<fileset refid="cache.jar" />
  +			<fileset refid="jbpm.jar" />
  +			<fileset refid="spring.jar" />
  +			<fileset refid="gwt.jar" />
  +			<fileset refid="jboss-el.jar" />
  +			<fileset refid="jsf.jar" />
  +			<mapper type="flatten" />
  +		</copy>
  +		<!-- Copy in resources, with filtering -->
  +		<copy todir="${war.dir}">
  +			<fileset refid="war.resources" />
  +			<filterset>
  +				<filter token="debug" value="${debug}" />
  +				<filter token="jndiPattern" value="#{ejbName}/local" />
  +				<filter token="embeddedEjb" value="false" />
  +			</filterset>
  +		</copy>
  +	</target>
  +
  +	<target name="tomcat.archive" depends="tomcat.warn,tomcat.jar,tomcat.war" description="Package the archives for tomcat">
  +		<jar jarfile="${dist.dir}/${example.name}.jar" basedir="${jar.dir}" />
  +		<jar jarfile="${dist.dir}/${example.name}.war">
  +			<fileset dir="${war.dir}" />
  +			<zipfileset dir="${dist.dir}" prefix="WEB-INF/lib">
  +				<include name="${example.name}.jar" />
  +			</zipfileset>
  +		</jar>
  +	</target>
  +
  +	<target name="tomcat.deploy" depends="tomcat.archive" description="Deploy the example to Tomcat">
  +
  +		<fail unless="tomcat.home">
  +			tomcat.home not set, update build.properties
  +		</fail>
  +		<copy file="${dist.dir}/${example.name}.war" todir="${tomcat.deploy.dir}" />
  +	</target>
   
  -	<!--	<target name="tomcat.jar" depends="compile">-->
  -	<!--		<jar jarfile="${dist.dir}/${example.name}.jar">-->
  -	<!--			<fileset dir="${classes.dir}">-->
  -	<!--				<patternset refid="components-jar.files" />-->
  -	<!--			</fileset>-->
  -	<!--			<fileset refid="ejb3.resources" />-->
  -	<!--			<fileset refid="tomcat.jar.extras" />-->
  -	<!--		</jar>-->
  -	<!--	</target>-->
  -
  -	<!--	<target name="tomcat.war" depends="compile, tomcat.jar">-->
  -	<!--		<mkdir dir="${build.dir}/resources/WEB-INF/lib" />-->
  -	<!---->
  -	<!--		<copy todir="${build.dir}/resources/WEB-INF/lib">-->
  -	<!--			<fileset refid="seam.jar" />-->
  -	<!--			<fileset refid="seam.debug.jar" />-->
  -	<!--			<fileset refid="seam.ui.jar" />-->
  -	<!--			<fileset refid="seam.pdf.jar" />-->
  -	<!--			<fileset refid="seam.ioc.jar" />-->
  -	<!--			<fileset refid="seam.remoting.jar" />-->
  -	<!--			<fileset refid="tomcat.war.extras" />-->
  -	<!--			<fileset refid="drools.jar" />-->
  -	<!--			<fileset refid="facelets.jar" />-->
  -	<!--			<fileset refid="cache.jar" />-->
  -	<!--			<fileset refid="jbpm.jar" />-->
  -	<!--			<fileset refid="spring.jar" />-->
  -	<!--			<fileset refid="gwt.jar" />-->
  -	<!--			<fileset refid="ajax4jsf.jar" />-->
  -	<!--			<fileset refid="jboss-el.jar" />-->
  -	<!--			<fileset refid="jsf.jar" />-->
  -	<!--			<fileset dir="${dist.dir}">-->
  -	<!--				<include name="${example.name}.jar" />-->
  -	<!--			</fileset>-->
  -	<!--			<mapper type="flatten" />-->
  -	<!--		</copy>-->
  -	<!---->
  -	<!--		<copy todir="${build.dir}/resources">-->
  -	<!--			<fileset refid="tomcat.war.resources" />-->
  -	<!--			<filterset>-->
  -	<!--				<filter token="jndiPattern" value="#{ejbName}/local" />-->
  -	<!--			</filterset>-->
  -	<!--		</copy>-->
  -	<!---->
  -	<!--		<jar destfile="${dist.dir}/${example.name}.war" duplicate="preserve">-->
  -	<!--			<fileset dir="${build.dir}/resources">-->
  -	<!--				<include name="WEB-INF/**/*" />-->
  -	<!--			</fileset>-->
  -	<!--			<fileset refid="war.view" />-->
  -	<!--		</jar>-->
  -	<!---->
  -	<!--	</target>-->
  -
  -	<!--	<target name="tomcat.build" depends="tomcat.war" description="Build the Example for tomcat to the dist dir" />-->
  -
  -	<!--	<target name="tomcat.deploy" depends="tomcat.undeploy,tomcat.build" description="Deploy the example to Tomcat">-->
  -	<!--		<echo>Don't forget to set the path of tomcat.home to Tomcat root directory !</echo>-->
  -	<!--		<copy file="${dist.dir}/${example.name}.war" todir="${tomcat.home}/webapps" />-->
  -	<!--		<echo>After you start Tomcat, the example will be available at: http://localhost:8080/${example.name}</echo>-->
  -	<!--	</target>-->
  -
  -	<!--	<target name="tomcat.undeploy" description="Undeploy the example from Tomcat">-->
  -	<!--		<delete file="${tomcat.home}/webapps/${example.name}.war" />-->
  -	<!--		<delete dir="${tomcat.home}/webapps/${example.name}" />-->
  -	<!--	</target>-->
  +	<target name="tomcat.undeploy" description="Undeploy the example from Tomcat">
  +		<delete file="${tomcat.deploy.dir}/${example.name}.war" />
  +	</target>
   
   
   	<!-- #################### TEST TARGETS (JBOSS AS) ##################### -->
  @@ -584,33 +605,8 @@
   		<ant antfile="${seam.dir}/validate.xml" target="validateConfiguration" />
   	</target>
   
  -	<target name="test.1" depends="validateConfiguration, compile" description="Run the example tests">
  -
  -		<taskdef resource="testngtasks" classpath="${testng.jar}" />
  -
  -		<copy todir="${build.dir}/test">
  -			<fileset dir="${classes.dir}" includes="**/*.*" />
  -			<fileset dir="${resources.dir}">
  -				<include name="**/*" />
  -			</fileset>
  -		</copy>
  -
  -		<delete dir="test-output" />
  -
  -		<testng outputdir="test-output">
  -			<classpath path="${coverage.dir}/classes" />
  -			<!-- TODO: ugly! -->
  -			<classpath path="${build.dir}/test" />
  -			<classpath path="${eejb.conf.dir}" />
  -			<classpath refid="build.classpath" />
  -			<classpath refid="emma.classpath" />
  -			<xmlfileset dir="${src.test.dir}" includes="**/*.xml" />
  -			<classpath refid="test.classpath.extras" />
  -		</testng>
  -
  -	</target>
  -
  -	<target name="compiletest" unless="eclipse.running" description="Compile the Java source code for the tests">
  +	<!-- Compile the test classes -->
  +	<target name="compiletest" unless="eclipse.running">
   		<mkdir dir="${test.dir}" />
   		<javac classpathref="build.classpath" destdir="${test.dir}" debug="${javac.debug}" deprecation="${javac.deprecation}" nowarn="on">
   			<src path="${src.java.dir}" />
  @@ -618,7 +614,8 @@
   		</javac>
   	</target>
   
  -	<target name="buildtest" depends="compiletest" description="Build the tests">
  +	<!-- Build the exploded test directory structure -->
  +	<target name="buildtest" depends="compiletest">
   		<copy todir="${test.dir}">
   			<fileset dir="${resources.dir}">
   				<exclude name="${example.ds}.xml" />
  @@ -641,23 +638,4 @@
   		</testng>
   	</target>
   
  -
  -	<!-- #################### CLEAN TARGETS #################### -->
  -
  -	<target name="clean" description="Cleans up the build directory">
  -		<delete dir="${dist.dir}" />
  -		<delete dir="${ear.dir}" />
  -		<delete dir="${war.dir}" />
  -		<delete dir="${jar.dir}" />
  -		<delete dir="${basedir}/test-report" />
  -		<delete dir="${basedir}/test-output" />
  -		<delete failonerror="no">
  -			<fileset dir="${test.dir}">
  -				<exclude name="**/*.class" if="eclipse.running" />
  -			</fileset>
  -		</delete>
  -	</target>
  -
  -
  -
   </project>
  \ No newline at end of file
  
  
  



More information about the jboss-cvs-commits mailing list