<?xml version="1.0" encoding="UTF-8"?> | |
<project name="org.jacoco.agent.buildhook"> | |
<path id="dependencies"> | |
<path refid="bundle-org.jacoco.core"/> | |
<path refid="bundle-org.objectweb.asm"/> | |
</path> | |
<property name="do.compile" value="true"/> | |
<property name="do.custompackage" value="true"/> | |
<target name="custompackage"> | |
<taskdef resource="org/jacoco/build/tools/ant/antlib.xml"> | |
<classpath> | |
<path refid="bundle-org.jacoco.build"/> | |
<path refid="bundle-org.objectweb.asm"/> | |
</classpath> | |
</taskdef> | |
<!-- The random identifier will be used to create a unique package names --> | |
<randomid name="randomid"/> | |
<echo>The following warning is false (Ant 1.7.0 Bug #47470), the archive is created anyway.</echo> | |
<jar destfile="${result.dist.lib.dir}/jacocoagent.jar"> | |
<manifest> | |
<attribute name="Premain-Class" value="org.jacoco.${randomid}.agent.JacocoAgent"/> | |
<attribute name="Implementation-Title" value="JaCoCo Java Agent"/> | |
<attribute name="Implementation-Vendor" value="Mountainminds GmbH & Co. KG"/> | |
<attribute name="Implementation-Version" value="${qualified.bundle.version}"/> | |
</manifest> | |
<!-- Move classes into unique packages --> | |
<renamedclassfileset> | |
<mapping from="org/jacoco/(.*)" to="org/jacoco/${randomid}/$1"/> | |
<mapping from="org/objectweb/asm/(.*)" to="org/jacoco/${randomid}/asm/$1"/> | |
<!-- Ship required classes only in the agent JAR --> | |
<deepclassfileset rootclass="org/jacoco/agent/JacocoAgent"> | |
<fileset dir="${result.tmp.bundle.classes.dir}"/> | |
<fileset dir="${toString:bundle-org.jacoco.core}"/> | |
<zipfileset includes="**/*.class"> | |
<fileset file="${toString:bundle-org.objectweb.asm}"/> | |
</zipfileset> | |
</deepclassfileset> | |
</renamedclassfileset> | |
</jar> | |
</target> | |
</project> |