blob: e651cf0e21a292a82834975fdb11a21de975e556 [file] [log] [blame]
Jean-Baptiste Querub56ea2a2013-01-08 11:11:20 -08001<project name="IntelliJ IDEA Community Edition" default="all">
2 <property name="project.home" value="${basedir}"/>
Siva Velusamy3ff7bb62013-09-06 15:47:55 -07003
4 <!--
5 Sets the out folder. Defaults to ${basedir}/out.
6 To override, use command line arg "out": e.g. -Dout=/path/
7 -->
8 <condition property="out.dir" value="${out}" else="${project.home}/out">
9 <isset property="out" />
10 </condition>
11
12 <property name="tmp.dir" value="${out.dir}/tmp"/>
Jean-Baptiste Querub56ea2a2013-01-08 11:11:20 -080013
Siva Velusamy12ecf982013-09-06 15:58:44 -070014 <!--
15 Sets the build number. Defaults to SNAPSHOT.
16 To override, use command line arg "buildNumber": e.g. -DbuildNumber=777
17 -->
18 <condition property="buildId" value="${buildNumber}" else="SNAPSHOT">
19 <isset property="buildNumber" />
20 </condition>
21
Jean-Baptiste Querub56ea2a2013-01-08 11:11:20 -080022 <target name="cleanup">
23 <delete dir="${out.dir}" failonerror="false"/>
24 </target>
25
26 <target name="init">
27 <mkdir dir="${out.dir}"/>
28 <mkdir dir="${tmp.dir}"/>
29 </target>
30
31 <macrodef name="call_gant">
32 <attribute name="script" />
Siva Velusamycfb099c2013-12-11 11:35:45 -080033 <attribute name="test.patterns" default="" />
Jean-Baptiste Querub56ea2a2013-01-08 11:11:20 -080034 <sequential>
35 <java failonerror="true" jar="${project.home}/lib/ant/lib/ant-launcher.jar" fork="true">
Tor Norbye11865892014-09-02 12:24:58 -070036 <jvmarg line="-Xmx2048m -XX:MaxPermSize=512m"/>
Siva Velusamy3ff7bb62013-09-06 15:47:55 -070037 <jvmarg value="-Dout=${out.dir}" />
Siva Velusamy12ecf982013-09-06 15:58:44 -070038 <jvmarg value="-DbuildNumber=${buildId}" />
Tor Norbye814f8292014-03-06 17:27:18 -080039 <sysproperty key="java.awt.headless" value="true"/>
Jean-Baptiste Querub56ea2a2013-01-08 11:11:20 -080040 <arg line="&quot;-Dgant.script=@{script}&quot;"/>
41 <arg line="&quot;-Dteamcity.build.tempDir=${tmp.dir}&quot;"/>
Siva Velusamycfb099c2013-12-11 11:35:45 -080042 <arg line="&quot;-Didea.test.patterns=@{test.patterns}&quot;"/>
Jean-Baptiste Querub56ea2a2013-01-08 11:11:20 -080043 <arg line="&quot;-Didea.test.group=ALL_EXCLUDE_DEFINED&quot;"/>
Jean-Baptiste Querub56ea2a2013-01-08 11:11:20 -080044 <arg value="-f"/>
45 <arg value="${project.home}/build/gant.xml"/>
46 </java>
47 </sequential>
48 </macrodef>
49
50 <target name="build" depends="init">
51 <call_gant script="${project.home}/build/scripts/dist.gant"/>
52 </target>
53
54 <target name="test" depends="init">
Tor Norbye814f8292014-03-06 17:27:18 -080055 <call_gant script="${project.home}/build/scripts/tests.gant" test.patterns="org.jetbrains.android.*;com.android.tools.idea.*;com.google.gct.*"/>
Jean-Baptiste Querub56ea2a2013-01-08 11:11:20 -080056 </target>
57
Tor Norbye11865892014-09-02 12:24:58 -070058 <target name="guiTests" depends="init">
Tor Norbyeece41442014-09-10 11:27:03 -070059 <delete>
60 <fileset dir="${project.home}/build" includes="TEST-com.android.tools.idea.tests.gui.*"/>
61 </delete>
Tor Norbye11865892014-09-02 12:24:58 -070062 <call_gant script="${project.home}/build/scripts/gui_tests.gant"/>
63 </target>
64
Tor Norbye814f8292014-03-06 17:27:18 -080065 <!-- The build task creates an updater.jar in ${out.dir}. This task bundles log4j & the updater into a single jar -->
66 <taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask" classpath="${project.home}/build/lib/jarjar-1.0.jar"/>
67 <target name="fullupdater" depends="build">
68 <jarjar jarfile="${out.dir}/updater-full.jar">
69 <zipfileset src="${out.dir}/updater.jar" />
70 <zipfileset src="lib/log4j.jar" />
71 </jarjar>
72 </target>
73
74 <target name="all" depends="cleanup,build,fullupdater"/>
Jean-Baptiste Querub56ea2a2013-01-08 11:11:20 -080075</project>