Mercurial > public > develkit
annotate ivy-ant.xml @ 20:fe20e4ed4be2
CM-125: Ant script to assist creating OSGI jars.
author | smith@nwoca.org |
---|---|
date | Sat, 15 Jan 2011 15:25:11 -0500 |
parents | 2632897c8a2b |
children | 639bec4999f2 |
rev | line source |
---|---|
4 | 1 <?xml version="1.0" encoding="UTF-8"?> |
8
26a4d8410fdf
TL-32: Refactor ivy include for non-ivy based projects.
smith@nwoca.org
parents:
4
diff
changeset
|
2 <project name="ivy-ant" basedir="." |
26a4d8410fdf
TL-32: Refactor ivy include for non-ivy based projects.
smith@nwoca.org
parents:
4
diff
changeset
|
3 xmlns:ivy="antlib:fr.jayasoft.ivy.ant" |
26a4d8410fdf
TL-32: Refactor ivy include for non-ivy based projects.
smith@nwoca.org
parents:
4
diff
changeset
|
4 xmlns:ssdt="http://www.ssdt-ohio.org/ant/common"> |
18
e4c45fd105ea
TL-32: Modify iivy-ant to retrieve 'runtime' conf for web libraries.
smith@nwoca.org
parents:
8
diff
changeset
|
5 |
e4c45fd105ea
TL-32: Modify iivy-ant to retrieve 'runtime' conf for web libraries.
smith@nwoca.org
parents:
8
diff
changeset
|
6 <property name="ssdt.ivy.jar.src" value="http://ivy.ssdt.nwoca.org/repository/ivy/ivy.jar"/> |
e4c45fd105ea
TL-32: Modify iivy-ant to retrieve 'runtime' conf for web libraries.
smith@nwoca.org
parents:
8
diff
changeset
|
7 <property name="ssdt.ivy.settings.src" value="${ssdt.devel.kit.src}/ssdt.default.ivy.settings.xml"/> |
8
26a4d8410fdf
TL-32: Refactor ivy include for non-ivy based projects.
smith@nwoca.org
parents:
4
diff
changeset
|
8 |
26a4d8410fdf
TL-32: Refactor ivy include for non-ivy based projects.
smith@nwoca.org
parents:
4
diff
changeset
|
9 <ssdt:fetch dest="${user.home.ant.lib}/ivy.jar" |
26a4d8410fdf
TL-32: Refactor ivy include for non-ivy based projects.
smith@nwoca.org
parents:
4
diff
changeset
|
10 src="${ssdt.ivy.jar.src}"/> |
4 | 11 |
12 <dirname property="ivy.home" file="${ant.file.ivy-ant}"/> | |
13 <property name="ivy-ant.location" location="${ant.file.ivy-ant}"/> | |
14 <dirname property="ivy-ant.base" file="${ivy-ant.location}"/> | |
15 | |
16 <property name="ivy.default.cache.dir" | |
17 value="${user.home}/.ivy2/cache"/> | |
18 <property name="ivy.default.ivy.user.dir" | |
19 value="${user.home}/.ivy2"/> | |
20 <property name="ivy.local.default.root" | |
21 value="${user.home}/.ivy2/local"/> | |
22 | |
8
26a4d8410fdf
TL-32: Refactor ivy include for non-ivy based projects.
smith@nwoca.org
parents:
4
diff
changeset
|
23 <ssdt:fetch dest="${ssdt.devel.kit}/ssdt.default.ivy.settings.xml" |
26a4d8410fdf
TL-32: Refactor ivy include for non-ivy based projects.
smith@nwoca.org
parents:
4
diff
changeset
|
24 src="${ssdt.ivy.settings.src}"/> |
26a4d8410fdf
TL-32: Refactor ivy include for non-ivy based projects.
smith@nwoca.org
parents:
4
diff
changeset
|
25 |
4 | 26 <target name="ivy-report" depends="init"> |
27 <mkdir dir="${build.dir}/ivy"/> | |
28 <ivy:resolve log="quiet" file="ivy.xml"/> | |
29 <ivy:report todir="${build.dir}/ivy" conf="*"/> | |
30 </target> | |
31 | |
32 <target name="ivy-info" depends="init"> | |
33 <ivy:info file="ivy.xml" property="ivy.project"/> | |
34 <echoproperties prefix="ivy.project"/> | |
35 </target> | |
36 | |
37 <target name="ivy-clean" description="cleans ssdt caches and local builds" depends="init"> | |
38 <delete failonerror="false" includeemptydirs="true"> | |
39 <fileset dir="${user.home}/.ivy2/cache"> | |
40 <include name="org.ssdt_ohio/**"/> | |
41 <include name="org.nwoca.ssdt/**"/> | |
42 <include name="*org*.ssdt*.*"/> | |
43 </fileset> | |
44 </delete> | |
45 <delete dir="${user.home}/.ivy2/ssdt-cache" failonerror="false"/> | |
46 <delete dir="${user.home}/.ivy2/local" failonerror="false"/> | |
47 </target> | |
48 | |
49 <target name="-ivy-retrieve-custom" depends="-ivy-define-classpaths,-ivy-retrieve-web-jars"> | |
50 </target> | |
51 | |
52 <target name="-ivy-copy-webjars" if="build.web.dir"> | |
53 <ivy:resolve log="quiet" file="ivy.xml"/> | |
18
e4c45fd105ea
TL-32: Modify iivy-ant to retrieve 'runtime' conf for web libraries.
smith@nwoca.org
parents:
8
diff
changeset
|
54 <ivy:retrieve pattern="${basedir}/${build.web.dir}/WEB-INF/lib/[artifact]-[revision].[ext]" type="jar" conf="runtime"/> |
4 | 55 </target> |
56 | |
57 <target name="-ivy-retrieve-web-jars" if="build.web.dir"> | |
18
e4c45fd105ea
TL-32: Modify iivy-ant to retrieve 'runtime' conf for web libraries.
smith@nwoca.org
parents:
8
diff
changeset
|
58 <ivy:retrieve pattern="${basedir}/${build.web.dir}/WEB-INF/lib/[artifact]-[revision].[ext]" type="jar" conf="runtime"/> |
4 | 59 </target> |
60 | |
61 <target name="-ivy-define-classpaths"> | |
62 <!-- Custom SSDT retrieve target to replaced IvyBean's default -ivy-retrieve. | |
63 Builds a separate classpath for javac, javac.test, run, run.test, etc based | |
64 on the ivy configurations similer to how NetBeans would build them. | |
65 Uses "ivy:cachepath" instead of "ivy:retrieve". Although is is contrary | |
66 to "best practice" it avoids transfering all jars to build directory and | |
67 avoids problem with 'clean'. NetBeans and ant don't care where the files | |
68 are on disk and the builds are dependent on Ivy anyway. But the "runtime" jars | |
69 are still placed in dist/libs based on the correct run.classpath built by this | |
70 target. | |
71 --> | |
72 <ivy:settings file="ivysettings.xml"/> | |
19
2632897c8a2b
CM-125: Update ivy resolve to create Ant properties for resolved modules with version.
smith@nwoca.org
parents:
18
diff
changeset
|
73 <ivy:resolve log="download-only" file="ivy.xml" /> |
2632897c8a2b
CM-125: Update ivy resolve to create Ant properties for resolved modules with version.
smith@nwoca.org
parents:
18
diff
changeset
|
74 <ivy:artifactproperty conf="*" |
2632897c8a2b
CM-125: Update ivy resolve to create Ant properties for resolved modules with version.
smith@nwoca.org
parents:
18
diff
changeset
|
75 name="ivydeps.[organisation]-[module]" |
2632897c8a2b
CM-125: Update ivy resolve to create Ant properties for resolved modules with version.
smith@nwoca.org
parents:
18
diff
changeset
|
76 value="[revision]"/> |
4 | 77 |
78 <ivy:cachepath pathid="ivy.javac.classpath.id" conf="compile" type="jar"/> | |
79 <pathconvert dirsep="/" pathsep="${path.separator}" property="ivy.javac.classpath"> | |
80 <path refid="ivy.javac.classpath.id"/> | |
81 <!--map from="${basedir}${file.separator}" to=""/--> | |
82 </pathconvert> | |
83 <property name="old.javac.classpath" value="${javac.classpath}"/> | |
84 <var name="javac.classpath" unset="true"/> | |
85 <if> | |
86 <equals arg1="${old.javac.classpath}" arg2=""/> | |
87 <then> | |
88 <property name="javac.classpath" value="${ivy.javac.classpath}"/> | |
89 </then> | |
90 <else> | |
91 <property name="javac.classpath" value="${old.javac.classpath}${path.separator}${ivy.javac.classpath}"/> | |
92 </else> | |
93 </if> | |
94 <echo level="debug" message="$${javac.classpath} : ${javac.classpath}"/> | |
95 | |
96 <ivy:cachepath pathid="ivy.javac.test.classpath.id" conf="compile,compile-test" type="jar"/> | |
97 <pathconvert dirsep="/" pathsep="${path.separator}" property="ivy.javac.test.classpath"> | |
98 <path refid="ivy.javac.test.classpath.id"/> | |
99 <!--map from="${basedir}${file.separator}" to=""/--> | |
100 </pathconvert> | |
101 <property name="old.javac.test.classpath" value="${javac.test.classpath}"/> | |
102 <var name="javac.test.classpath" unset="true"/> | |
103 <if> | |
104 <equals arg1="${old.javac.test.classpath}" arg2=""/> | |
105 <then> | |
106 <property name="javac.test.classpath" value="${ivy.javac.test.classpath}"/> | |
107 </then> | |
108 <else> | |
109 <property name="javac.test.classpath" value="${old.javac.test.classpath}${path.separator}${ivy.javac.test.classpath}"/> | |
110 </else> | |
111 </if> | |
112 <echo level="debug" message="$${javac.test.classpath} : ${javac.test.classpath}"/> | |
113 | |
114 <ivy:cachepath pathid="ivy.run.classpath.id" conf="compile,runtime" type="jar"/> | |
115 <pathconvert dirsep="/" pathsep="${path.separator}" property="ivy.run.classpath"> | |
116 <path refid="ivy.run.classpath.id"/> | |
117 <!--map from="${basedir}${file.separator}" to=""/--> | |
118 </pathconvert> | |
119 <property name="old.run.classpath" value="${run.classpath}"/> | |
120 <var name="run.classpath" unset="true"/> | |
121 <if> | |
122 <equals arg1="${old.run.classpath}" arg2="$${run.classpath}"/> | |
123 <then> | |
124 <property name="run.classpath" value="${ivy.run.classpath}"/> | |
125 </then> | |
126 <else> | |
127 <property name="run.classpath" value="${old.run.classpath}${path.separator}${ivy.run.classpath}"/> | |
128 </else> | |
129 </if> | |
130 <echo level="debug" message="$${run.classpath} : ${run.classpath}"/> | |
131 | |
132 | |
133 <ivy:cachepath pathid="ivy.run.test.classpath.id" conf="compile,compile-test,runtime,runtime-test" type="jar"/> | |
134 <pathconvert dirsep="/" pathsep="${path.separator}" property="ivy.run.test.classpath"> | |
135 <path refid="ivy.run.test.classpath.id"/> | |
136 <!--map from="${basedir}${file.separator}" to=""/--> | |
137 </pathconvert> | |
138 | |
139 <property name="old.run.test.classpath" value="${run.test.classpath}"/> | |
140 <var name="run.test.classpath" unset="true"/> | |
141 <if> | |
142 <equals arg1="${old.run.test.classpath}" arg2="$${run.test.classpath}"/> | |
143 <then> | |
144 <property name="run.test.classpath" value="${ivy.run.test.classpath}"/> | |
145 </then> | |
146 <else> | |
147 <property name="run.test.classpath" value="${old.run.test.classpath}${path.separator}${ivy.run.test.classpath}"/> | |
148 </else> | |
149 </if> | |
150 <echo level="debug" message="$${run.test.classpath} : ${run.test.classpath}"/> | |
151 | |
152 <ivy:cachepath pathid="ivy.debug.classpath.id" conf="compile,runtime" type="jar"/> | |
153 <pathconvert dirsep="/" pathsep="${path.separator}" property="ivy.debug.classpath"> | |
154 <path refid="ivy.debug.classpath.id"/> | |
155 <!--map from="${basedir}${file.separator}" to=""/--> | |
156 </pathconvert> | |
157 <property name="old.debug.classpath" value="${debug.classpath}"/> | |
158 <var name="debug.classpath" unset="true"/> | |
159 <if> | |
160 <equals arg1="${old.debug.classpath}" arg2="$${debug.classpath}"/> | |
161 <then> | |
162 <property name="debug.classpath" value="${ivy.debug.classpath}"/> | |
163 </then> | |
164 <else> | |
165 <property name="debug.classpath" value="${old.debug.classpath}${path.separator}${ivy.debug.classpath}"/> | |
166 </else> | |
167 </if> | |
168 <echo level="debug" message="$${debug.classpath} : ${debug.classpath}"/> | |
169 | |
170 <ivy:cachepath pathid="ivy.debug.test.classpath.id" conf="compile,compile-test,runtime,runtime-test" type="jar"/> | |
171 <pathconvert dirsep="/" pathsep="${path.separator}" property="ivy.debug.test.classpath"> | |
172 <path refid="ivy.debug.test.classpath.id"/> | |
173 <!--map from="${basedir}${file.separator}" to=""/--> | |
174 </pathconvert> | |
175 <property name="old.debug.test.classpath" value="${debug.test.classpath}"/> | |
176 <var name="debug.test.classpath" unset="true"/> | |
177 <if> | |
178 <equals arg1="${old.debug.test.classpath}" arg2="$${debug.test.classpath}"/> | |
179 <then> | |
180 <property name="debug.test.classpath" value="${ivy.debug.test.classpath}"/> | |
181 </then> | |
182 <else> | |
183 <property name="debug.test.classpath" value="${old.debug.test.classpath}${path.separator}${ivy.debug.test.classpath}"/> | |
184 </else> | |
185 </if> | |
186 <echo level="debug" message="$${debug.test.classpath} : ${debug.test.classpath}"/> | |
187 </target> | |
188 | |
189 | |
190 <target name="-ivy-javaagent" description="Retrieves load time weaver java agent"> | |
191 <property name="java.agent.org" value="org.springframework"/> | |
192 <property name="java.agent.module" value="org.springframework.instrument"/> | |
193 <property name="java.agent.revision" value="3.0.1.RELEASE-A"/> | |
194 <ivy:resolve resolveId="javaagentid" | |
195 organisation="${java.agent.org}" | |
196 module="${java.agent.module}" | |
197 revision="${java.agent.revision}" | |
198 type="jar" | |
199 inline="true" | |
200 keep="true" | |
201 log="quiet"/> | |
202 <ivy:retrieve | |
203 resolveid="javaagentid" | |
204 pattern="${basedir}/${build.dir}/${lib.dir}/java-agent.[ext]" | |
205 type="jar" | |
206 log="quiet"/> | |
207 <property name="java.agent.jar" | |
208 value="build/jar/java-agent.jar"/> | |
209 </target> | |
210 | |
211 | |
212 </project> |