Skip to content
Find file
12110ed Nov 10, 2010
95 lines (81 sloc) 3.77 KB
<project name="build-plugin">
<property name="plugin.root.dir" value="${basedir}"/>
<property name="root.dir" value="../.."/>
<import file="build-sdk.xml" />
<property file="build.properties" />
<path id="compile.classpath" />
<path id="test.classpath" />
<path id="runtime.classpath" />
<path id="provided.classpath" />
<path id="job.classpath" />
<path id="artifact.classpath" />
<path id="artifact.test.classpath" />
<path id="artifact.it.classpath" />
<mkdir dir="lib/test" />
<mkdir dir="lib/compile" />
<mkdir dir="lib/provided" />
<mkdir dir="lib/runtime" />
<mkdir dir="src/main/java" />
<mkdir dir="src/main/resources" />
<mkdir dir="src/main/generated" />
<mkdir dir="src/test/java" />
<mkdir dir="src/test/resources" />
<mkdir dir="src/it/java" />
<mkdir dir="src/it/resources" />
<path id="build.classpath">
<fileset dir="${sdk.home}/lib-build">
<include name="**/*.jar" />
<exclude name="**/*-sources.jar" />
</fileset>
</path>
<macrodef name="addSdkLibsToClasspath">
<sequential>
<pathconvert property="compile.classpath.prop-sdklib" refid="compile.classpath" />
<path id="compile.classpath">
<pathelement path="${compile.classpath.prop-sdklib}" />
<fileset dir="${sdk.home}/lib">
<include name="**/*.jar" />
<exclude name="**/*-sources.jar" />
</fileset>
</path>
</sequential>
</macrodef>
<addPluginToClasspath plugin="${basedir}" />
<addSdkLibsToClasspath />
<target name="setupArtifactClasspath" />
<target name="compile" depends="setupArtifactClasspath">
<mkdir dir="${build.dir.main-classes}" />
<javac encoding="${build.encoding}" includes="**/*.java" destdir="${build.dir.main-classes}" debug="${javac.debug}" optimize="${javac.optimize}" target="${javac.version}" source="${javac.version}" deprecation="${javac.deprecation}">
<src path="${main.src.dir}" />
<src path="${main.gen.dir}" />
<compilerarg line="${javac.args} ${javac.args.warnings}" />
<classpath refid="compile.classpath" />
<classpath refid="provided.classpath" />
<classpath refid="artifact.classpath" />
</javac>
<copy todir="${build.dir.main-classes}">
<fileset dir="${main.res.dir}"/>
</copy>
</target>
<target name="zip" depends="jar">
<mkdir dir="${build.dir}"/>
<zip destfile="${build.dir}/${ant.project.name}-${version}.zip">
<zipfileset dir="lib" prefix="${ant.project.name}/lib" />
<zipfileset dir="build/classes-main" prefix="${ant.project.name}/classes" />
<zipfileset file="plugin.xml" prefix="${ant.project.name}" />
</zip>
</target>
<target name="jar" depends="compile">
<buildJar jarname="${jar.name}" mainclasses="${build.dir.main-classes}" />
</target>
<target name="compile-unit" depends="setupArtifactClasspath">
<compileTests artifactclasspath="artifact.test.classpath" srcdir="${test.src.dir}" resdir="${test.res.dir}" testclasses="${build.dir.test-classes}" />
</target>
<target name="unit-jar" depends="jar, compile-unit">
<buildJar jarname="${jar.test.name}" mainclasses="${build.dir.test-classes}" />
</target>
<target name="unit" depends="unit-jar">
<runTests srcdir="${test.src.dir}" forkmode="once" testclasses="${build.dir.test-classes}" testreports="${build.dir.test-reports}" artifactclasspath="artifact.test.classpath" haltOnFailure="true"/>
</target>
<target name="test" depends="unit" description="Runs all unit tests." />
</project>
Something went wrong with that request. Please try again.