openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dwo...@apache.org
Subject svn commit: r944476 - in /openjpa/trunk/openjpa-examples/openbooks: ./ src/main/java/openbook/domain/
Date Fri, 14 May 2010 21:17:03 GMT
Author: dwoods
Date: Fri May 14 21:17:02 2010
New Revision: 944476

URL: http://svn.apache.org/viewvc?rev=944476&view=rev
Log:
openbooks updates: now the maven generated jar matches the ant created one, meta-model generated
*_.java files are no longer created in the source tree but are still in the built jar and
passed to java2html

Removed:
    openjpa/trunk/openjpa-examples/openbooks/src/main/java/openbook/domain/Author_.java
    openjpa/trunk/openjpa-examples/openbooks/src/main/java/openbook/domain/Book_.java
    openjpa/trunk/openjpa-examples/openbooks/src/main/java/openbook/domain/Customer_.java
    openjpa/trunk/openjpa-examples/openbooks/src/main/java/openbook/domain/Inventory_.java
    openjpa/trunk/openjpa-examples/openbooks/src/main/java/openbook/domain/LineItem_.java
    openjpa/trunk/openjpa-examples/openbooks/src/main/java/openbook/domain/PurchaseOrder_.java
Modified:
    openjpa/trunk/openjpa-examples/openbooks/build.xml
    openjpa/trunk/openjpa-examples/openbooks/pom.xml

Modified: openjpa/trunk/openjpa-examples/openbooks/build.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-examples/openbooks/build.xml?rev=944476&r1=944475&r2=944476&view=diff
==============================================================================
--- openjpa/trunk/openjpa-examples/openbooks/build.xml (original)
+++ openjpa/trunk/openjpa-examples/openbooks/build.xml Fri May 14 21:17:02 2010
@@ -30,9 +30,10 @@
 	<property name="jpa.provider" value="openjpa" />
 	<property name="src.dir"      value="${basedir}/src/main/java"/>
 	<property name="rsrc.dir"     value="${basedir}/src/main/resources"/>
+	<property name="msrc.dir"     value="${basedir}/target/generated-sources/java"/>
 	<property name="classes.dir"  value="${basedir}/target/classes"/>
 	<property name="deploy.dir"   value="${basedir}/target/openbooks"/>
-	<property name="generated.html.dir"  value="${basedir}/target/site"/>
+	<property name="generated.html.dir"  value="${basedir}/target/source"/>
 
 	<property name="jpa.properties"  value="META-INF/persistence.xml#OpenBooks" />
 
@@ -85,8 +86,12 @@
 		</fail>
 	</target>
 	
-	<target name="compile" depends="check-env,clean"
+	<target name="build" depends="check-env,genmodel,compile,enhance"
 		description="Compilation will also generate canonical meta-model classes.">
+	</target>
+	<target name="genmodel" depends="check-env"
+		description="Generate canonical meta-model source">
+		<mkdir dir="${msrc.dir}" />
 		<mkdir dir="${classes.dir}" />
 		<javac srcdir="${src.dir}" destdir="${classes.dir}" debug="true">
 			<classpath refid="compile.classpath" />
@@ -94,11 +99,17 @@
 			<compilerarg value="-Aopenjpa.metamodel=true" />
 			<compilerarg value="-Aopenjpa.log=TRACE" />
 			<compilerarg value="-s"/>
-			<compilerarg value="${src.dir}" />
+			<compilerarg value="${msrc.dir}" />
 		</javac>
+	</target>
+	<target name="compile" depends="genmodel"
+		description="Compile classes.">
 		<javac srcdir="${src.dir}" destdir="${classes.dir}" debug="true">
 			<classpath refid="compile.classpath" />
 		</javac>
+	</target>
+	<target name="enhance" depends="check-env"
+		description="Enhance classes.">
 		<java classname="org.apache.openjpa.enhance.PCEnhancer" fork="true">
 			<arg value="-properties" />
 			<arg value="${jpa.properties}" />
@@ -106,7 +117,7 @@
 		</java>
 	</target>
 	
-	<target name="package" depends="clean,compile,generate-html-source"
+	<target name="package" depends="clean,build,generate-html-source"
 		description="Generates HTML version of source code and creates distribution layout">
 		<delete file="${basedir}/target/openbooks.jar" failonerror="false"/>
 		<delete file="${basedir}/target/openbooks.zip" failonerror="false"/>
@@ -126,6 +137,7 @@
 			<include name="NOTICE.txt"/>
 			<include name="LICENSE.txt"/>
 		</jar>
+
 		<zip destfile="${basedir}/target/openbooks.zip" basedir="${basedir}">
 			<include name="run.properties" />
 			<include name="run.xml" />
@@ -141,6 +153,8 @@
 			<include name="demo.properties" />
 			<include name="META-INF/persistence.xml" />
 			<include name="slides/**" />
+		</zip>
+		<zip destfile="${basedir}/target/openbooks.zip" basedir="${basedir}/target" update="true">
 			<include name="source/**" />
 		</zip>
 	</target>
@@ -156,6 +170,7 @@
 		description="Generates HTML Source Code using Java2HTML utility">
 		<delete dir="${generated.html.dir}" failonerror="false"/>
 		<mkdir dir="${generated.html.dir}"/>
+                <!-- Create HTML of svn source files -->
 		<java classname="de.java2html.Java2Html" fork="true">
 			<classpath refid="java2html.classpath"/>
 			<arg value="-srcdir"/>
@@ -165,6 +180,16 @@
 			<arg value="-style"/>
 			<arg value="Eclipse"/>
 		</java>
+                <!-- Create HTML of meta-model generated source files -->
+		<java classname="de.java2html.Java2Html" fork="true">
+			<classpath refid="java2html.classpath"/>
+			<arg value="-srcdir"/>
+			<arg value="${msrc.dir}"/>
+			<arg value="-targetdir"/>
+			<arg value="${generated.html.dir}"/>
+			<arg value="-style"/>
+			<arg value="Eclipse"/>
+		</java>
 		<replace dir="${generated.html.dir}" token="10pt" value="14pt">
 	    </replace>
     </target>

Modified: openjpa/trunk/openjpa-examples/openbooks/pom.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-examples/openbooks/pom.xml?rev=944476&r1=944475&r2=944476&view=diff
==============================================================================
--- openjpa/trunk/openjpa-examples/openbooks/pom.xml (original)
+++ openjpa/trunk/openjpa-examples/openbooks/pom.xml Fri May 14 21:17:02 2010
@@ -76,14 +76,49 @@
                         <artifactId>maven-antrun-plugin</artifactId>
                         <executions>
                             <execution>
-                                <id>build</id>
+                                <id>genmodel</id>
+                                <phase>process-resources</phase>
                                 <configuration>
                                     <tasks>
-                                        <echo>Running OpenBooks Build</echo>
+                                        <echo>Running OpenBooks genmodel</echo>
                                         <property name="openjpa.version" value="${project.version}"
/>
                                         <property name="maven.repos" value="${settings.localRepository}"
/>
                                         <ant antfile="${basedir}/build.xml">
-                                            <target name="package" />
+                                            <target name="genmodel" />
+                                        </ant>
+                                    </tasks>
+                                </configuration>
+                                <goals>
+                                    <goal>run</goal>
+                                </goals>
+                            </execution>
+                            <execution>
+                                <id>enhance</id>
+                                <phase>process-classes</phase>
+                                <configuration>
+                                    <tasks>
+                                        <echo>Running OpenBooks Enhance</echo>
+                                        <property name="openjpa.version" value="${project.version}"
/>
+                                        <property name="maven.repos" value="${settings.localRepository}"
/>
+                                        <ant antfile="${basedir}/build.xml">
+                                            <target name="enhance" />
+                                        </ant>
+                                    </tasks>
+                                </configuration>
+                                <goals>
+                                    <goal>run</goal>
+                                </goals>
+                            </execution>
+                            <execution>
+                                <id>generate-html-source</id>
+                                <phase>prepare-package</phase>
+                                <configuration>
+                                    <tasks>
+                                        <echo>Running OpenBooks Generate HTML Source</echo>
+                                        <property name="openjpa.version" value="${project.version}"
/>
+                                        <property name="maven.repos" value="${settings.localRepository}"
/>
+                                        <ant antfile="${basedir}/build.xml">
+                                            <target name="generate-html-source" />
                                         </ant>
                                     </tasks>
                                 </configuration>



Mime
View raw message