| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<!-- |
| 3 |
The MIT License |
| 4 |
|
| 5 |
Copyright (c) 2009 codehaus.org. |
| 6 |
|
| 7 |
Permission is hereby granted, free of charge, to any person obtaining a copy |
| 8 |
of this software and associated documentation files (the "Software"), to deal |
| 9 |
in the Software without restriction, including without limitation the rights |
| 10 |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 11 |
copies of the Software, and to permit persons to whom the Software is |
| 12 |
furnished to do so, subject to the following conditions: |
| 13 |
|
| 14 |
The above copyright notice and this permission notice shall be included in |
| 15 |
all copies or substantial portions of the Software. |
| 16 |
|
| 17 |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 18 |
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 19 |
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 20 |
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 21 |
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 22 |
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 23 |
THE SOFTWARE. |
| 24 |
--> |
| 25 |
<project name="merge-test" xmlns:as="antlib:org.codehaus.mojo.animal_sniffer"> |
| 26 |
|
| 27 |
<property environment="env"/> |
| 28 |
|
| 29 |
<path id="jre"> |
| 30 |
<fileset dir="${java.home}" includes="lib/rt.jar"/> |
| 31 |
<fileset dir="${java.home}" includes="lib/jce.jar"/> |
| 32 |
<fileset dir="${java.home}" includes="lib/jsse.jar"/> |
| 33 |
</path> |
| 34 |
|
| 35 |
<xmlproperty file="../../../pom.xml" prefix="pom.xml"/> |
| 36 |
<typedef uri="antlib:org.codehaus.mojo.animal_sniffer"> |
| 37 |
<classpath path="../../../target/${pom.xml.project.artifactId}-${pom.xml.project.parent.version}.jar"/> |
| 38 |
</typedef> |
| 39 |
|
| 40 |
<target name="clean"> |
| 41 |
<delete dir="build"/> |
| 42 |
</target> |
| 43 |
|
| 44 |
<target name="compile" depends="package-api2, package-api3"> |
| 45 |
<mkdir dir="build/classes"/> |
| 46 |
<javac srcdir="src/main/java" destdir="build/classes" fork="true"> |
| 47 |
<classpath> |
| 48 |
<path path="build/api2.jar"/> |
| 49 |
<path path="build/api3.jar"/> |
| 50 |
</classpath> |
| 51 |
</javac> |
| 52 |
</target> |
| 53 |
|
| 54 |
<target name="package" depends="compile"> |
| 55 |
<mkdir dir="build"/> |
| 56 |
<jar destfile="build/${ant.project.name}.jar" basedir="build/classes"/> |
| 57 |
</target> |
| 58 |
|
| 59 |
<target name="verify" depends="package"> |
| 60 |
<as:check-signature> |
| 61 |
<classpath path="build/${ant.project.name}.jar"/> |
| 62 |
</as:check-signature> |
| 63 |
</target> |
| 64 |
|
| 65 |
<target name="build-signatures"> |
| 66 |
<as:build-signatures destfile="build/jdk.sig"> |
| 67 |
<path> |
| 68 |
<fileset dir="${java.home}" includes="lib/rt.jar"/> |
| 69 |
<fileset dir="${java.home}" includes="lib/jce.jar"/> |
| 70 |
<fileset dir="${java.home}" includes="lib/jsse.jar"/> |
| 71 |
</path> |
| 72 |
</as:build-signatures> |
| 73 |
</target> |
| 74 |
|
| 75 |
<target name="compile-api1"> |
| 76 |
<mkdir dir="build/api1"/> |
| 77 |
<javac srcdir="src/api1/java" destdir="build/api1" fork="true"/> |
| 78 |
</target> |
| 79 |
|
| 80 |
<target name="compile-api2"> |
| 81 |
<mkdir dir="build/api2"/> |
| 82 |
<javac srcdir="src/api2/java" destdir="build/api2" fork="true"/> |
| 83 |
</target> |
| 84 |
|
| 85 |
<target name="compile-api3"> |
| 86 |
<mkdir dir="build/api3"/> |
| 87 |
<javac srcdir="src/api3/java" destdir="build/api3" fork="true"/> |
| 88 |
</target> |
| 89 |
|
| 90 |
<target name="package-api1" depends="compile-api1"> |
| 91 |
<mkdir dir="build"/> |
| 92 |
<jar destfile="build/api1.jar" basedir="build/api1"/> |
| 93 |
</target> |
| 94 |
|
| 95 |
<target name="package-api2" depends="compile-api2"> |
| 96 |
<mkdir dir="build"/> |
| 97 |
<jar destfile="build/api2.jar" basedir="build/api2"/> |
| 98 |
</target> |
| 99 |
|
| 100 |
<target name="package-api3" depends="compile-api3"> |
| 101 |
<mkdir dir="build"/> |
| 102 |
<jar destfile="build/api3.jar" basedir="build/api3"/> |
| 103 |
</target> |
| 104 |
|
| 105 |
<target name="build-signatures-api1" depends="package-api1"> |
| 106 |
<as:build-signatures destfile="build/api1.sig"> |
| 107 |
<path> |
| 108 |
<fileset dir="build" includes="api1.jar"/> |
| 109 |
</path> |
| 110 |
</as:build-signatures> |
| 111 |
</target> |
| 112 |
|
| 113 |
<target name="build-signatures-api2" depends="package-api2"> |
| 114 |
<as:build-signatures destfile="build/api2.sig"> |
| 115 |
<path> |
| 116 |
<fileset dir="build" includes="api2.jar"/> |
| 117 |
</path> |
| 118 |
</as:build-signatures> |
| 119 |
</target> |
| 120 |
|
| 121 |
<target name="build-signatures-api3" depends="package-api3, build-signatures-api2"> |
| 122 |
<as:build-signatures destfile="build/api3.sig"> |
| 123 |
<path> |
| 124 |
<fileset dir="build" includes="api3.jar"/> |
| 125 |
</path> |
| 126 |
<signature src="build/api2.sig"/> |
| 127 |
</as:build-signatures> |
| 128 |
</target> |
| 129 |
|
| 130 |
<target name="check-signatures-api1" depends="package, build-signatures-api1"> |
| 131 |
<!-- |
| 132 |
in this case we are checking signatures not of the jdk, but of our API |
| 133 |
so we need to add the classpath of the jdk, or else we will have |
| 134 |
an error due to java.lang.Object being undefined |
| 135 |
--> |
| 136 |
<as:check-signature signature="build/api1.sig" classpathRef="jre"> |
| 137 |
<path path="build/${ant.project.name}.jar"/> |
| 138 |
<ignore className="java.*"/> |
| 139 |
<ignore className="javax.*"/> |
| 140 |
</as:check-signature> |
| 141 |
</target> |
| 142 |
|
| 143 |
<target name="check-signatures-api2" depends="package, build-signatures-api2"> |
| 144 |
<!-- |
| 145 |
in this case we are checking signatures not of the jdk, but of our API |
| 146 |
so we need to add the classpath of the jdk, or else we will have |
| 147 |
an error due to java.lang.Object being undefined |
| 148 |
--> |
| 149 |
<as:check-signature signature="build/api2.sig" classpathRef="jre"> |
| 150 |
<path path="build/${ant.project.name}.jar"/> |
| 151 |
<ignore className="java.*"/> |
| 152 |
<ignore className="javax.*"/> |
| 153 |
</as:check-signature> |
| 154 |
</target> |
| 155 |
|
| 156 |
<target name="check-signatures-api3" depends="package, build-signatures-api3"> |
| 157 |
<!-- |
| 158 |
in this case we are checking signatures not of the jdk, but of our API |
| 159 |
so we need to add the classpath of the jdk, or else we will have |
| 160 |
an error due to java.lang.Object being undefined |
| 161 |
--> |
| 162 |
<as:check-signature signature="build/api3.sig" classpathRef="jre"> |
| 163 |
<path path="build/${ant.project.name}.jar"/> |
| 164 |
<ignore className="java.*"/> |
| 165 |
<ignore className="javax.*"/> |
| 166 |
</as:check-signature> |
| 167 |
</target> |
| 168 |
|
| 169 |
</project> |