|
21 | 21 | <delete dir="build"/> |
22 | 22 | </target> |
23 | 23 |
|
24 | | - <target name="api" |
25 | | - description="Build API"> |
26 | | - <java-to-jar srcdir="hamcrest-api/src/main/java" |
27 | | - destjar="build/hamcrest-api-${version}.jar"/> |
28 | | - </target> |
29 | | - |
30 | 24 | <target name="generator" |
31 | | - depends="api" |
32 | 25 | description="Build code generator tool"> |
33 | 26 | <java-to-jar srcdir="hamcrest-generator/src/main/java" |
34 | 27 | destjar="build/hamcrest-generator-${version}.jar" |
35 | | - classpath="build/hamcrest-api-${version}.jar"/> |
| 28 | + classpath=" |
| 29 | + build/hamcrest-core-${version}.jar; |
| 30 | + "/> |
| 31 | + </target> |
| 32 | + |
| 33 | + <target name="core" |
| 34 | + depends="generator" |
| 35 | + description="Build core Hamcrest library"> |
| 36 | + <java-to-jar srcdir="hamcrest-core/src/main/java" |
| 37 | + destjar="build/hamcrest-core-${version}.jar"/> |
| 38 | + <!-- Generate one class with all static imports --> |
| 39 | + <mkdir dir="build/hamcrest-core/generated-code"/> |
| 40 | + <java classname="org.hamcrest.generator.config.XmlConfigurator" |
| 41 | + fork="yes" |
| 42 | + failonerror="yes" |
| 43 | + classpath=" |
| 44 | + build/hamcrest-core-${version}.jar; |
| 45 | + build/hamcrest-generator-${version}.jar; |
| 46 | + "> |
| 47 | + <arg value="core-matchers.xml"/> |
| 48 | + <arg value="hamcrest-core/src/main/java"/> |
| 49 | + <arg value="org.hamcrest.CoreMatchers"/> |
| 50 | + <arg value="build/hamcrest-core/generated-code"/> |
| 51 | + </java> |
| 52 | + <!-- Append to core jar --> |
| 53 | + <java-to-jar srcdir="build/hamcrest-core/generated-code" |
| 54 | + destjar="build/hamcrest-core-${version}.jar" |
| 55 | + classpath="build/hamcrest-core-${version}.jar"/> |
36 | 56 | </target> |
37 | 57 |
|
38 | 58 | <target name="library" |
39 | | - depends="api,generator" |
| 59 | + depends="core,generator" |
40 | 60 | description="Build library of matchers"> |
41 | 61 | <java-to-jar srcdir="hamcrest-library/src/main/java" |
42 | 62 | destjar="build/hamcrest-library-${version}.jar" |
43 | | - classpath="build/hamcrest-api-${version}.jar"/> |
| 63 | + classpath="build/hamcrest-core-${version}.jar"/> |
44 | 64 | <!-- Generate one class with all static imports --> |
45 | | - <mkdir dir="build/generated-code"/> |
| 65 | + <mkdir dir="build/hamcrest-library/generated-code"/> |
46 | 66 | <java classname="org.hamcrest.generator.config.XmlConfigurator" |
47 | 67 | fork="yes" |
48 | 68 | failonerror="yes" |
49 | 69 | classpath=" |
50 | | - build/hamcrest-api-${version}.jar; |
| 70 | + build/hamcrest-core-${version}.jar; |
51 | 71 | build/hamcrest-generator-${version}.jar; |
52 | | - build/hamcrest-library-${version}.jar |
| 72 | + build/hamcrest-library-${version}.jar; |
53 | 73 | "> |
54 | 74 | <arg value="matchers.xml"/> |
| 75 | + <arg value="hamcrest-library/src/main/java"/> |
55 | 76 | <arg value="org.hamcrest.Matchers"/> |
56 | | - <arg value="build/generated-code"/> |
| 77 | + <arg value="build/hamcrest-library/generated-code"/> |
57 | 78 | </java> |
58 | 79 | <!-- Append to library jar --> |
59 | | - <java-to-jar srcdir="build/generated-code" |
| 80 | + <java-to-jar srcdir="build/hamcrest-library/generated-code" |
60 | 81 | destjar="build/hamcrest-library-${version}.jar" |
61 | | - classpath="build/hamcrest-api-${version}.jar"/> |
| 82 | + classpath="build/hamcrest-core-${version}.jar"/> |
62 | 83 | </target> |
63 | 84 |
|
64 | 85 | <target name="integration" |
65 | | - depends="api, library" |
| 86 | + depends="core, library" |
66 | 87 | description="Build integration with external tools"> |
67 | 88 | <java-to-jar srcdir="hamcrest-integration/src/main/java" |
68 | 89 | destjar="build/hamcrest-integration-${version}.jar" |
69 | 90 | classpath=" |
70 | | - build/hamcrest-api-${version}.jar; |
| 91 | + build/hamcrest-core-${version}.jar; |
71 | 92 | build/hamcrest-library-${version}.jar"/> |
72 | 93 | </target> |
73 | 94 |
|
74 | 95 | <target name="unit-test" |
75 | | - depends="api, library, integration, generator" |
| 96 | + depends="core, library, integration, generator" |
76 | 97 | description="Build and run unit tests."> |
77 | 98 | <java-to-jar srcdir="hamcrest-unit-test/src/main/java" |
78 | 99 | destjar="build/hamcrest-unit-test-${version}.jar" |
79 | 100 | classpath=" |
80 | | - build/hamcrest-api-${version}.jar; |
| 101 | + build/hamcrest-core-${version}.jar; |
81 | 102 | build/hamcrest-library-${version}.jar; |
82 | 103 | build/hamcrest-integration-${version}.jar; |
83 | 104 | build/hamcrest-generator-${version}.jar"/> |
|
87 | 108 | <fileset dir="lib/integration"> |
88 | 109 | <include name="*.jar"/> |
89 | 110 | </fileset> |
90 | | - <pathelement path="build/hamcrest-api-${version}.jar"/> |
| 111 | + <pathelement path="build/hamcrest-core-${version}.jar"/> |
91 | 112 | <pathelement path="build/hamcrest-library-${version}.jar"/> |
92 | 113 | <pathelement path="build/hamcrest-integration-${version}.jar"/> |
93 | 114 | <pathelement path="build/hamcrest-generator-${version}.jar"/> |
|
102 | 123 | </target> |
103 | 124 |
|
104 | 125 | <target name="examples" |
105 | | - depends="api, library, integration" |
| 126 | + depends="core, library, integration" |
106 | 127 | description="Build and run unit tests."> |
107 | 128 | <java-to-jar srcdir="hamcrest-examples/src/main/java" |
108 | 129 | destjar="build/hamcrest-examples-${version}.jar" |
109 | 130 | classpath=" |
110 | | - build/hamcrest-api-${version}.jar; |
| 131 | + build/hamcrest-core-${version}.jar; |
111 | 132 | build/hamcrest-library-${version}.jar; |
112 | 133 | build/hamcrest-integration-${version}.jar"/> |
113 | 134 | </target> |
114 | 135 |
|
115 | 136 | <target name="bigjar" |
116 | | - depends="api, library, integration, generator" |
117 | | - description="Build a single Jar (hamcrest-all.jar) that contains api, library, generator and integration."> |
| 137 | + depends="core, library, integration, generator" |
| 138 | + description="Build a single Jar (hamcrest-all.jar) that contains core, library, generator and integration."> |
118 | 139 | <jar jarfile="build/hamcrest-all-${version}.jar" duplicate="preserve"> |
119 | | - <fileset dir="build/temp/build/hamcrest-api-${version}.jar.contents"/> |
| 140 | + <fileset dir="build/temp/build/hamcrest-core-${version}.jar.contents"/> |
120 | 141 | <fileset dir="build/temp/build/hamcrest-library-${version}.jar.contents"/> |
121 | 142 | <fileset dir="build/temp/build/hamcrest-generator-${version}.jar.contents"/> |
122 | 143 | <fileset dir="build/temp/build/hamcrest-integration-${version}.jar.contents"/> |
123 | 144 | </jar> |
124 | 145 | </target> |
125 | 146 |
|
126 | 147 | <target name="package" |
127 | | - depends="api,generator,library,integration,bigjar,unit-test,examples" |
| 148 | + depends="core,generator,library,integration,bigjar,unit-test,examples" |
128 | 149 | description="Package for distribution"> |
129 | 150 | <zip zipfile="build/hamcrest-${version}.zip"> |
130 | 151 | <zipfileset dir="." prefix="hamcrest-${version}"> |
|
135 | 156 | <include name="matchers.xml"/> |
136 | 157 | </zipfileset> |
137 | 158 | <zipfileset dir="build" prefix="hamcrest-${version}"> |
138 | | - <include name="hamcrest-api-${version}.jar"/> |
| 159 | + <include name="hamcrest-core-${version}.jar"/> |
139 | 160 | <include name="hamcrest-generator-${version}.jar"/> |
140 | 161 | <include name="hamcrest-library-${version}.jar"/> |
141 | 162 | <include name="hamcrest-integration-${version}.jar"/> |
|
151 | 172 | <include name="matchers.xml"/> |
152 | 173 | </tarfileset> |
153 | 174 | <tarfileset dir="build" prefix="hamcrest-${version}"> |
154 | | - <include name="hamcrest-api-${version}.jar"/> |
| 175 | + <include name="hamcrest-core-${version}.jar"/> |
155 | 176 | <include name="hamcrest-generator-${version}.jar"/> |
156 | 177 | <include name="hamcrest-library-${version}.jar"/> |
157 | 178 | <include name="hamcrest-integration-${version}.jar"/> |
|
171 | 192 | </fileset> |
172 | 193 | </classpath> |
173 | 194 |
|
174 | | - <packageset dir="hamcrest-api/src/main/java"/> |
| 195 | + <packageset dir="hamcrest-core/src/main/java"/> |
175 | 196 | <packageset dir="hamcrest-library/src/main/java" excludes="org/hamcrest/internal"/> |
176 | 197 | <packageset dir="hamcrest-integration/src/main/java"/> |
177 | 198 | <packageset dir="build/generated-code"/> |
|
0 commit comments