1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314
|
<?xml version="1.0" encoding="UTF-8"?>
<!--
This ANT build script provides common functionality that all SwingLabs projects may
take advantage of. Similar to the NetBeans build-impl.xml file, this file declares
a few ant tasks which may be overridden by the build.xml file, or simply called to
directly.
This file defines three core targets, "bundles", "javadoc", and "coverage".
The "bundles" target will create the bin.zip and src.zip deliverables for the project.
Properties that can be used to dictate the name of these bundles, and the location
of these bundles, can be specified in the project.properties file.
The "javadoc" target can be used to create more complete JavaDocs. References to core
JDK classes will be linked, and methods with the @inheritDoc JavaDoc tag will actually
inherit the doc. Note however, that this may require some setup on your system to work
properly.
The "coverage" target uses EMMA to compute the test coverage. That is, it computes
what percentage of the project is covered by unit tests. Properties can also be set
to govern how this coverage is computed.
As with the NetBeans build-impl.xml file, there are -pre and -post targets declared
for each of these core targets, allowing you to customize in the build.xml file
how these targets are executed.
This build script must be placed in the root directory alongside the build.xml file.
For the purpose of easier reading the script
is divided into following sections:
- bundles
- coverage
- javadoc
Version 1.0
-->
<project name="swinglabs-build-impl" default="bundles" basedir=".">
<!--
======================
INITIALIZATION SECTION
======================
-->
<!-- path element used by EMMA taskdef below: -->
<!--<path id="emma.lib" >
<pathelement location="${emma.dir}/emma.jar" />
<pathelement location="${emma.dir}/emma_ant.jar" />
</path>-->
<!-- this loads <emma> and <emmajava> custom tasks: -->
<!--<taskdef resource="emma_ant.properties" classpathref="emma.lib" />-->
<!--
======================
BUNDLES SECTION
======================
-->
<target name="-pre-bundles-init" />
<!--
Configures the RELEASE_DSTAMP variable, which is used to create the timestamp
used for building the bundles
-->
<target name="-bundles-init">
<tstamp>
<format property="RELEASE_DSTAMP" pattern="yyyy_MM_dd" />
</tstamp>
</target>
<target name="-post-bundles-init" />
<!--
Creates the dist.bundles.dir directory
-->
<target name="-pre-bundles">
<mkdir dir="${dist.bundles.dir}" />
</target>
<target name="-do-bundles" depends="-pre-bin-bundle,-do-bin-bundle,-post-bin-bundle,-pre-src-bundle,-do-src-bundle,-post-src-bundle,-pre-doc-bundle,-do-doc-bundle,-post-doc-bundle" />
<target name="-post-bundles" />
<target name="bundles" depends="init,jar,javadoc,-pre-bundles-init,-bundles-init,-post-bundles-init,-pre-bundles,-do-bundles,-post-bundles" />
<target name="update-posted-file" depends="init" if="posted.txt">
<tstamp>
<format property="RELEASE_DSTAMP_LONG" pattern="'week'-w-yyyy-MM-dd" />
</tstamp>
<!--MAIN week-42-2006-10-15 swingx-ws-->
<!--NOTE: The spacing in this next tag is critical. -->
<concat destfile="${posted.txt}" append="true">
${build.branch} ${RELEASE_DSTAMP_LONG} ${projectname}</concat>
</target>
<target name="-pre-doc-bundle" />
<target name="-do-doc-bundle">
<zip basedir="${dist.javadoc.dir}" zipfile="${dist.bundles.dir}/${projectname}-${RELEASE_DSTAMP}-javadoc.zip" compress="${javadoc.compress}"/>
</target>
<target name="-post-doc-bundle" />
<target name="-pre-bin-bundle" />
<target name="-do-bin-bundle">
<zip destfile="${dist.bundles.dir}/${projectname}-${RELEASE_DSTAMP}-bin.zip">
<zipfileset dir="." includes="COPYING" prefix="${projectname}-${RELEASE_DSTAMP}-bin"/>
<zipfileset dir="${bundles.doc.dir}" prefix="${projectname}-${RELEASE_DSTAMP}-bin/docs"/>
<zipfileset dir="${dist.javadoc.dir}" prefix="${projectname}-${RELEASE_DSTAMP}-bin/docs/javadoc"/>
<zipfileset dir="lib" includes="**/*.jar" excludes="**/build-only/**" prefix="${projectname}-${RELEASE_DSTAMP}-bin/lib"/>
<zipfileset file="${dist.jar}" fullpath="${projectname}-${RELEASE_DSTAMP}-bin/${projectname}-${RELEASE_DSTAMP}.jar"/>
<zipfileset file="${dist.beaninfo.jar}" fullpath="${projectname}-${RELEASE_DSTAMP}-bin/${projectname}-beaninfo-${RELEASE_DSTAMP}.jar"/>
</zip>
</target>
<target name="-post-bin-bundle" />
<target name="-pre-src-bundle" />
<target name="-do-src-bundle">
<mkdir dir="${build.bundles.dir}" />
<mkdir dir="${build.bundles.dir}/src" />
<copy todir="${build.bundles.dir}/src">
<fileset dir=".">
<exclude name="${build.dir}/**" />
<exclude name="${dist.dir}/**" />
<exclude name="www/**" /> <!-- TODO!! -->
<exclude name="**/CVS/**" /> <!-- TODO!! -->
<!-- If anything else needs to be exluded, do so here -->
</fileset>
</copy>
<!-- zip up the whole thing -->
<delete dir="${build.bundles.dir}/zipdir" />
<mkdir dir="${build.bundles.dir}/zipdir" />
<mkdir dir="${build.bundles.dir}/zipdir/${projectname}-${RELEASE_DSTAMP}-src" />
<move todir="${build.bundles.dir}/zipdir/${projectname}-${RELEASE_DSTAMP}-src">
<fileset dir="${build.bundles.dir}/src" />
</move>
<zip basedir="${build.bundles.dir}/zipdir" destfile="${dist.bundles.dir}/${projectname}-${RELEASE_DSTAMP}-src.zip" />
<delete dir="${build.bundles.dir}/zipdir" />
</target>
<target name="-post-src-bundle" />
<!--
======================
COVERAGE SECTION
======================
-->
<target name="-pre-coverage" />
<target name="-do-coverage" unless="skip.coverage">
<delete dir="${build.dir}/emma" />
<mkdir dir="${build.dir}/emma" />
<taskdef name="emma" classname="com.vladium.emma.emmaTask" classpath="${emma.dir}/emma.jar:${emma.dir}/emma_ant.jar" />
<emma>
<instr instrpath="${build.classes.dir}" destdir="${build.dir}/emma" metadatafile="${basedir}/metadata.em"/>
</emma>
<echo message="${build.dir}/emma:${run.test.classpath}" />
<junit showoutput="true" fork="true" dir="${basedir}" failureproperty="tests.failed" errorproperty="tests.failed">
<batchtest todir="${build.test.results.dir}">
<fileset dir="${test.test.dir}" includes="**/*Test.java"/>
</batchtest>
<classpath>
<path path="${build.dir}/emma" />
<path path="${emma.dir}/emma.jar" />
<path path="${emma.dir}/emma_ant.jar" />
<path path="${run.test.classpath}"/>
</classpath>
<syspropertyset>
<propertyref prefix="test-sys-prop."/>
<mapper type="glob" from="test-sys-prop.*" to="*"/>
</syspropertyset>
<formatter type="brief" usefile="false"/>
<formatter type="xml"/>
<jvmarg line="${run.jvmargs}"/>
</junit>
<delete dir="${build.dir}/emma" />
<mkdir dir="${dist.dir}/coverage" />
<emma>
<report sourcepath="${emma.report.srcpath}">
<fileset dir="${basedir}" >
<include name="coverage.ec" />
<include name="metadata.em" />
</fileset>
<!-- shouldn't have had to use basedir here, but it looks like a bug makes me do it -->
<html outfile="${basedir}/${dist.dir}/coverage/index.html" />
<xml outfile="${basedir}/${dist.dir}/coverage/coverage.xml" />
</report>
</emma>
<!--<delete file="${basedir}/coverage.ec" />-->
</target>
<target name="-post-coverage" />
<!-- this -->
<target name="coverage" depends="init,jar,compile-test,-pre-test-run,-pre-coverage,-do-coverage,-post-coverage,test-report" if="emma.dir" >
<!--
<fail if="tests.failed">Some tests failed; see details above.</fail>
-->
</target>
<!--
======================
JAVADOC SECTION
======================
-->
<target name="-javadoc-build" depends="init">
<property name="javadoc.core.src" value=""/>
<property name="javadoc.core.linkexternal" value="http://java.sun.com/j2se/1.5.0/docs/api/"/>
<property name="javadoc.core.packagelist" value=""/>
<property name="javadoc.verbose" value="false"/>
<echo>Using custom javadoc target:
core src: ${javadoc.core.src}
core external: ${javadoc.core.linkexternal}
core packagelist: ${javadoc.core.packagelist}
</echo>
<mkdir dir="${dist.javadoc.dir}"/>
<javadoc destdir="${dist.javadoc.dir}"
packagenames="org.jdesktop.*"
defaultexcludes="yes"
notree="${javadoc.notree}" use="${javadoc.use}"
nonavbar="${javadoc.nonavbar}" noindex="${javadoc.noindex}"
splitindex="${javadoc.splitindex}" author="${javadoc.author}"
version="${javadoc.version}"
windowtitle="${javadoc.windowtitle}"
private="${javadoc.private}"
additionalparam="${javadoc.additionalparam}"
failonerror="false" useexternalfile="false"
verbose="${javadoc.verbose}"
maxmemory="1024M"
sourcepath="${javadoc.srcpath}">
<excludepackage name="java.*"/>
<excludepackage name="javax.*"/>
<link offline="true" href="${javadoc.core.linkexternal}"
packagelistLoc="${javadoc.core.packagelist}"/>
<classpath>
<path path="${run.classpath}"/>
</classpath>
<taglet name="org.jdesktop.swinglabs.javadoc.DemoTaglet">
<path path="${demo.taglet.jar}" />
</taglet>
<tag name="status" description="Review status:"/>
<tag name="beaninfo" description="This class has associated bean info for instrumenting visual editors named " scope="methods"/>
<tag name="javabean.property" scope="methods"/>
<tag name="javabean.attribute" scope="types"/>
<tag name="javabean.class" scope="types"/>
<tag name="javabean.icons" scope="types"/>
<tag name="impl" scope="methods"/>
<tag name="Override" scope="methods"/>
<tag name="status.target" scope="types"/>
</javadoc>
<copy todir="${dist.javadoc.dir}" file="${demo.taglet.jar}" />
<copy tofile="${dist.javadoc.dir}/demos.jar" file="dist/swingx.jar" />
</target>
<target name="grok" depends="init,jar">
<property name="grok.home" value="/hudson/opengrok"/>
<delete dir="${grok.home}/src/${projectname}"/>
<copy todir="${grok.home}/src/${projectname}">
<fileset dir="${java.dir}" excludes="**/CVS/**/ **/.svn/**"/>
<fileset dir="${test.test.dir}" excludes="**/CVS/**/ **/.svn/**"/>
<fileset dir="${src.beaninfo.dir}" excludes="**/CVS/**/ **/.svn/**"/>
<fileset dir="${src.demo.dir}" excludes="**/CVS/**/ **/.svn/**"/>
</copy>
<java fork="true"
jar ="${grok.home}/opengrok.jar"
dir ="${grok.home}">
<arg value="-c"/>
<arg value="/usr/local/bin/ctags" />
<arg value="-s"/>
<arg value="${grok.home}/src" />
<arg value="${grok.home}/data" />
</java>
</target>
<target name="push-to-maven-prepare" depends="init,jar">
<taskdef resource="maven-repository-importer.properties">
<classpath>
<pathelement path="lib/build-only/maven-repository-importer-1.2.jar" />
</classpath>
</taskdef>
<property environment="env"/>
<property name="version" value="0.9-b${env.BUILD_NUMBER}"/>
<delete dir="build/maven-repo" /><!-- clean it -->
<copy file="swingx.pom" toFile="build/swingx.pom">
<filterset>
<filter token="VERSION" value="${version}"/>
</filterset>
</copy>
<zip destfile="build/swingxsrc.zip">
<fileset dir="${java.dir}" excludes="**/CVS/**/ **/.svn/**"/>
<fileset dir="${test.test.dir}" excludes="**/CVS/**/ **/.svn/**"/>
<fileset dir="${src.beaninfo.dir}" excludes="**/CVS/**/ **/.svn/**"/>
<fileset dir="${src.demo.dir}" excludes="**/CVS/**/ **/.svn/**"/>
</zip>
<maven-repository-importer destdir="build/maven-repo" version="${version}">
<artifact jar="dist/swingx.jar" pom="build/swingx.pom" srczip="build/swingxsrc.zip" />
</maven-repository-importer>
</target>
<target name="push-to-maven" depends="push-to-maven-prepare">
<!-- import to CVS-->
<tstamp />
<echo>importing to CVS...</echo>
<cvs dest="build/maven-repo">
<commandline>
<argument value="-d:pserver:swinglabs@cvs.dev.java.net:/cvs" />
<argument line="-z9 import -ko -W *.jar -kb -m" />
<argument value="deploying new jars to the java.net maven repository" />
<argument value="swingx/repo" />
<argument line="deployment-to-maven-repository t${DSTAMP}${TSTAMP}" />
</commandline>
</cvs>
</target>
</project>
|