From: <lh...@us...> - 2008-08-20 18:41:55
|
Revision: 70 http://tmapi.svn.sourceforge.net/tmapi/?rev=70&view=rev Author: lheuer Date: 2008-08-20 18:41:50 +0000 (Wed, 20 Aug 2008) Log Message: ----------- Build files for TMAPI 2.0 a1 Added Paths: ----------- trunk/build.properties trunk/build.xml Added: trunk/build.properties =================================================================== --- trunk/build.properties (rev 0) +++ trunk/build.properties 2008-08-20 18:41:50 UTC (rev 70) @@ -0,0 +1,5 @@ +version=2.0 +version_suffix=a1 +debug=off +optimize=on + Added: trunk/build.xml =================================================================== --- trunk/build.xml (rev 0) +++ trunk/build.xml 2008-08-20 18:41:50 UTC (rev 70) @@ -0,0 +1,224 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ==================================================================== + The Topic Maps API (TMAPI) was created collectively by + the membership of the tmapi-discuss mailing list + <http://lists.sourceforge.net/mailman/listinfo/tmapi-discuss>, + is hereby released into the public domain; and comes with + NO WARRANTY. + + No one owns TMAPI: you may use it freely in both commercial and + non-commercial applications, bundle it with your software + distribution, include it on a CD-ROM, list the source code in a + book, mirror the documentation at your own web site, or use it in + any other way you see fit. + ==================================================================== + + $Rev:$ - $Date:$ +--> +<project name="TMAPI" default="jar" basedir="."> + <property file="build.properties"/> + + <property name="dir.src" value="${basedir}/src/main/java"/> + <property name="dir.test" value="${basedir}/src/test/java"/> + <property name="dir.lib" value="${basedir}/lib"/> + + <property name="lib.junit" value="${dir.lib}/junit-4.4.jar"/> + + <target name="help"> + <echo message="--------------------"/> + <echo message="TMAPI - Build file"/> + <echo message="--------------------"/> + <echo message=""/> + <echo message="Available targets:"/> + <echo message=""/> + <echo message=" jar Creates the jar (.index and .core)"/> + <echo message=" test.jar Creates the test suite jar (.index and .core)"/> + <echo message=" doc Creates the API documentation"/> + <echo message=" release Creates the jar and a distributable file"/> + </target> + + <target name="init"> + <property name="dist.version" value="${version}${version_suffix}"/> + <property name="dist.name" value="tmapi-${dist.version}"/> + + <property name="tmapi.jar" value="${dist.name}.jar"/> + <property name="tmapi-tests.jar" value="${dist.name}-tests.jar"/> + <property name="tmapi.tar" value="${dist.name}.tar"/> + <property name="tmapi.tar.gz" value="${tmapi.tar}.gz"/> + <property name="tmapi.zip" value="${dist.name}.zip"/> + + <property name="dir.build" value="${basedir}/build"/> + <property name="dir.dist.root" value="${dir.build}/dist"/> + <property name="dir.dist" value="${dir.dist.root}/${dist.name}"/> + <property name="dir.build.classes" value="${dir.build}/classes"/> + <property name="dir.build.tests" value="${dir.build}/tests"/> + <property name="dir.javadocs" value="${dir.dist}/docs/api"/> + </target> + + <!-- =================================================================== --> + <!-- Clean targets --> + <!-- =================================================================== --> + <target name="clean" depends="init"> + <delete dir="${dir.build}"/> + <delete dir="${dir.javadocs}"/> + </target> + + <!-- =================================================================== --> + <!-- Prepares the build directory --> + <!-- =================================================================== --> + <target name="prepare" depends="init"> + <mkdir dir="${dir.build}"/> + <mkdir dir="${dir.build.classes}"/> + </target> + + <!-- =================================================================== --> + <!-- Tests --> + <!-- =================================================================== --> + <target name="test" depends="compile"> + <mkdir dir="${dir.build.tests}"/> + <javac destdir="${dir.build.tests}" + debug="${debug}" + optimize="${optimize}" + target="1.5"> + <classpath> + <pathelement location="${dir.build.classes}"/> + <pathelement location="${lib.junit}"/> + </classpath> + <src path="${dir.test}"/> + </javac> + </target> + + <!-- =================================================================== --> + <!-- Internal Tests --> + <!-- =================================================================== --> + <target name="internal.tests" depends="test"> + <mkdir dir="tmp/META-INF/services"/> + <copy todir="tmp/META-INF/services"> + <fileset dir="${dir.test}"> + <include name="org.tmapi.core.TopicMapSystemFactory"/> + </fileset> + </copy> + <jar jarfile="tmapi-test.jar" basedir="tmp"/> + <junit + printsummary="true" showoutput="false" + errorProperty="test.failed" failureProperty="test.failed"> + <classpath> + <pathelement location="tmapi-test.jar"/> + <pathelement location="${dir.build.classes}"/> + <pathelement location="${dir.build.tests}"/> + </classpath> + <formatter type="plain"/> + <test name="org.tmapi.core.TestTopicMapSystemFactory"/> + </junit> + <fail message="Tests failed. Check test output." if="test.failed"/> + </target> + + <!-- =================================================================== --> + <!-- Compile source files --> + <!-- =================================================================== --> + <target name="compile" depends="clean, prepare"> + <javac destdir="${dir.build.classes}" + debug="${debug}" + target="1.5"> + <src path="${dir.src}"/> + </javac> + </target> + + <!-- =================================================================== --> + <!-- Creates the Java Docs --> + <!-- =================================================================== --> + <target name="doc" depends="init"> + <mkdir dir="${dir.javadocs}"/> + <javadoc destdir="${dir.javadocs}" + packagenames="org.tmapi.*" + author="true" + version="true" + use="true" + splitindex="true" + noindex="false" + failonerror="true" + additionalparam="-author -version" + windowtitle="TMAPI v${dist.version}" + doctitle="TMAPI v${dist.version}"> + <!-- + <doclet name="net.gleamynode.apiviz.APIviz" + path="${dir.lib}/apiviz-1.1.3.jar"> + </doclet> + --> + <fileset dir="${dir.src}"> + </fileset> + </javadoc> + + </target> + + <!-- =================================================================== --> + <!-- Creates the jar --> + <!-- =================================================================== --> + <target name="jar" depends="compile"> + <jar destfile="${dir.build}/${tmapi.jar}"> + <fileset dir="${dir.build.classes}"> + <include name="**/*.*"/> + </fileset> + <manifest> + <attribute name="Implementation-Title" value="TMAPI"/> + <attribute name="Implementation-Version" value="${dist.version}"/> + <attribute name="Implementation-URL" value="http://www.tmapi.org/"/> + </manifest> + </jar> + </target> + + <!-- =================================================================== --> + <!-- Creates the test jar --> + <!-- =================================================================== --> + <target name="test.jar" depends="test"> + <jar destfile="${dir.build}/${tmapi-tests.jar}"> + <fileset dir="${dir.build.tests}"> + <include name="**/*.*"/> + </fileset> + <manifest> + <attribute name="Implementation-Title" value="TMAPI Tests"/> + <attribute name="Implementation-Version" value="${dist.version}"/> + <attribute name="Implementation-URL" value="http://www.tmapi.org/"/> + </manifest> + </jar> + </target> + + <!-- =================================================================== --> + <!-- Prepares a distribution --> + <!-- =================================================================== --> + <target name="dist" depends="jar, test.jar, doc"> + <mkdir dir="${dir.dist}"/> + + <copy todir="${dir.dist}" file="${dir.build}/${tmapi.jar}"/> + <copy todir="${dir.dist}" file="${dir.build}/${tmapi-tests.jar}"/> + + <copy todir="${dir.dist}/src"> + <fileset dir="${dir.src}"/> + </copy> + <copy todir="${dir.dist}/test"> + <fileset dir="${dir.test}"/> + </copy> + <copy todir="${dir.dist}/lib" file="${lib.junit}"/> + <copy todir="${dir.dist}/lib" file="${dir.lib}/LICENSE.junit.html"/> + + <copy todir="${dir.dist}" file="CHANGES.txt"/> + <copy todir="${dir.dist}" file="LICENSE.txt"/> + <copy todir="${dir.dist}" file="README.txt"/> + <copy todir="${dir.dist}" file="TMAPI-1.0_MIGRATION.txt"/> + </target> + + <!-- =================================================================== --> + <!-- Creates the distribution files (.zip and .tar.gz) --> + <!-- --> + <!-- Won't create the distribution files if a test fails --> + <!-- =================================================================== --> + <target name="release" depends="internal.tests, dist"> + <tar destfile="${dir.dist.root}/${tmapi.tar}" + basedir="${dir.dist.root}"/> + <gzip src="${dir.dist.root}/${tmapi.tar}" + destfile="${dir.build}/${tmapi.tar.gz}" /> + <delete file="${dir.dist.root}/${tmapi.tar}" /> + <zip destfile="${dir.build}/${tmapi.zip}" basedir="${dir.dist.root}"/> + </target> +</project> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |