-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
89 lines (77 loc) · 3.28 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
<!--
This build script compiles IntelliJ IDEA. Options include:
-Dout=/path/to/out/dir, defaults to ${basedir}/out
-Dbuild=123, defaults to SNAPSHOT
-Dtestpatterns=com.foo.*, defaults to empty string
-Dproduct=foo, defaults to idea
-->
<project name="IntelliJ IDEA Community Edition" default="all">
<property name="project.home" value="${basedir}"/>
<condition property="out.dir" value="${out}" else="${project.home}/out">
<isset property="out" />
</condition>
<condition property="build.number" value="${build}" else="SNAPSHOT">
<isset property="build" />
</condition>
<condition property="test.patterns" value="${testpatterns}"
else="org.jetbrains.android.*;com.android.tools.idea.*;com.google.gct.*;com.intellij.android.*">
<isset property="testpatterns" />
</condition>
<condition property="product.name" value="${product}" else="idea">
<isset property="product" />
</condition>
<property name="tmp.dir" value="${out.dir}/tmp"/>
<target name="cleanup">
<delete dir="${out.dir}" failonerror="false"/>
</target>
<target name="init">
<mkdir dir="${out.dir}"/>
<mkdir dir="${tmp.dir}"/>
<java classname="org.apache.tools.ant.Main" fork="true" failonerror="true" dir="${project.home}">
<sysproperty key="gant.script" value="${project.home}/build/scripts/download_kotlin.gant"/>
<classpath>
<fileset dir="${project.home}/lib/ant/lib">
<include name="*.jar"/>
</fileset>
</classpath>
<arg value="-f"/>
<arg value="${project.home}/build/gant.xml"/>
</java>
</target>
<macrodef name="call_gant">
<attribute name="script" />
<sequential>
<java failonerror="true" jar="${project.home}/lib/ant/lib/ant-launcher.jar" fork="true">
<jvmarg line="-Xmx612m -XX:MaxPermSize=152m"/>
<jvmarg value="-Djna.nosys=true" />
<jvmarg value="-Dout=${out.dir}" />
<jvmarg value="-DbuildNumber=${build.number}" />
<jvmarg value="-Didea.test.patterns=${test.patterns}" />
<jvmarg value="-Dproduct=${product.name}" />
<sysproperty key="java.awt.headless" value="true"/>
<arg line=""-Dgant.script=@{script}""/>
<arg line=""-Dteamcity.build.tempDir=${tmp.dir}""/>
<arg line=""-Didea.test.group=ALL_EXCLUDE_DEFINED""/>
<arg value="-f"/>
<arg value="${project.home}/build/gant.xml"/>
</java>
</sequential>
</macrodef>
<target name="build" depends="init">
<call_gant script="${project.home}/build/scripts/dist.gant"/>
</target>
<target name="test" depends="init">
<call_gant script="${project.home}/build/scripts/tests.gant"/>
</target>
<!-- The build task creates an updater.jar in ${out.dir}. This task bundles the updater and its dependencies into a single jar -->
<taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask" classpath="${project.home}/build/lib/jarjar-1.0.jar"/>
<target name="fullupdater" depends="build">
<jarjar jarfile="${out.dir}/updater-full.jar">
<zipfileset src="${out.dir}/updater.jar" />
<zipfileset src="lib/log4j.jar" />
<zipfileset src="lib/jna.jar" />
<zipfileset src="lib/jna-utils.jar" />
</jarjar>
</target>
<target name="all" depends="cleanup,build"/>
</project>