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