openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ppod...@apache.org
Subject svn commit: r947920 - in /openjpa/trunk/openjpa-examples/openbooks: build.jee.xml build.jse.xml build.properties build.xml
Date Tue, 25 May 2010 05:27:20 GMT
Author: ppoddar
Date: Tue May 25 05:27:19 2010
New Revision: 947920

URL: http://svn.apache.org/viewvc?rev=947920&view=rev
Log:
Update buikd scripts with new HTML code browsing facility

Modified:
    openjpa/trunk/openjpa-examples/openbooks/build.jee.xml
    openjpa/trunk/openjpa-examples/openbooks/build.jse.xml
    openjpa/trunk/openjpa-examples/openbooks/build.properties
    openjpa/trunk/openjpa-examples/openbooks/build.xml

Modified: openjpa/trunk/openjpa-examples/openbooks/build.jee.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-examples/openbooks/build.jee.xml?rev=947920&r1=947919&r2=947920&view=diff
==============================================================================
--- openjpa/trunk/openjpa-examples/openbooks/build.jee.xml (original)
+++ openjpa/trunk/openjpa-examples/openbooks/build.jee.xml Tue May 25 05:27:19 2010
@@ -32,11 +32,18 @@
 		<copy file="${rsrc.dir}/META-INF/persistence.xml" todir="${classes.dir}/META-INF"/>
 		<war destfile="openbooks.war" webxml="${rsrc.dir}/META-INF/web.xml" filesonly="true">
 			<fileset dir="${web.dir}"/>
-			<classes dir="${classes.dir}" />
+			<classes dir="${classes.dir}">
+				<include name="openbook/domain/**"/>
+				<include name="openbook/server/**"/>
+				<include name="openbook/util/**"/>
+			</classes>
 			<fileset dir="${rsrc.dir}">
 				<include name="images/Add2Cart.jpg"/>
 				<include name="images/OpenBooks.jpg"/>
 			</fileset>
+			<fileset dir="${target.dir}">
+				<include name="generated-html/**"/>
+			</fileset>
 		</war>
 		<move file="openbooks.war" todir="${deploy.dir}" overwrite="true"/>
 	</target>
@@ -46,8 +53,32 @@
 		<javac srcdir="${src.dir}" destdir="${classes.dir}" debug="true">
 			<classpath refid="compile.classpath" />
 			<exclude name="jpa/tools/**/*.java"/>
+			<exclude name="openbook/tools/**/*.java"/>
 			<exclude name="openbook/client/**/*.java"/>
 		</javac>
 	</target>
 	
+	<target name="generate-source-with-options">
+		<java2html 
+			sourcepath="${src.dir}" 
+			destDir="${generated.html.dir}" 
+			extension=".html"
+			addLineBreak="false"
+			addExplicitSpace="false"
+			verbose="false">
+			<exclude name="openbook/tools/**/*.java"/>
+			<exclude name="jpa/**/*.java"/>
+			<exclude name="openbook/util/*.java"/>
+		</java2html>
+		<java2html 
+			sourcepath="${generated.src.dir}" 
+			destDir="${generated.html.dir}" 
+			extension=".html"
+			addLineBreak="false"
+			addExplicitSpace="false"
+			verbose="false">
+		</java2html>
+
+	</target>
+	
 </project>

Modified: openjpa/trunk/openjpa-examples/openbooks/build.jse.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-examples/openbooks/build.jse.xml?rev=947920&r1=947919&r2=947920&view=diff
==============================================================================
--- openjpa/trunk/openjpa-examples/openbooks/build.jse.xml (original)
+++ openjpa/trunk/openjpa-examples/openbooks/build.jse.xml Tue May 25 05:27:19 2010
@@ -46,36 +46,64 @@
 			<include name="LICENSE.txt"/>
 		</jar>
 
-		<zip destfile="${target.dir}/openbooks.zip" basedir="${basedir}">
-			<include name="run.properties" />
-			<include name="run.xml" />
-			<include name="index.html" />
-			<include name="NOTICE.txt"/>
-			<include name="LICENSE.txt"/>
-		</zip>
-		<zip destfile="${target.dir}/openbooks.zip" basedir="${target.dir}" update="true">
-			<include name="openbooks.jar" />
-		</zip>
-		<zip destfile="${target.dir}/openbooks.zip" basedir="${rsrc.dir}" update="true">
-			<include name="load.properties" />
-			<include name="demo.properties" />
-			<include name="META-INF/persistence.xml" />
-			<include name="slides/**" />
-		</zip>
-		<zip destfile="${target.dir}/openbooks.zip" basedir="${target.dir}" update="true">
-			<include name="source/**" />
-		</zip>
-		
 		<delete dir="${deploy.dir}" failonerror="false"/>
 		<mkdir dir="${deploy.dir}"/>
-		<unzip dest="${deploy.dir}" src="${target.dir}/openbooks.zip" overwrite="true"/>
+		<copy todir="${deploy.dir}">
+			<fileset dir="${basedir}">
+				<include name="run.properties" />
+				<include name="run.xml" />
+				<include name="index.html" />
+				<include name="NOTICE.txt"/>
+				<include name="LICENSE.txt"/>
+			</fileset>
+			<fileset dir="${target.dir}">
+				<include name="openbooks.jar"/>
+			</fileset>
+			<fileset dir="${rsrc.dir}">
+				<include name="load.properties" />
+				<include name="demo.properties" />
+				<include name="META-INF/persistence.xml" />
+				<include name="slides/**" />
+			</fileset>
+		</copy>
+		<mkdir dir="${deploy.dir}/source"/>
+		<copy todir="${deploy.dir}/source">
+			<fileset dir="${generated.html.dir}">
+				<include name="**/*.css"/>
+				<include name="**/*.html"/>
+			</fileset>
+		</copy>
+
 	</target>
 	
 	<target name="compile" 
 		description="Compile classes.">
 		<javac srcdir="${src.dir}" destdir="${classes.dir}" debug="true">
 			<classpath refid="compile.classpath" />
+			<exclude name="openbook/tools/**/*.java"/>
 		</javac>
 	</target>
+	
+	<target name="generate-source-with-options">
+		<java2html 
+			sourcepath="${src.dir}" 
+			destDir="${generated.html.dir}" 
+			extension=".html"
+			addLineBreak="true"
+			addExplicitSpace="true"
+			verbose="false">
+			<exclude name="openbook/tools/**/*.java"/>
+			<exclude name="jpa/**/*.java"/>
+			<exclude name="openbook/util/*.java"/>
+		</java2html>
+		<java2html 
+			sourcepath="${generated.src.dir}" 
+			destDir="${generated.html.dir}" 
+			extension=".html"
+			addLineBreak="true"
+			addExplicitSpace="true"
+			verbose="false">
+		</java2html>
+	</target>
 
 </project>

Modified: openjpa/trunk/openjpa-examples/openbooks/build.properties
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-examples/openbooks/build.properties?rev=947920&r1=947919&r2=947920&view=diff
==============================================================================
--- openjpa/trunk/openjpa-examples/openbooks/build.properties (original)
+++ openjpa/trunk/openjpa-examples/openbooks/build.properties Tue May 25 05:27:19 2010
@@ -29,3 +29,8 @@ openjpa.version=2.1.0-SNAPSHOT
 # Though the varaible value is expressed in terms of other variables here,
 # you can specify the value directly.
 openjpa.lib=${maven.repos}/org/apache/openjpa/openjpa-all/${openjpa.version}
+
+# Requires ANTLR to generate syntax colored Java source code
+# Not essential, but otherwise you can configure demo.properties to browse
+# FishEye source code with syntax coloring
+antlr.lib=c:/antlr/antlr-3.2.jar

Modified: openjpa/trunk/openjpa-examples/openbooks/build.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-examples/openbooks/build.xml?rev=947920&r1=947919&r2=947920&view=diff
==============================================================================
--- openjpa/trunk/openjpa-examples/openbooks/build.xml (original)
+++ openjpa/trunk/openjpa-examples/openbooks/build.xml Tue May 25 05:27:19 2010
@@ -55,10 +55,10 @@
 	<property name="classes.dir"  value="${target.dir}/classes"/>
 	<!-- ================================================================== -->
 	<!-- root directory of generated canonical meta-model source files       -->
-	<property name="generated.src.dir"  value="${target.dir}/generated-sources/java"/>
+	<property name="generated.src.dir"  value="${target.dir}/generated-metamodel/java"/>
 	<!-- ================================================================== -->
 	<!-- root directory of generated html for Java source files             -->
-	<property name="generated.html.dir"  value="${target.dir}/source"/>
+	<property name="generated.html.dir"  value="${target.dir}/generated-html"/>
 	<!-- ================================================================== -->
 	<!-- directory for deployable artifacts                                 -->
 	<property name="deploy.dir"   value="${target.dir}/openbooks"/>          
@@ -74,6 +74,14 @@
 		</fileset>
 	</path>
 	
+	<path id="code.generation.classpath" 
+		description="">
+		<pathelement location="${ant.home}/ant.jar" />
+		<pathelement location="${antlr.lib}" />
+		<pathelement location="${classes.dir}" />
+	</path>
+	
+	
 	<fileset id="canonical.metamodel" dir="${src.dir}" 
 		description="Set of *.java files generated for static, cannonical domain model">
 		<include name="**/*_.java"/>
@@ -100,6 +108,7 @@
 		    description="Checks if required libraries exist"
 		    depends="info">
 		<available file="${openjpa.lib}"   property="openjpa.exists"/>
+		
 		<fail unless="openjpa.exists">*** Error:
 		   The directory for OpenJPA libraries can not be located at ${openjpa.lib}. 
 		   Make sure openjpa.lib property value is correct in build.properties file.	
@@ -118,6 +127,8 @@
 			<equals arg1="${build.mode}" arg2="jee" casesensitive="true" trim="true"/>
 		</condition>
 		<mkdir dir="${deploy.dir}"/>
+		
+		<available file="${antlr.lib}"     property="antlr.exists" />
 	</target>
 	
 	<target name="generate-canonical-model" depends="check-env"
@@ -157,7 +168,8 @@
 	             clean,
 				 generate-canonical-model,
 				 compile,
-				 enhance">
+				 enhance,
+				 generate-source">
 		<subant antfile="build.${build.mode}.xml" 
 			target="package" 
 			inheritrefs="true" 
@@ -165,4 +177,31 @@
 			buildpath="${basedir}"/>
 	</target>
 	
+	<!-- Generating viewable syntax colored Java code as html is to be split -->
+	<!-- for JSE and JEE mode for some differences in Swing based browser    -->
+	<!-- versus general purpose web browsers. Swing based browser treats     -->
+	<!-- line breaks, white spaces differently becuase it does not recognize -->
+	<!-- some critical CSS directives in this regard. This anamoly is        -->
+	<!-- accounted for by customizing Java2HTMLConverter accordingly         -->
+	<!-- see the respective target's options to notice the difference        -->
+	<target name="generate-source" depends="check-env" if="antlr.exists">
+		<javac srcdir="${src.dir}" destdir="${classes.dir}">
+			<include name="openbook/tools/**/*.java"/>
+			<exclude name="openbook/tools/**/Test*.java"/>
+			<classpath refid="code.generation.classpath"/>
+		</javac>
+		<taskdef name="java2html" classname="openbook.tools.ant.Java2HTMLConverterTask">
+			<classpath refid="code.generation.classpath"/>
+		</taskdef>
+		<delete dir="${generated.html.dir}"></delete>
+		<mkdir dir="${generated.html.dir}"/>
+		<copy file="${rsrc.dir}/java.css" todir="${generated.html.dir}"/>
+		<subant antfile="build.${build.mode}.xml" 
+			target="generate-source-with-options" 
+			inheritrefs="true" 
+			inheritall="true"
+			buildpath="${basedir}"/>
+
+	</target>
+	
 </project>



Mime
View raw message