Jean-Baptiste Queru | b56ea2a | 2013-01-08 11:11:20 -0800 | [diff] [blame] | 1 | <project name="IntelliJ IDEA Community Edition" default="all"> |
| 2 | <property name="project.home" value="${basedir}"/> |
Siva Velusamy | 3ff7bb6 | 2013-09-06 15:47:55 -0700 | [diff] [blame] | 3 | |
| 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 Queru | b56ea2a | 2013-01-08 11:11:20 -0800 | [diff] [blame] | 13 | |
Siva Velusamy | 12ecf98 | 2013-09-06 15:58:44 -0700 | [diff] [blame] | 14 | <!-- |
| 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 Queru | b56ea2a | 2013-01-08 11:11:20 -0800 | [diff] [blame] | 22 | <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 Velusamy | cfb099c | 2013-12-11 11:35:45 -0800 | [diff] [blame] | 33 | <attribute name="test.patterns" default="" /> |
Jean-Baptiste Queru | b56ea2a | 2013-01-08 11:11:20 -0800 | [diff] [blame] | 34 | <sequential> |
| 35 | <java failonerror="true" jar="${project.home}/lib/ant/lib/ant-launcher.jar" fork="true"> |
Tor Norbye | 1186589 | 2014-09-02 12:24:58 -0700 | [diff] [blame] | 36 | <jvmarg line="-Xmx2048m -XX:MaxPermSize=512m"/> |
Siva Velusamy | 3ff7bb6 | 2013-09-06 15:47:55 -0700 | [diff] [blame] | 37 | <jvmarg value="-Dout=${out.dir}" /> |
Siva Velusamy | 12ecf98 | 2013-09-06 15:58:44 -0700 | [diff] [blame] | 38 | <jvmarg value="-DbuildNumber=${buildId}" /> |
Tor Norbye | 814f829 | 2014-03-06 17:27:18 -0800 | [diff] [blame] | 39 | <sysproperty key="java.awt.headless" value="true"/> |
Jean-Baptiste Queru | b56ea2a | 2013-01-08 11:11:20 -0800 | [diff] [blame] | 40 | <arg line=""-Dgant.script=@{script}""/> |
| 41 | <arg line=""-Dteamcity.build.tempDir=${tmp.dir}""/> |
Siva Velusamy | cfb099c | 2013-12-11 11:35:45 -0800 | [diff] [blame] | 42 | <arg line=""-Didea.test.patterns=@{test.patterns}""/> |
Jean-Baptiste Queru | b56ea2a | 2013-01-08 11:11:20 -0800 | [diff] [blame] | 43 | <arg line=""-Didea.test.group=ALL_EXCLUDE_DEFINED""/> |
Jean-Baptiste Queru | b56ea2a | 2013-01-08 11:11:20 -0800 | [diff] [blame] | 44 | <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 Norbye | 814f829 | 2014-03-06 17:27:18 -0800 | [diff] [blame] | 55 | <call_gant script="${project.home}/build/scripts/tests.gant" test.patterns="org.jetbrains.android.*;com.android.tools.idea.*;com.google.gct.*"/> |
Jean-Baptiste Queru | b56ea2a | 2013-01-08 11:11:20 -0800 | [diff] [blame] | 56 | </target> |
| 57 | |
Tor Norbye | 1186589 | 2014-09-02 12:24:58 -0700 | [diff] [blame] | 58 | <target name="guiTests" depends="init"> |
Tor Norbye | ece4144 | 2014-09-10 11:27:03 -0700 | [diff] [blame] | 59 | <delete> |
| 60 | <fileset dir="${project.home}/build" includes="TEST-com.android.tools.idea.tests.gui.*"/> |
| 61 | </delete> |
Tor Norbye | 1186589 | 2014-09-02 12:24:58 -0700 | [diff] [blame] | 62 | <call_gant script="${project.home}/build/scripts/gui_tests.gant"/> |
| 63 | </target> |
| 64 | |
Tor Norbye | 814f829 | 2014-03-06 17:27:18 -0800 | [diff] [blame] | 65 | <!-- 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 Queru | b56ea2a | 2013-01-08 11:11:20 -0800 | [diff] [blame] | 75 | </project> |