forked from mplushnikov/lombok-intellij-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-test.xml
170 lines (143 loc) · 5.1 KB
/
build-test.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<project name="Lombok IntelliJIdea Plugin" default="test" basedir=".">
<!-- set global properties for this build -->
<property name="build.compiler" value="modern"/>
<property name="src" location="${basedir}/lombok-plugin/src/main/java"/>
<property name="gen" location="${basedir}/lombok-plugin/gen"/>
<property name="resources" value="${basedir}/lombok-plugin/src/main/resources"/>
<property name="lombok.api" location="${basedir}/lombok-api/target/lombok-api-1.0.jar"/>
<property name="test.src" location="${basedir}/lombok-plugin/src/test/java"/>
<property name="test.res" location="${basedir}/lombok-plugin/src/test/resources"/>
<property name="idea.community.build" location="${basedir}/idea-IC/"/>
<property name="build" location="build"/>
<property name="test.build" location="build_test"/>
<path id="idea.classpath">
<fileset dir="${idea.community.build}/lib">
<include name="*.jar"/>
</fileset>
</path>
<path id="my.classpath">
<pathelement location="${build}"/>
<pathelement location="${lombok.api}"/>
</path>
<path id="classpath">
<path refid="my.classpath"/>
<path refid="idea.classpath"/>
</path>
<path id="classpath.test">
<pathelement location="${build}"/>
<pathelement location="${test.build}"/>
<pathelement location="${lombok.api}"/>
<fileset dir="${idea.community.build}/lib">
<include name="**/*.jar"/>
<exclude name="ant/lib/**/*.jar"/>
</fileset>
<fileset dir="${java.home}/../lib">
<include name="**/*.jar"/>
</fileset>
</path>
<taskdef name="javac2" classname="com.intellij.ant.Javac2">
<classpath>
<pathelement location="${idea.community.build}/lib/javac2.jar"/>
<pathelement location="${idea.community.build}/lib/asm-all.jar"/>
</classpath>
</taskdef>
<macrodef name="copy_resources">
<attribute name="dest"/>
<sequential>
<echo message="Copying resources"/>
<patternset id="resources">
<include name="**/*.properties"/>
<include name="**/*.xml"/>
<include name="**/*.txt"/>
<include name="**/*.html"/>
<include name="**/*.png"/>
</patternset>
<copy toDir="@{dest}">
<fileset dir="${resources}">
<patternset refid="resources"/>
</fileset>
<fileset dir="${src}">
<patternset refid="resources"/>
</fileset>
<fileset dir="${gen}">
<patternset refid="resources"/>
</fileset>
<fileset dir="${test.src}">
<patternset refid="resources"/>
</fileset>
<fileset dir="${test.res}">
<patternset refid="resources"/>
</fileset>
</copy>
</sequential>
</macrodef>
<macrodef name="compile">
<attribute name="dest"/>
<sequential>
<pathconvert property="classpathProp" refid="classpath"/>
<echo>Classpath is ${classpathProp}</echo>
<javac2 destdir="@{dest}" classpathref="classpath" verbose="false" debug="true" source="1.6" target="1.6" includeantruntime="false">
<src path="${src}"/>
<src path="${gen}"/>
<src path="${test.src}"/>
<src path="${test.res}"/>
</javac2>
<copy_resources dest="@{dest}"/>
</sequential>
</macrodef>
<target name="init">
<tstamp/>
<mkdir dir="${build}"/>
<mkdir dir="${test.build}"/>
<echo message="Using IDEA build from: ${idea.community.build}"/>
<echo message="Using JAVA_HOME: ${java.home}"/>
</target>
<target name="compile" depends="clean,init" description="Compile the source code">
<taskdef name="javac2" classname="com.intellij.ant.Javac2">
<classpath>
<pathelement location="${idea.community.build}/lib/javac2.jar"/>
<pathelement location="${idea.community.build}/lib/forms_rt.jar"/>
<path refid="idea.classpath"/>
</classpath>
</taskdef>
<compile dest="${build}"/>
<copy todir="${build}">
<fileset dir="${resources}">
<include name="*/**"/>
</fileset>
</copy>
</target>
<target name="compile_test" depends="compile" description="Compile tests">
<compile dest="${test.build}"/>
</target>
<target name="test" depends="compile_test" description="test module">
<junit failureproperty="failure_found"
fork="yes"
forkmode="once"
haltonfailure="no"
printsummary="on"
showoutput="yes">
<classpath>
<path refid="classpath.test"/>
<pathelement location="${test.build}"/>
<pathelement location="${idea.community.build}/lib/junit-4.11.jar"/>
</classpath>
<formatter type="brief" usefile="false"/>
<batchtest>
<fileset dir="${test.src}">
<include name="**/*Test*.java"/>
<exclude name="**/*TestCase.java"/>
</fileset>
</batchtest>
</junit>
<antcall target="check_test"/>
</target>
<target name="check_test" if="failure_found">
<!--<fail message="Failures found"/>-->
<echo message="Failures found"/>
</target>
<target name="clean" description="clean up">
<delete dir="${build}"/>
<delete dir="${test.build}"/>
</target>
</project>