Author: arminw Date: Sun Jan 27 18:50:09 2008 New Revision: 615718 URL: http://svn.apache.org/viewvc?rev=615718&view=rev Log: exclude outdated/discontinued sources from the release improve the 'source' task separate the JDO prototype classes from normal build generation use DdlUtils as default utility to setup OJB's test-suite improve the 'ojb-blank' task add task to run the ojb-blank examples (TODO: doesn't work, fix this) declare jars shipped with OJB source distribution in build.properties file
Modified: db/ojb/branches/OJB_1_0_RELEASE/build.properties db/ojb/branches/OJB_1_0_RELEASE/build.xml Modified: db/ojb/branches/OJB_1_0_RELEASE/build.properties URL: http://svn.apache.org/viewvc/db/ojb/branches/OJB_1_0_RELEASE/build.properties?rev=615718&r1=615717&r2=615718&view=diff ============================================================================== --- db/ojb/branches/OJB_1_0_RELEASE/build.properties (original) +++ db/ojb/branches/OJB_1_0_RELEASE/build.properties Sun Jan 27 18:50:09 2008 @@ -61,25 +61,28 @@ # because this will show unsolved problems. OJB.skip.issues=true +### +# +# non-redistributable jars +# Certain jar files required for a full OJB build may not be shipped +# as part of the OJB distribution. Add the missing libraries to OJB's +# /lib directory or use the following two properties to specify the path +j2ee.jars=geronimo-*.jar +jdo.jars=jdo.jar:jdori.jar + + + +# ------------------------------------------------------------------- # ------------------------------------------------------------------- # You should NOT have to edit anything below here. # ------------------------------------------------------------------- +# ------------------------------------------------------------------- # With the 'jcdAlias' property you define a keyword for the used # connection. All test cases use this keyword. jcdAlias=default -### -# -# non-redistributable jars -# Certain jar files required for a full OJB build may not be shipped -# as part of the OJB distribution. -# -j2ee.jars=geronimo-spec-j2ee-1.4-rc2.jar -jdo.jars=jdo.jar:jdori.jar - # These properties tell ant what the project's directory structure is. -source=src src.dir=src src.java=${src.dir}/java src.test=${src.dir}/test @@ -92,15 +95,15 @@ src.ojb-blank=${src.dir}/ojb-blank src.check=${src.dir}/check config.dir=${src.dir}/config -ojb=${source}/ojb -etc=${source}/etc +etc=${src.dir}/etc test=${build.dir}/test +source=src dist=dist lib=lib bin=bin doc=doc -# These properties are used by the maven build +# These properties are used by the build file build.dir = ${basedir}/target build.src = ${build.dir}/src build.srctest = ${build.dir}/srctest @@ -133,10 +136,54 @@ # build.compiler=modern deprecation=true +# jars shipped with OJB +source-dist.lib.includes=\ +*ejb*.jar,\ +*jta*.jar,\ +*servlet*.jar,\ +ant-*.jar,\ +antlr-*.jar,\ +asm*.jar,\ +cglib*.jar,\ +commons-*.jar,\ +concurrent*.jar,\ +DdlUtils*.jar,\ +hsqldb*.jar,\ +jakarta-oro-*.jar,\ +jakarta-regexp-*.jar,\ +jcs-*.jar,\ +junit-*.jar,\ +log4j-*.jar,\ +p6spy-*.jar,\ +torque-gen-*.jar,\ +velocity-*.jar,\ +village-*jar,\ +xalan*.jar,\ +xdoclet-1.*.jar,\ +xdoclet-ojb-*.jar,\ +xjavadoc-*.jar,\ +xercesImpl-*.jar,\ +xml-apis-*.jar + # ojb-blank and tutorial properties ojb-blank.resource.excludes=repository_user.xml,web.xml -ojb-blank.lib.includes=asm*.jar,cglib*.jar,concurrent*.jar,antlr*.jar,commons*.jar\ -,hsqldb*.jar,log4j*.jar,torque*.jar,velocity*.jar,xdoclet*.jar,xjavadoc*.jar +# (include junit jar to support the shipped sample) +ojb-blank.lib.includes=\ +asm*.jar,\ +antlr*.jar,\ +cglib*.jar,\ +concurrent*.jar,\ +commons*.jar,\ +DdlUtils*.jar,\ +hsqldb*.jar,\ +jakarta-oro*.jar,\ +junit-*.jar,\ +log4j*.jar,\ +torque*.jar,\ +velocity*.jar,\ +xdoclet*.jar,\ +xjavadoc*.jar + tutorial1.src.dir=${src.samples}/tutorial1/src/java tutorial1.src.includes=org/apache/ojb/tutorial1/** @@ -164,7 +211,8 @@ webapp-sample.src.dir=${src.samples}/tutorial1-struts webapp-sample.resource.includes=OJB*.properties,repository.dtd,repository_internal.xml -webapp-sample.lib.includes=antlr*.jar,commons*.jar,hsqldb*.jar,log4j*.jar,torque*.jar,velocity*.jar,xdoclet*.jar,xjavadoc*.jar +webapp-sample.lib.includes=antlr*.jar,commons*.jar,hsqldb*.jar,log4j*.jar\ +,torque*.jar,velocity*.jar,xdoclet*.jar,xjavadoc*.jar # # Documentation properties @@ -213,18 +261,15 @@ project-name=db-ojb major=1 minor=0 -build=5 +build=5rc1 version=${major}.${minor}.${build} -versiondate=2007-01-29 +versiondate=2008-01-28 ojb-filename-prefix=${project-name}-${version} #checkstyle.version.pattern=\\$Revision.*\\$ #checkstyle.author.pattern=\\S checkstyle.license.file=${src.check}/license-check.txt -# -### ANT properties end here - ### Preprocessor flags start here # @@ -242,6 +287,5 @@ # so we need the following hints: ojbOnSwitches=JDK13 JDBC30 ojbOffSwitches= - # ### Preprocessor flags end here Modified: db/ojb/branches/OJB_1_0_RELEASE/build.xml URL: http://svn.apache.org/viewvc/db/ojb/branches/OJB_1_0_RELEASE/build.xml?rev=615718&r1=615717&r2=615718&view=diff ============================================================================== --- db/ojb/branches/OJB_1_0_RELEASE/build.xml (original) +++ db/ojb/branches/OJB_1_0_RELEASE/build.xml Sun Jan 27 18:50:09 2008 @@ -48,6 +48,33 @@ <!-- Clover initialization--> <property name="clover.initstring" location="${build.dir}/coverage.db"/> + <!-- ****************************************************************************** --> + <!-- ****************** CHECK BEFORE BUILD NEW RELEASE ***************************** --> + <!-- ****************************************************************************** --> + <!-- Pattern set to exclude outdated or non-official java files from OJB core build--> + <!-- This pattern is used by the 'prepare' task to copy the source files --> + <patternset id="build.exclude"> + <exclude name="**/ojb/jdo/**"/> + <exclude name="**/ojb/otm/**"/> + <exclude name="**/compare/PerformanceOTMTest*"/> + <exclude name="**/reversedb/**"/> + <exclude name="**/reversedb2/**"/> + <exclude name="tools/**/swing/**"/> + </patternset> + + <!-- Pattern set to exclude outdated or non-official source files from release --> + <!-- This pattern is used by the 'source-dist' task to copy the source files included + in the source distribution--> + <patternset id="sources.exclude"> + <exclude name="**/connector/**"/> + <exclude name="**/jca/**"/> + <exclude name="tools/**/reversedb/**"/> + <exclude name="tools/**/reversedb2/**"/> + <exclude name="tools/**/swing/**"/> + </patternset> + <!-- ******************************************************************************* --> + <!-- ******************************************************************************* --> + <path id="compilation-classpath"> <pathelement path="${build.dest}"/> <pathelement path="${build.desttest}"/> @@ -108,21 +135,6 @@ </not> </condition> </fail> - <fail message="Please download the JDO 1.0.1 reference implementation from http://jcp.org/aboutJava/communityprocess/final/jsr012/index2.html and copy the jdo.jar, jdori.jar and jdori-enhancer.jar contained in the reference implementation binary archive, into OJB's lib directory."> - <condition> - <not> - <and> - <!-- We're checking for a class that is not available in JDO 1.0.0 --> - <available classname="javax.jdo.JDOObjectNotFoundException" - classpathref="compilation-classpath"/> - <available classname="com.sun.jdori.enhancer.Main" - classpathref="compilation-classpath"/> - <available classname="com.sun.jdori.FieldManager" - classpathref="compilation-classpath"/> - </and> - </not> - </condition> - </fail> <fail message="In order to compile OJB with JDK 1.2 you need to download cglib from http://cglib.sourceforge.net and put the jar into OJB's lib folder."> <condition> <and> @@ -191,18 +203,25 @@ <mkdir dir="${build.desttools}"/> <mkdir dir="${build.destjca}"/> <mkdir dir="${dist}"/> + <!-- Exclude outdated/discontinued sources --> <copy todir="${build.src}"> - <fileset dir="${src.java}"/> + <fileset dir="${src.java}"> + <patternset refid="build.exclude"/> + </fileset> </copy> <copy todir="${build.srctest}"> - <fileset dir="${src.test}"/> + <fileset dir="${src.test}"> + <patternset refid="build.exclude"/> + </fileset> </copy> <copy todir="${build.srctools}"> - <fileset dir="${src.tools}"/> + <fileset dir="${src.tools}"> + <patternset refid="build.exclude"/> + </fileset> </copy> - <copy todir="${build.srcjca}"> - <fileset dir="${src.jca}"/> - </copy> + <!--<copy todir="${build.srcjca}">--> + <!--<fileset dir="${src.jca}"/>--> + <!--</copy>--> </target> <!-- ================================================================== --> @@ -270,16 +289,45 @@ debug="on" debuglevel="source,lines,vars" deprecation="${deprecation}"> <classpath refid="compilation-classpath" /> </javac> + <!--<javac srcdir="${build.srcjca}" destdir="${build.destjca}" excludes="${excludes}"--> + <!--debug="on" deprecation="${deprecation}">--> + <!--<classpath refid="compilation-classpath" />--> + <!--</javac>--> </target> <!-- include OJB JDORI implementation --> <target name="with-jdori" depends="prepare" description="Compile OJB JDORI"> - <copy todir="${build.src}"> + <fail message="Please download the JDO 1.0.1 reference implementation from http://jcp.org/aboutJava/communityprocess/final/jsr012/index2.html and copy the jdo.jar, jdori.jar and jdori-enhancer.jar contained in the reference implementation binary archive, into OJB's lib directory."> + <condition> + <not> + <and> + <!-- We're checking for a class that is not available in JDO 1.0.0 --> + <available classname="javax.jdo.JDOObjectNotFoundException" + classpathref="compilation-classpath"/> + <available classname="com.sun.jdori.enhancer.Main" + classpathref="compilation-classpath"/> + <available classname="com.sun.jdori.FieldManager" + classpathref="compilation-classpath"/> + </and> + </not> + </condition> + </fail> + <copy todir="${build.src}"> <fileset dir="${src.dir}/jdori"/> </copy> </target> + <!-- include OJB OTM-API implementation --> + <target name="with-otm" depends="prepare" + description="Compile OJB with OTM-API"> + <copy todir="${build.src}"> + <fileset dir="${src.dir}"> + <include name="**/ojb/otm/**"/> + </fileset> + </copy> + </target> + <!-- ================================================================== --> <!-- cleanup, preprocessing, compile and building --> <!-- of oql parser and documentation --> @@ -304,10 +352,10 @@ debug="off" deprecation="off" optimize="on"> <classpath refid="compilation-classpath"/> </javac> - <javac srcdir="${build.srcjca}" destdir="${build.destjca}" excludes="${excludes}" - debug="on" deprecation="${deprecation}"> - <classpath refid="compilation-classpath" /> - </javac> + <!--<javac srcdir="${build.srcjca}" destdir="${build.destjca}" excludes="${excludes}"--> + <!--debug="on" deprecation="${deprecation}">--> + <!--<classpath refid="compilation-classpath" />--> + <!--</javac>--> </target> <!-- ================================================================== --> @@ -338,12 +386,6 @@ <delete dir="${build.test}" verbose="false"/> <mkdir dir="${build.test}"/> <mkdir dir="${build.test}/ojb"/> - <echo message="Preparing properties for database: ${dbmsName}"/> - <echo message=" --> jdbcLevel: ${jdbcLevel}"/> - <echo message=" --> jdbcRuntimeDriver: ${jdbcRuntimeDriver}"/> - <echo message=" --> urlProtocol: ${urlProtocol}"/> - <echo message=" --> urlSubprotocol: ${urlSubprotocol}"/> - <echo message=" --> urlDbalias: ${urlDbalias}"/> <copy todir="${build.test}/ojb"> <filterset> <filter token="JCD_ALIAS" value="${jcdAlias}" /> @@ -424,46 +466,22 @@ description="prepare testdb using DdlUtils" depends="prepare, prepare-repository" unless="use-torque"> - <taskdef name="ddl2Database" - classname="org.apache.ddlutils.task.DdlToDatabaseTask" - classpathref="runtime-classpath"/> - <taskdef name="ojbData" - classname="org.apache.ojb.broker.ant.RepositoryDataTask" - classpathref="runtime-classpath"/> - - <copy todir="${build.test}"> - <fileset dir="${src.dir}/schema" includes="*.xml,*.dtd"/> - <filterset> - <filter token="DATABASE_DEFAULT" value="${project}" /> - </filterset> - </copy> - <!-- If the database profile didn't specify that the database needs a shutdown, we won't do so --> - <property name="ddlutils.shutdownDatabase" value="false"/> - <ddl2Database usedelimitedsqlidentifiers="false" - shutdowndatabase="${ddlutils.shutdownDatabase}"> - <database driverclassname="${torque.database.driver}" - url="${torque.database.createUrl}" - username="${torque.database.user}" - password="${torque.database.password}"/> - <fileset dir="${build.test}" - includes="*schema.xml"/> - - <createdatabase failonerror="false"/> - <writeschemasqltofile alterdatabase="false" outputfile="${build.test}/ojbtest-schema.sql"/> - <writeschematodatabase alterdatabase="false"/> - </ddl2Database> - <ojbData usedelimitedsqlidentifiers="false" - shutdowndatabase="${ddlutils.shutdownDatabase}" - ojbpropertiesfile="${build.test}/ojb/OJB.properties" > - <database driverclassname="${torque.database.driver}" - url="${torque.database.createUrl}" - username="${torque.database.user}" - password="${torque.database.password}"/> - <fileset dir="${build.test}" - includes="*schema.xml"/> - <writedatatodatabase datafile="${build.test}/ojbtest-data-new.xml"/> - </ojbData> - </target> + + <ant dir="." + antfile="build-ddlutils.xml" + target="create-db" inheritrefs="true"> + <reference refid="runtime-classpath"/> + <property name="target.dir" value="${build.test}"/> + <property name="schema.src.dir" value="${src.dir}/schema"/> + <property name="schema.target.dir" value="${build.test}"/> + <property name="project.name" value="${torque.project}"/> + <property name="database.driver" value="${torque.database.driver}"/> + <property name="database.url" value="${torque.database.createUrl}"/> + <property name="database.user" value="${torque.database.user}"/> + <property name="database.password" value="${torque.database.password}"/> + <property name="ojb.properties.file" value="${build.test}/ojb"/> + </ant> + </target> <!-- ================================================================== --> <!-- dump testdb using torque --> @@ -658,19 +676,22 @@ <target name="ojb-blank" depends="init,jar-debug" description="Build a sample project"> <property name="build.ojb-blank" value="${build.dir}/ojb-blank"/> + <property name="ojb-blank.src.dir" value="${build.ojb-blank}/src"/> + <property name="ojb-blank.sample.dir" value="${ojb-blank.src.dir}/sample"/> <delete file="${dist}/ojb-blank.jar" failonerror="false"/> <delete dir="${build.ojb-blank}" verbose="false" failonerror="false"/> <mkdir dir="${build.ojb-blank}"/> - <mkdir dir="${build.ojb-blank}/src"/> - <mkdir dir="${build.ojb-blank}/src/java"/> - <mkdir dir="${build.ojb-blank}/src/schema"/> - <mkdir dir="${build.ojb-blank}/src/resources"/> - <mkdir dir="${build.ojb-blank}/src/test"/> + <mkdir dir="${ojb-blank.src.dir}"/> + <mkdir dir="${ojb-blank.src.dir}/java"/> + <mkdir dir="${ojb-blank.src.dir}/schema"/> + <mkdir dir="${ojb-blank.src.dir}/resources"/> + <mkdir dir="${ojb-blank.src.dir}/test"/> + <mkdir dir="${ojb-blank.sample.dir}"/> <mkdir dir="${build.ojb-blank}/lib"/> <copy file="${dist}/${archive}.jar" todir="${build.ojb-blank}/lib"/> - <copy todir="${build.ojb-blank}/src/resources"> + <copy todir="${ojb-blank.src.dir}/resources"> <fileset dir="${config.dir}" excludes="${ojb-blank.resource.excludes}"/> <filterset> @@ -687,23 +708,67 @@ </filterset> </copy> - <copy todir="${build.ojb-blank}/src/schema"> + <copy todir="${ojb-blank.src.dir}/schema"> <fileset dir="${source}/schema"> <include name="ojbcore-schema.xml"/> </fileset> </copy> - <copy file="build-torque.xml" todir="${build.ojb-blank}/src/schema"/> + <copy file="build-torque.xml" todir="${build.ojb-blank}"/> + <copy file="build-ddlutils.xml" todir="${build.ojb-blank}"/> <copy todir="${build.ojb-blank}/lib"> <fileset dir="${lib}" includes="${ojb-blank.lib.includes}"/> </copy> + <copy todir="${ojb-blank.sample.dir}"> + <fileset dir="${source}/xdoclet/sample"> + <include name="**/*.java"/> + </fileset> + </copy> + <jar jarfile="${dist}/ojb-blank.jar" basedir="${build.dir}" includes="ojb-blank/**"/> </target> + <!-- =================================================================== --> + <!-- Run an complex sample using OJB's xdoclet module and the current DB --> + <!-- =================================================================== --> + <!-- TODO: FIX this! This target cause an error --> + <target name="ojb-blank-sample-run" depends="ojb-blank" + description="Run a complex sample using OJB's xdoclet module"> + + <property name="sample.test.dir" value="${build.dir}/ojb-blank-sample-test"/> + <property name="sample.test.base" value="${sample.test.dir}/ojb-blank"/> + <property name="sample.test.lib" value="${sample.test.base}/lib"/> + + <echo message="* ${sample.test.dir}: unjar ojb-blank to test dir *"/> + <sleep seconds="1"/> + <delete dir="${sample.test.dir}"/> + <unjar src="${dist}/ojb-blank.jar" dest="${sample.test.dir}"/> + <copy todir="${sample.test.lib}"> + <fileset dir="${lib}" includes="junit*.jar"/> + </copy> + + <!--<echo message="* ${sample.test.base}: Execute ojb-blank sample project build target *"/>--> + <!--<sleep seconds="1"/>--> + <!--<ant antfile="${sample.test.base}/build.xml"--> + <!--inheritall="false"--> + <!--dir="${sample.test.base}"--> + <!--target="sample-build">--> + <!--</ant>--> + + <echo message="* ${sample.test.base}: Execute ojb-blank sample project test class *"/> + <sleep seconds="1"/> + <ant antfile="${sample.test.base}/build.xml" + inheritall="false" + inheritrefs="false" + dir="${sample.test.base}" + target="sample-run"> + </ant> + </target> + <!-- ================================================================== --> <!-- Build quickstart samples using hsqldb --> <!-- ================================================================== --> @@ -1067,61 +1132,70 @@ <!-- ================================================================== --> <!-- Build the source distribution --> <!-- ================================================================== --> - <target name="source" depends="prepare" + <target name="source" depends="prepare,jar" description="Builds the ojb source distribution in the dist directory."> - <delete file="${dist}/${archive}-src.tgz"/> - <delete file="${dist}/${archive}-src.zip"/> <delete dir="${build.dir}/${archive}"/> <mkdir dir="${build.dir}/${archive}"/> - <mkdir dir="${build.dir}/${archive}/bin"/> - <copy todir="${build.dir}/${archive}/bin"> - <fileset dir="${bin}"/> + <copy todir="${build.dir}/${archive}"> + <fileset dir="." includes="*.sh,*.bat,*.xml,*.html,*.txt,*.properties,LICENSE,NOTICE"/> </copy> - <mkdir dir="${build.dir}/${archive}/src"/> - <copy todir="${build.dir}/${archive}/src"> - <fileset dir="${source}"/> - </copy> + <!--<mkdir dir="${build.dir}/${archive}/contrib"/>--> + <!--<copy todir="${build.dir}/${archive}/contrib">--> + <!--<fileset dir="contrib"/>--> + <!--</copy>--> <mkdir dir="${build.dir}/${archive}/lib"/> <copy todir="${build.dir}/${archive}/lib"> - <fileset dir="${lib}"> - <include name="*.jar"/> - <exclude name="jdo.jar"/> - <exclude name="jdori.jar"/> - <exclude name="jdori-enhancer.jar"/> - <exclude name="ejb.jar"/> - <exclude name="servlet.jar"/> - <exclude name="jta-spec1_0_1.jar"/> - <exclude name="j2ee.jar"/> - <exclude name="jndi.jar"/> - <exclude name="proxy.jar"/> - <exclude name="db2java.jar"/> - <exclude name="db2jcc.jar"/> + <fileset dir="${lib}" includes="${source-dist.lib.includes}"> + <exclude name="*jdo*.jar"/> </fileset> </copy> - <mkdir dir="${build.dir}/${archive}/contrib"/> - <mkdir dir="${build.dir}/${archive}/profile"/> <copy todir="${build.dir}/${archive}/profile"> <fileset dir="profile"/> </copy> - <copy todir="${build.dir}/${archive}"> - <fileset dir="." includes="*.sh,*.bat,*.xml,*.html,*.txt,*.properties,LICENSE,NOTICE"/> + <mkdir dir="${build.dir}/${archive}/samples"/> + <copy todir="${build.dir}/${archive}/samples"> + <fileset dir="samples"/> + </copy> + + <mkdir dir="${build.dir}/${archive}/src"/> + <copy todir="${build.dir}/${archive}/src"> + <fileset dir="${source}"> + <patternset refid="sources.exclude"/> + </fileset> + </copy> + + <mkdir dir="${build.dir}/${archive}/doc"/> + <copy todir="${build.dir}/${archive}/doc"> + <fileset dir="${doc}"> + <exclude name="**/*.pdf"/> + </fileset> </copy> + + <mkdir dir="${build.dir}/${archive}/dist"/> + <copy todir="${build.dir}/${archive}/dist"> + <fileset dir="dist"> + <include name="${archive}.jar"/> + </fileset> + </copy> + <chmod dir="${build.dir}/${archive}" perm="ugo+rwx" includes="*.sh"/> <tar includes="${archive}/**" basedir="${build.dir}" tarfile="${dist}/${archive}-src.tar"/> + <delete file="${dist}/${archive}-src.tgz"/> <gzip src="${dist}/${archive}-src.tar" zipfile="${dist}/${archive}-src.tgz"/> <delete file="${dist}/${archive}-src.tar"/> - <zip zipfile="${dist}/${archive}-src.zip" + <delete file="${dist}/${archive}-src.zip"/> + <zip level="9" zipfile="${dist}/${archive}-src.zip" basedir="${build.dir}" includes="${archive}/**"/> </target> @@ -1138,7 +1212,7 @@ <!-- and documentation --> <!-- ================================================================== --> <target name="release" - depends="clean,with-jdori,jar,source,docs,tarball,website,contrib,ojb-blank,sample-jars,webapp-sample,checksums" + depends="clean,jar,source,docs,tarball,website,contrib,ojb-blank,sample-jars,webapp-sample,checksums" description="Cleans and builds all release archives." /> <!-- ================================================================== --> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]