|
1 | 1 | <?xml version="1.0"?> |
2 | | -<project name="Java Mode" default="build"> |
| 2 | +<project name="Java Mode" default="build" xmlns:ivy="antlib:org.apache.ivy.ant"> |
3 | 3 |
|
4 | 4 | <property name="generated" |
5 | 5 | value="${basedir}/generated/processing/mode/java/preproc" /> |
|
18 | 18 | <classpath path="${antlr_jar}" /> |
19 | 19 | </classloader> |
20 | 20 |
|
| 21 | + <property name="ivy.version" value="2.5.0" /> |
| 22 | + <fileset id="ivy.files" dir="lib"> |
| 23 | + <include name="ivy.jar" /> |
| 24 | + </fileset> |
| 25 | + <property name="ivy.url" |
| 26 | + value="https://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.version}/ivy-${ivy.version}.jar" /> |
| 27 | + |
| 28 | + <available file="ivy.jar" property="ivy.present" /> |
| 29 | + |
| 30 | + <condition property="ivy.ignorable" value="false" else="true"> |
| 31 | + <isset property="ivy.present" /> |
| 32 | + </condition> |
| 33 | + |
| 34 | + <target name="download-ivy" unless="ivy.present"> |
| 35 | + <get src="${ivy.url}" dest="ivy.jar" |
| 36 | + ignoreerrors="${ivy.ignorable}" |
| 37 | + usetimestamp="true" /> |
| 38 | + </target> |
| 39 | + |
| 40 | + <target name="init-ivy" depends="download-ivy"> |
| 41 | + <taskdef resource="org/apache/ivy/ant/antlib.xml" |
| 42 | + uri="antlib:org.apache.ivy.ant" classpath="ivy.jar"/> |
| 43 | + </target> |
| 44 | + |
| 45 | + <target name="download-ivy-dependencies" depends="init-ivy"> |
| 46 | + <ivy:retrieve /> |
| 47 | + </target> |
| 48 | + |
21 | 49 | <target name="clean" description="Clean the build directories"> |
22 | 50 | <delete dir="bin" /> |
23 | 51 | <delete dir="bin-test" /> |
|
32 | 60 | <include name="*.properties" /> |
33 | 61 | </fileset> |
34 | 62 | </delete> |
| 63 | + <delete> |
| 64 | + <fileset dir="lib"> |
| 65 | + <include name="*.jar" /> |
| 66 | + </fileset> |
| 67 | + </delete> |
35 | 68 | </target> |
36 | 69 |
|
37 | 70 | <target name="preproc" description="Compile ANTLR 4 grammar"> |
|
71 | 104 | <pathelement location="mode/org.eclipse.jdt.core.jar" /> |
72 | 105 | <pathelement location="mode/org.eclipse.osgi.jar" /> |
73 | 106 | <pathelement location="mode/org.eclipse.text.jar" /> |
| 107 | + <pathelement location="mode/org.eclipse.ui.workbench.jar" /> |
| 108 | + <fileset dir="lib" includes="*.jar" /> |
74 | 109 | </path> |
75 | 110 |
|
76 | 111 | <path id="classpath.test"> |
|
123 | 158 | </sequential> |
124 | 159 | </macrodef> |
125 | 160 |
|
126 | | - <target name="test-compile" depends="preproc"> |
| 161 | + <target name="test-compile" depends="preproc, download-ivy-dependencies"> |
127 | 162 | <compilecommon srcdir="src; test/processing" destdir="bin-test" classpath="classpath.test" /> |
128 | 163 | </target> |
129 | 164 |
|
|
140 | 175 | </junit> |
141 | 176 | </target> |
142 | 177 |
|
143 | | - <target name="compile" description="Compile sources" depends="preproc"> |
| 178 | + <target name="compile" description="Compile sources" depends="preproc, download-ivy-dependencies"> |
144 | 179 | <compilecommon srcdir="src" destdir="bin" classpath="classpath.base" /> |
145 | 180 | </target> |
146 | 181 |
|
|
0 commit comments