blob: 1971f7ba1f9a2fa12d9a3c4e4e37172559bfa599 [file] [log] [blame]
<!--
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 studio
-->
<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="studio">
<isset property="product" />
</condition>
<condition property="studio.ui.tests" value="${enable.ui.tests}" else="">
<isset property="enable.ui.tests" />
</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}"/>
</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="-Xmx2048m -XX:MaxPermSize=512m"/>
<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}" />
<jvmarg value="-Dstudio.ui.tests=${studio.ui.tests}" />
<sysproperty key="java.awt.headless" value="true"/>
<arg line="&quot;-Dgant.script=@{script}&quot;"/>
<arg line="&quot;-Dteamcity.build.tempDir=${tmp.dir}&quot;"/>
<arg line="&quot;-Didea.test.group=ALL_EXCLUDE_DEFINED&quot;"/>
<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>
<target name="guiTests" depends="init">
<delete>
<fileset dir="${project.home}/build" includes="TEST-com.android.tools.idea.tests.gui.*"/>
</delete>
<call_gant script="${project.home}/build/scripts/gui_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,fullupdater"/>
</project>