Author: vgritsenko Date: Fri Mar 9 20:01:44 2007 New Revision: 516649 URL: http://svn.apache.org/viewvc?view=rev&rev=516649 Log: merge both build files together. remove guide targets (seems to be broken, use build in java/examples instead). some fixes to release targets. renames.
Removed: xml/xindice/trunk/contributor.xml Modified: xml/xindice/trunk/build.xml xml/xindice/trunk/src/documentation/content/xdocs/dev/todo.xml Modified: xml/xindice/trunk/build.xml URL: http://svn.apache.org/viewvc/xml/xindice/trunk/build.xml?view=diff&rev=516649&r1=516648&r2=516649 ============================================================================== --- xml/xindice/trunk/build.xml (original) +++ xml/xindice/trunk/build.xml Fri Mar 9 20:01:44 2007 @@ -39,8 +39,7 @@ - Vladimir R. Bossicard ([EMAIL PROTECTED]) - Kevin O'Neill ([EMAIL PROTECTED]) --> - -<project name="xml-xindice" default="release" basedir="."> +<project name="xml-xindice" default="build" basedir="."> <!-- - Give the chance to overwrite the definitions by setting the @@ -76,22 +75,21 @@ <fileset refid="tools.jars"/> </path> - <target name="init" description="Initializes the build"> + <target name="init"> <tstamp/> - <mkdir dir="${dist.dir}"/> <filter token="VERSION" value="${project.version}"/> </target> <!-- - Definition of the main targets --> - <target name="build" depends="src-build, test-build, guide-build" - description="Compiles the source and test code"> + <target name="compile" depends="compile-src, compile-test" + description="Compiles all the source code"> </target> - <target name="release" depends="jar-release, war-release" - description="Generates the jar and war releases into the dist directory"> + <target name="build" depends="compile, jar, war" + description="* Builds Xindice jar and war files in the dist directory"> </target> - <target name="clean" description="Removes all generates files"> + <target name="clean" description="Cleans out all generates files"> <delete dir="${build.dir}"/> <delete dir="${dist.dir}"/> </target> @@ -99,15 +97,13 @@ <!-- - Compiles the source code --> - <target name="dom-build" depends="init, clover.on"> + <target name="compile-src" depends="init, clover.on"> <mkdir dir="${dom.build.dir}"/> <javac srcdir="${dom.src.dir}" destdir="${dom.build.dir}" debug="${compile.debug}" optimize="${compile.optimize}" nowarn="${compile.nowarn}" deprecation="${compile.deprecation}" verbose="${compile.verbose}"> <classpath> <path refid="project.class.path"/> </classpath> </javac> - </target> - <target name="src-build" depends="dom-build"> <mkdir dir="${src.build.dir}"/> <javac srcdir="${src.dir}" destdir="${src.build.dir}" debug="${compile.debug}" optimize="${compile.optimize}" nowarn="${compile.nowarn}" deprecation="${compile.deprecation}" verbose="${compile.verbose}"> <classpath> @@ -118,39 +114,12 @@ </target> <target name="src-clean"> <delete dir="${src.build.dir}"/> - <antcall target="test-clean"/> - </target> - - <!-- - - Compiles and create the release for the guide code - --> - <target name="guide-build" depends="init"> - <mkdir dir="${guide.build.dir}"/> - <javac srcdir="${guide.src.dir}" destdir="${guide.build.dir}" debug="${compile.debug}" optimize="${compile.optimize}" nowarn="${compile.nowarn}" deprecation="${compile.deprecation}" verbose="${compile.verbose}"> - <classpath> - <path refid="project.class.path"/> - </classpath> - </javac> - </target> - <target name="guide-release" depends="jar-release, guide-build"> - <war destfile="${dist.dir}/${project.filename}-guide-${project.version}.war" update="false" webxml="${guide.root.dir}/config/web.xml"> - <classes dir="${src.build.dir}"/> - <manifest> - <attribute name="Built-By" value="${user.name}"/> - <section name="org/apache/xindice"> - <attribute name="Sealed" value="false"/> - </section> - </manifest> - </war> - </target> - <target name="guide-clean"> - <delete dir="${guide.build.dir}"/> </target> <!-- - Compiles and executes the tests --> - <target name="test-build" depends="src-build, clover.off"> + <target name="compile-test" depends="compile-src, clover.off"> <mkdir dir="${test.build.dir}"/> <mkdir dir="${test.result.dir}"/> <javac srcdir="${test.src.dir}" destdir="${test.build.dir}" debug="${compile.debug}" optimize="${compile.optimize}" nowarn="${compile.nowarn}" deprecation="${compile.deprecation}" verbose="${compile.verbose}"> @@ -163,25 +132,7 @@ </copy> </target> - <target name="test-validate"> - <taskdef name="testClassValidator" classname="junitx.ant.TestClassValidatorTask"> - <classpath> - <path refid="project.class.path"/> - </classpath> - </taskdef> - <testClassValidator verbose="off"> - <classpath> - <path refid="project.class.path"/> - <pathelement location="${test.build.dir}"/> - </classpath> - <fileset dir="${test.build.dir}"> - <include name="**/*Test.class"/> - <include name="**/*TestCase.class"/> - </fileset> - </testClassValidator> - </target> - - <target name="test-unit" depends="test-build, test-validate"> + <target name="test-unit" depends="compile-test"> <junit fork="yes" printsummary="yes" haltonfailure="no"> <jvmarg value="-Djava.endorsed.dirs=${basedir}/build/endorsed"/> <jvmarg value="-Dxindice.home=${basedir}"/> @@ -209,7 +160,7 @@ </junit> </target> - <target name="test-integration-embed" depends="test-build, test-validate"> + <target name="test-integration-embed" depends="compile-test"> <junit fork="yes" printsummary="yes" haltonfailure="no"> <jvmarg value="-Djava.endorsed.dirs=${basedir}/build/endorsed"/> <jvmarg value="-Dxindice.home=${basedir}"/> @@ -230,7 +181,7 @@ </junit> </target> - <target name="test-integration-uncompressed" depends="test-build, test-validate"> + <target name="test-integration-uncompressed" depends="compile-test"> <junit fork="yes" printsummary="yes" haltonfailure="no"> <jvmarg value="-Djava.endorsed.dirs=${basedir}/build/endorsed"/> <jvmarg value="-Dxindice.home=${basedir}"/> @@ -251,7 +202,7 @@ </junit> </target> - <target name="test-integration-xmlrpc" depends="test-build, test-validate"> + <target name="test-integration-xmlrpc" depends="compile-test"> <echo message="XML-RPC driver='${test.xmlrpc.driver}'"/> <echo message="XML-RPC host/port='${test.xmlrpc.hostport}'"/> <echo message="XML-RPC service location='${test.xmlrpc.service-location}'"/> @@ -280,7 +231,6 @@ <target name="test-all" depends="test-unit, test-integration-embed, test-integration-uncompressed, test-integration-xmlrpc"> </target> - <target name="test-report" depends="init"> <mkdir dir="${test.report.dir}"/> <junitreport todir="${test.result.dir}"> @@ -290,11 +240,9 @@ <report format="frames" todir="${test.report.dir}"/> </junitreport> </target> - <target name="test" depends="test-all, test-report" description="Run all tests and generate all test reports"> </target> - <target name="test-clean"> <delete dir="${test.build.dir}"/> </target> @@ -302,14 +250,8 @@ <!-- - Build the Xindice archives (jar and war) --> - <target name="dom-release" depends="dom-build"> - <jar jarfile="${dist.dir}/${project.filename}-dom-${project.version}.jar" basedir="${dom.build.dir}"> - <manifest> - <attribute name="Built-By" value="${user.name}"/> - </manifest> - </jar> - </target> - <target name="jar-release" depends="dom-release, src-build, test-build"> + <target name="jar" depends="compile"> + <mkdir dir="${dist.dir}"/> <jar jarfile="${dist.dir}/${project.filename}-${project.version}.jar" basedir="${src.build.dir}"> <manifest> <attribute name="Built-By" value="${user.name}"/> @@ -318,16 +260,23 @@ </section> </manifest> </jar> + <jar jarfile="${dist.dir}/${project.filename}-dom-${project.version}.jar" basedir="${dom.build.dir}"> + <manifest> + <attribute name="Built-By" value="${user.name}"/> + </manifest> + </jar> </target> <target name="jar-clean"> <delete file="${dist.dir}/${project.filename}-${project.version}.jar"/> <delete file="${dist.dir}/${project.filename}-dom-${project.version}.jar"/> </target> - <target name="war-release" depends="jar-release"> + + <target name="war" depends="jar"> + <mkdir dir="${dist.dir}"/> <mkdir dir="${build.dir}/war-bin"/> <copy file="${config.dir}/xindice.xml" toFile="${dist.dir}/xindice-${project.version}.xml" filtering="on"/> <copy file="${bin.dir}/xindice.war.bat" toFile="${build.dir}/war-bin/xindice.bat" filtering="on"/> - <copy file="${bin.dir}/xindice.war.sh" toFile="${build.dir}/war-bin/xindice.sh" filtering="on"/> + <copy file="${bin.dir}/xindice.war.sh" toFile="${build.dir}/war-bin/xindice" filtering="on"/> <copy file="${bin.dir}/lcp.bat" toFile="${build.dir}/war-bin/lcp.bat" filtering="on"/> <war destfile="${dist.dir}/${project.filename}-${project.version}.war" update="false" webxml="config/web.xml"> <webinf dir="${config.dir}"> @@ -355,13 +304,15 @@ <delete file="${dist.dir}/${project.filename}-${project.version}.xml"/> </target> - <target name="tomcat-deploy" depends="war-release" description="Deploys the Xindice webapp into the Tomcat installation"> - <copy file="${dist.dir}/${project.filename}-${project.version}.xml" todir="${tomcat.home}/webapps"/> - <copy file="${dist.dir}/${project.filename}-${project.version}.war" todir="${tomcat.home}/webapps"/> + <target name="tomcat-deploy" depends="war" description="Deploys the Xindice webapp into the Tomcat installation"> + <copy file="${dist.dir}/${project.filename}-${project.version}.xml" + tofile="${tomcat.home}/webapps/${webapp.name}.xml"/> + <copy file="${dist.dir}/${project.filename}-${project.version}.war" + tofile="${tomcat.home}/webapps/${webapp.name}.war"/> </target> <target name="tomcat-clean" description="Removes the deployed Xindice webapp from the Tomcat installation"> <delete dir="${tomcat.home}/webapps/${webapp.name}"/> - <delete file="${tomcat.home}/webapps/${project.filename}-${project.version}.xml"/> + <delete file="${tomcat.home}/webapps/${webapp.name}.xml"/> </target> <!-- @@ -399,7 +350,7 @@ <delete dir="${api.dir}"/> </target> - <target name="gump-target" depends="release"/> + <target name="gump-target" depends="build"/> <!-- @@ -445,5 +396,322 @@ <format type="html"/> </historical> </clover-report> + </target> + + + <!-- + - + - Tasks for preparing Xindice release artifacts + - + --> + + <!-- + - Build Xindice Website + --> + <target name="site"> + <ant antfile="${forrest.home}/forrest.antproxy.xml" target="site"/> + </target> + + <!-- + - Build Jar Releases (zip, tar.gz) + --> + <target name="release-jar"> + <mkdir dir="${build.dir}/jar-bin"/> + <mkdir dir="${build.dir}/site"/> + <mkdir dir="${api.dir}"/> + <copy file="${bin.dir}/xindice.jar.bat" toFile="${build.dir}/jar-bin/xindice.bat" filtering="on"/> + <copy file="${bin.dir}/xindice.jar.sh" toFile="${build.dir}/jar-bin/xindice" filtering="on"/> + <copy file="${bin.dir}/lcp.bat" toFile="${build.dir}/jar-bin/lcp.bat" filtering="on"/> + + <zip destfile="${dist.dir}/xml-xindice-${project.version}-jar.zip"> + <zipfileset dir="." includes="LICENSE,README,NOTICE" prefix="xindice-${project.version}"/> + <zipfileset dir="${dist.dir}" includes="xindice-${project.version}.jar,xindice-dom-${project.version}.jar" prefix="xindice-${project.version}"/> + <zipfileset dir="${build.dir}/jar-bin" includes="*" prefix="xindice-${project.version}/${bin.dir}"/> + <zipfileset dir="${jar.dir}" includes="*.jar,*.LICENSE" excludes="ant*.jar,junit*.jar" prefix="xindice-${project.version}/lib"/> + <zipfileset dir="${config.dir}" excludes="web.xml,xindice.xml,vm.cfg" prefix="xindice-${project.version}/config"/> + + <zipfileset dir="${build.dir}/site" excludes="api/index.html" prefix="xindice-${project.version}/docs"/> + <zipfileset dir="${api.dir}" prefix="xindice-${project.version}/docs/api"/> + </zip> + + <tar destfile="${build.dir}/xml-xindice-${project.version}-jar.tar"> + <tarfileset dir="." + prefix="xindice-${project.version}" + preserveLeadingSlashes="true"> + <include name="LICENSE"/> + <include name="README"/> + <include name="NOTICE"/> + </tarfileset> + <tarfileset dir="${dist.dir}" + prefix="xindice-${project.version}" + preserveLeadingSlashes="true"> + <include name="xindice-${project.version}.jar"/> + </tarfileset> + <tarfileset dir="${build.dir}/jar-bin" + mode="755" + prefix="xindice-${project.version}/${bin.dir}" + preserveLeadingSlashes="true"> + <include name="*"/> + </tarfileset> + <tarfileset dir="${config.dir}" + prefix="xindice-${project.version}/${config.dir}" + preserveLeadingSlashes="true"> + <exclude name="web.xml"/> + <exclude name="xindice.xml"/> + <exclude name="vm.cfg"/> + </tarfileset> + <tarfileset dir="${jar.dir}" + prefix="xindice-${project.version}/lib" + preserveLeadingSlashes="true"> + <include name="*.jar"/> + <include name="*.LICENSE"/> + <exclude name="ant*.jar,junit*.jar"/> + </tarfileset> + <tarfileset dir="${build.dir}/site" + prefix="xindice-${project.version}/docs" + preserveLeadingSlashes="true"> + <include name="**"/> + <exclude name="api/index.html"/> + </tarfileset> + <tarfileset dir="${api.dir}" + prefix="xindice-${project.version}/docs/api" + preserveLeadingSlashes="true"> + <include name="**"/> + </tarfileset> + </tar> + + <gzip src="${build.dir}/xml-xindice-${project.version}-jar.tar" + zipfile="${dist.dir}/xml-xindice-${project.version}-jar.tar.gz"/> + </target> + + <!-- + - Build War Releases (zip, tar.gz) + --> + <target name="release-war"> + <zip destfile="${dist.dir}/xml-xindice-${project.version}-war.zip"> + <zipfileset dir="." includes="LICENSE,README,NOTICE" prefix="xindice-${project.version}"/> + <zipfileset dir="${dist.dir}" includes="xindice-${project.version}.xml,xindice-${project.version}.war" prefix="xindice-${project.version}"/> + <zipfileset dir="${build.dir}/site" excludes="api/index.html" prefix="xindice-${project.version}/docs"/> + <zipfileset dir="${api.dir}" prefix="xindice-${project.version}/docs/api"/> + </zip> + + <tar destfile="${build.dir}/xml-xindice-${project.version}-war.tar"> + <tarfileset dir="." + prefix="xindice-${project.version}" + preserveLeadingSlashes="true"> + <include name="LICENSE"/> + <include name="README"/> + <include name="NOTICE"/> + </tarfileset> + <tarfileset dir="${dist.dir}" + prefix="xindice-${project.version}" + preserveLeadingSlashes="true"> + <include name="xindice-${project.version}.xml"/> + <include name="xindice-${project.version}.war"/> + </tarfileset> + <tarfileset dir="${build.dir}/site" + prefix="xindice-${project.version}/docs" + preserveLeadingSlashes="true"> + <include name="**"/> + <exclude name="api/index.html"/> + </tarfileset> + <tarfileset dir="${api.dir}" + prefix="xindice-${project.version}/docs/api" + preserveLeadingSlashes="true"> + <include name="**"/> + </tarfileset> + </tar> + + <gzip src="${build.dir}/xml-xindice-${project.version}-war.tar" + zipfile="${dist.dir}/xml-xindice-${project.version}-war.tar.gz"/> + </target> + + <!-- + - Build Src Releases (zip, tar.gz) + --> + <target name="release-src"> + <zip destfile="${dist.dir}/xml-xindice-${project.version}-src.zip"> + <zipfileset dir="." includes="LICENSE,README,NOTICE,build.*" prefix="xindice-${project.version}"/> + <zipfileset dir="${bin.dir}" prefix="xindice-${project.version}/${bin.dir}"/> + <zipfileset dir="${jar.dir}" prefix="xindice-${project.version}/${jar.dir}"/> + <zipfileset dir="${tools.dir}" prefix="xindice-${project.version}/${tools.dir}"/> + <zipfileset dir="${config.dir}" prefix="xindice-${project.version}/config"/> + + <zipfileset dir="${root.dir}/examples" prefix="xindice-${project.version}/${root.dir}/examples"/> + <zipfileset dir="${root.dir}/src" prefix="xindice-${project.version}/${root.dir}/src"/> + <zipfileset dir="${root.dir}/tests" prefix="xindice-${project.version}/${root.dir}/tests"/> + <zipfileset dir="${documentation.dir}" prefix="xindice-${project.version}/${documentation.dir}"/> + </zip> + + <tar destfile="${build.dir}/xml-xindice-${project.version}-src.tar"> + <tarfileset dir="." + prefix="xindice-${project.version}" + preserveLeadingSlashes="true"> + <include name="LICENSE"/> + <include name="README"/> + <include name="NOTICE"/> + <include name="build.*"/> + </tarfileset> + <tarfileset dir="${bin.dir}" + mode="755" + prefix="xindice-${project.version}/${bin.dir}" + preserveLeadingSlashes="true"> + </tarfileset> + <tarfileset dir="${jar.dir}" + prefix="xindice-${project.version}/${jar.dir}" + preserveLeadingSlashes="true"> + </tarfileset> + <tarfileset dir="${tools.dir}" + prefix="xindice-${project.version}/${tools.dir}" + preserveLeadingSlashes="true"> + </tarfileset> + <tarfileset dir="${config.dir}" + prefix="xindice-${project.version}/${config.dir}" + preserveLeadingSlashes="true"> + </tarfileset> + + <tarfileset dir="${root.dir}/examples" + prefix="xindice-${project.version}/${root.dir}/examples" + preserveLeadingSlashes="true"> + </tarfileset> + <tarfileset dir="${root.dir}/src" + prefix="xindice-${project.version}/${root.dir}/src" + preserveLeadingSlashes="true"> + </tarfileset> + <tarfileset dir="${root.dir}/tests" + prefix="xindice-${project.version}/${root.dir}/tests" + preserveLeadingSlashes="true"> + </tarfileset> + <tarfileset dir="${documentation.dir}" + prefix="xindice-${project.version}/${documentation.dir}" + preserveLeadingSlashes="true"> + </tarfileset> + </tar> + + <gzip src="${build.dir}/xml-xindice-${project.version}-src.tar" + zipfile="${dist.dir}/xml-xindice-${project.version}-src.tar.gz"/> + </target> + + <target name="release" depends="build, javadoc, site, release-jar, release-war, release-src"/> + + <!-- + - PMD is a tool that checks for various code mistakes, like unused + - variables. To ensure a good code quality, please executes this task + - every now and then and correct the problems found. + - + - Xindice is checked every hour and the result can be viewed at + - <http://pmd.sourceforge.net/cgi-bin/webpmd.pl> + - + - Out of the rules provided by PMD (1.0rc3) Xindice will be check with + - the following ones: + - [ X ] rulesets/basic.xml + - [ ] rulesets/braces.xml + - [ ] rulesets/design.xml + - [ X ] rulesets/imports.xml + - [ ] rulesets/junit.xml + - [ ] rulesets/naming.xml + - [ ] rulesets/newrules.xml + - [ ] rulesets/strings.xml + - [ X ] rulesets/unusedcode.xml + - + - Anyone is free to check Xindice with other rules, as long as they + - improve the source code. + --> + + <property name="pmd.rules" value="rulesets/basic.xml,rulesets/imports.xml,rulesets/unusedcode.xml" /> + + <target name="pmd" + description="checks for code quality"> + <taskdef name="pmd" + classname="net.sourceforge.pmd.ant.PMDTask" + classpath="${pmd.jar}" /> + <pmd reportFile="pmd.html" + verbose="false" + rulesetfiles="${pmd.rules}" + format="html" + failonerror="no"> + <fileset dir="${src.dir}"> + <include name="**/*.java"/> + </fileset> + </pmd> + </target> + + <!-- Build the Eclipse projects files --> + <target name="eclipse-project" description="Generate the Eclipse project files"> + <property name="eclipse" value="tools/eclipse"/> + + <!-- prepare the various paths that will form the project --> + <path id="srcs"> + <!-- main source dir --> + <pathelement path="${src.dir}"/> + <!-- scratchpad source dir --> + <pathelement path="${scratchpad.src.dir}"/> + <!-- unit tests dir --> + <pathelement path="${test.src.dir}"/> + <!-- examples (guide) dir --> + <pathelement path="${examples.dir}/guide/src"/> + <!-- examples (Addressbook) dir --> + <pathelement path="${examples.dir}/addressbook/src/java"/> + </path> + + <path id="libs"> + <!-- main libs --> + <fileset dir="${jar.dir}"> + <include name="*.jar"/> + </fileset> + <!-- tools libs --> + <fileset dir="${tools.dir}/lib"> + <include name="*.jar"/> + </fileset> + <!-- scratchpad libs --> + <fileset dir="${scratchpad.jar.dir}"> + <include name="*.jar"/> + </fileset> + </path> + + <!-- convert paths to properties --> + <property name="srcs" refid="srcs"/> + <property name="libs" refid="libs"/> + + <!-- expand properties in the template file --> + <copy file="${eclipse}/classpath-tmpl.xml" + tofile="${eclipse.temp}/classpath-temp.xml" + filtering="yes" + overwrite="yes"> + <filterset> + <filter token="SRC_DIRS" value="${srcs}"/> + <filter token="LIBS" value="${libs}"/> + </filterset> + </copy> + + <!-- split the path in 'item' XML elements --> + <replace file="${eclipse.temp}/classpath-temp.xml" + token="${path.separator}" value="</item>
 <item>"/> + <!-- relativize file names by removing the current directory --> + <replace file="${eclipse.temp}/classpath-temp.xml" + token="${user}${file.separator}" value=""/> + <!-- and in case that fails, remove the base directory --> + <replace file="${eclipse.temp}/classpath-temp.xml" + token="${basedir}${file.separator}" value=""/> + + <!-- replace platform-dependent path separator by '/' --> + <replace file="${eclipse.temp}/classpath-temp.xml" + token="${file.separator}" value="/"/> + + <!-- now build the .classpath file --> + <xslt in="${eclipse.temp}/classpath-temp.xml" out="${basedir}/.classpath" + processor="trax" + style="${eclipse}/make-classpath.xsl"/> + + <!-- copy the project file (expand version) --> + <copy file="${eclipse}/project" + tofile="${basedir}/.project" + overwrite="yes"> + <filterset> + <filter token="VERSION" value="${project.version}"/> + </filterset> + </copy> + + <delete file="${eclipse.temp}/classpath-temp.xml"/> </target> </project> Modified: xml/xindice/trunk/src/documentation/content/xdocs/dev/todo.xml URL: http://svn.apache.org/viewvc/xml/xindice/trunk/src/documentation/content/xdocs/dev/todo.xml?view=diff&rev=516649&r1=516648&r2=516649 ============================================================================== --- xml/xindice/trunk/src/documentation/content/xdocs/dev/todo.xml (original) +++ xml/xindice/trunk/src/documentation/content/xdocs/dev/todo.xml Fri Mar 9 20:01:44 2007 @@ -61,6 +61,9 @@ <strong>Documentation</strong> Create migration document from older releases to release 1.1. </li> + <li> + ... + </li> </ul> </section>