comparison ivy-ant.xml @ 4:be1051bf262f

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