-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
139 lines (139 loc) · 5.62 KB
/
build.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
<project name="Stellar SDK Intellij Plugin" default="test" basedir=".">
<property name="build.compiler" value="modern"/>
<property name="lib.location" location="${basedir}/lib"/>
<property name="src" location="${basedir}/src"/>
<property name="test.src" location="${basedir}/test"/>
<property name="build" location="build"/>
<property name="test.build" location="build_test"/>
<property name="resources" value="${basedir}/resources"/>
<property name="idea.community.build" location="${basedir}/idea-IC/"/>
<path id="idea.classpath">
<fileset dir="${idea.community.build}/lib">
<include name="*.jar"/>
</fileset>
<fileset dir="${idea.community.build}/plugins/coverage/lib">
<include name="*.jar"/>
</fileset>
</path>
<path id="my.classpath">
<pathelement location="${build}"/>
<fileset dir="${lib.location}">
<include name="*.jar"/>
</fileset>
</path>
<path id="classpath">
<path refid="my.classpath"/>
<path refid="idea.classpath"/>
</path>
<path id="classpath.test">
<pathelement location="${build}"/>
<pathelement location="${test.build}"/>
<fileset dir="${lib.location}">
<include name="*.jar"/>
</fileset>
<fileset dir="${idea.community.build}/lib">
<include name="**/*.jar"/>
<exclude name="ant/lib/**/*.jar"/>
</fileset>
<fileset dir="${idea.community.build}/plugins/coverage/lib">
<include name="*.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"/>
</patternset>
<copy toDir="@{dest}">
<fileset dir="${resources}">
<patternset refid="resources"/>
</fileset>
<fileset dir="${src}">
<patternset refid="resources"/>
</fileset>
<fileset dir="${test.src}">
<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.8" target="1.8"
includeantruntime="false">
<src path="${src}"/>
<src path="${test.src}"/>
</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="Run the tests">
<echo message="Running tests"/>
<property name="suspend" value="n"/>
<junit printsummary="yes" haltonfailure="false" showoutput="yes" failureProperty="failure_found" fork="yes"
forkmode="once" reloading="no">
<jvmarg value="-Didea.home.path=${idea.community.build}"/>
<jvmarg value="-Xbootclasspath/a:${idea.community.build}/lib/boot.jar"/>
<jvmarg value="-Dfile.encoding=UTF-8"/>
<jvmarg value="-ea"/>
<jvmarg line="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=${suspend},address=43251"/>
<jvmarg value="-Didea.launcher.bin.path=${idea.community.build}/bin"/>
<classpath refid="classpath.test"/>
<formatter type="brief" usefile="false"/>
<batchtest>
<fileset dir="${test.src}">
<include name="**/*Test.java"/>
</fileset>
</batchtest>
</junit>
<antcall target="check_test"/>
</target>
<target name="check_test" if="failure_found">
<fail message="Failures found"/>
</target>
<target name="clean" description="clean up">
<delete dir="${build}"/>
<delete dir="${test.build}"/>
</target>
</project>