| <!-- |
| This build script compiles, build distribution archives and run tests in IntelliJ IDEA Community Edition. Build process can be customized |
| via options, see org.jetbrains.intellij.build.BuildOptions and org.jetbrains.intellij.build.TestingOptions classes for details. System properties |
| from these classes can be passed as Ant properties in the command line, e.g. run 'ant -Dintellij.build.output.root=/path/to/dir' to |
| specify custom output directory. |
| |
| Note that this script is for building IntelliJ IDEA Community Edition only. If you want to build your own product based on IntelliJ Platform, |
| create a gant script for it, see javadoc for org.jetbrains.intellij.build package for details. |
| --> |
| <project name="IntelliJ IDEA Community Edition" xmlns:if="ant:if" xmlns:unless="ant:unless" default="build"> |
| <property name="project.home" value="${basedir}"/> |
| <condition property="intellij.build.output.root" else="${project.home}/out/studio"> |
| <isset property="intellij.build.output.root"/> |
| </condition> |
| |
| <!-- References to Bazel workspace and Bazel commandline to use --> |
| <dirname property="workspace" file="${project.home}/../"/> |
| <condition property="bazel" value="${workspace}/tools/base/bazel/bazel.cmd" else="${workspace}/tools/base/bazel/bazel"> |
| <os family="windows" /> |
| </condition> |
| <macrodef name="bazel"> |
| <attribute name="action" /> |
| <attribute name="target" /> |
| <attribute name="config" /> |
| <sequential> |
| <echo>${bazel} @{action} @{target} --config=@{config}</echo> |
| <exec executable="${bazel}" dir="${workspace}" failonerror="true" taskname="bazel"> |
| <arg value="@{action}" /> |
| <arg value="@{target}" /> |
| <arg value="--config=@{config}" /> |
| </exec> |
| </sequential> |
| </macrodef> |
| |
| <target name="init"> |
| <propertyset id="intellij.build.properties"> |
| <propertyref name="build.number"/> |
| <propertyref prefix="intellij.build."/> |
| <propertyref prefix="custom.project."/> |
| <propertyref name="ui.test.groups"/> |
| <propertyref name="include.aswb" /> |
| <propertyref name="bundle.ui.tests"/> |
| <propertyref name="idea.debug.mode"/> |
| <propertyref prefix="idea.gui.test."/> |
| <propertyref prefix="pass."/> <!-- handled by TestingTasksImpl.runTests --> |
| </propertyset> |
| <ant antfile="${project.home}/../adt/idea/android/build.xml" target="preBuild"> |
| <property name="config" value="release"/> |
| </ant> |
| </target> |
| |
| <macrodef name="call_gant"> |
| <attribute name="script" /> |
| <attribute name="target" default="default"/> |
| <sequential> |
| <java failonerror="true" jar="${project.home}/lib/ant/lib/ant-launcher.jar" fork="true"> |
| <jvmarg line="-Xmx2048m -XX:MaxPermSize=512m"/> |
| <sysproperty key="jna.nosys" value="true" /> |
| <sysproperty key="java.awt.headless" value="true"/> |
| <sysproperty key="compile.parallel" value="true" /> |
| <sysproperty key="gant.script" value="@{script}"/> |
| <sysproperty key="gant.target" value="@{target}"/> |
| <syspropertyset refid="intellij.build.properties"/> |
| <arg value="-f"/> |
| <arg value="${project.home}/build/gant.xml"/> |
| </java> |
| </sequential> |
| </macrodef> |
| |
| <!-- build distribution archives for IntelliJ Community Edition in out/idea-ce/artifacts directory --> |
| <target name="build" depends="init"> |
| <bazel if:set="include.aswb" |
| action="build" |
| target="@blaze//java/com/google/devtools/intellij/blaze/plugin/aswb:aswb_blaze_zip" |
| config="release"/> |
| <call_gant script="${project.home}/build/scripts/idea_community.gant"/> |
| </target> |
| |
| <target name="test" depends="init"> |
| <call_gant script="${project.home}/build/scripts/tests_in_community.gant"/> |
| </target> |
| |
| <target name="uitest" depends="init"> |
| <call_gant script="${project.home}/build/scripts/uitests_in_studio.gant"/> |
| </target> |
| |
| <!-- Creates an updater-full.jar in ${intellij.build.output.root}/artifacts, it includes 'intellij.platform.updater' module with all its dependencies --> |
| <target name="fullupdater" depends="init"> |
| <call_gant script="${project.home}/build/scripts/idea_community.gant" target="updater-full"/> |
| </target> |
| </project> |