This repository has been archived by the owner on May 25, 2023. It is now read-only.
forked from go-lang-plugin-org/go-lang-idea-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-test.xml
140 lines (113 loc) · 4.82 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
<project name="Idea Google Go language scripted test file" default="test" basedir=".">
<property file="build.properties" />
<!-- set global properties for this build -->
<property name="build.compiler" value="modern"/>
<property name="src" location="src"/>
<property name="test.src" location="test"/>
<property name="build" location="build"/>
<property name="test" location="test"/>
<property name="test.build" location="build_test"/>
<property name="resources" value="${basedir}/go-ide/resources"/>
<property name="go.plugin.name" value="ro.redeul.google.go" />
<property name="idea.community.build" location="${basedir}/idea-IC/" />
<path id="idea.classpath">
<fileset dir="${idea.community.build}/lib">
<include name="*.jar"/>
</fileset>
</path>
<path id="my.classpath">
<pathelement location="${build}"/>
</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="${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="compile">
<attribute name="src"/>
<attribute name="dest"/>
<sequential>
<javac2 excludes="**/psi/resolve/references/*Reference.java" srcdir="@{src}" destdir="@{dest}" classpathref="classpath" verbose="false" debug="true" source="1.6" target="1.6" includeantruntime="false" />
<copy toDir="@{dest}">
<fileset dir="@{src}">
<include name="**/*.properties"/>
<include name="**/*.xml"/>
<include name="**/*.txt"/>
<include name="**/*.go"/>
</fileset>
</copy>
</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 src="${src}" dest="${build}"/>
<copy todir="${build}">
<fileset dir="${resources}">
<include name="*/**"/>
</fileset>
</copy>
</target>
<target name="compile_test" depends="compile" description="Compile tests">
<compile src="${test.src}" 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"/>
<exclude name="**/*TestCase.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>