| <!-- |
| 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}"/> |
| <sysproperty key="intellij.build.kotlin.plugin" value ="../../prebuilts/tools/common/kotlin-plugin-ij/Kotlin"/> |
| <sysproperty key="intellij.build.dependencies.file" value ="build/dependencies/gradle.properties"/> |
| <sysproperty key="intellij.build.scripts.deps" value ="studio/build-scripts-deps"/> |
| <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> |
| |
| <target name="uicoverage"> |
| <call_gant script="${project.home}/build/scripts/uitests_in_studio.gant" target="coverage"/> |
| <typedef uri="antlib:org.jacoco.ant" classpath="${project.home}/plugins/coverage/lib/jacocoant.jar"/> |
| <jacoco:report xmlns:jacoco="antlib:org.jacoco.ant"> |
| <executiondata> |
| <file file="${project.home}/../../out/uicoverage/jacoco.exec"/> |
| </executiondata> |
| <structure name="UI Test Coverage"> |
| <classfiles> |
| <fileset dir="${project.home}/../../out/uicoverage/classes/"/> |
| </classfiles> |
| <sourcefiles> |
| <fileset dir="${project.home}/../adt/idea/adt-branding/src"/> |
| <fileset dir="${project.home}/../adt/idea/android-adb/src"/> |
| <fileset dir="${project.home}/../adt/idea/android-common/src"/> |
| <fileset dir="${project.home}/../adt/idea/android-debuggers/src"/> |
| <fileset dir="${project.home}/../adt/idea/android/gen"/> |
| <fileset dir="${project.home}/../adt/idea/android-lang/gen"/> |
| <fileset dir="${project.home}/../adt/idea/android-lang/src"/> |
| <fileset dir="${project.home}/../adt/idea/android-layout-inspector/src"/> |
| <fileset dir="${project.home}/../adt/idea/android/src"/> |
| <fileset dir="${project.home}/../adt/idea/apkanalyzer/src"/> |
| <fileset dir="${project.home}/../adt/idea/assistant/src"/> |
| <fileset dir="${project.home}/../adt/idea/build-common/src"/> |
| <fileset dir="${project.home}/../adt/idea/connection-assistant/src"/> |
| <fileset dir="${project.home}/../adt/idea/designer/src"/> |
| <fileset dir="${project.home}/../adt/idea/jps-plugin/src"/> |
| <fileset dir="${project.home}/../adt/idea/kotlin-integration/testData/callgraph"/> |
| <fileset dir="${project.home}/../adt/idea/layoutlib/src"/> |
| <fileset dir="${project.home}/../adt/idea/observable-demo/src"/> |
| <fileset dir="${project.home}/../adt/idea/observable/src"/> |
| <fileset dir="${project.home}/../adt/idea/observable-ui/src"/> |
| <fileset dir="${project.home}/../adt/idea/profilers-android/src"/> |
| <fileset dir="${project.home}/../adt/idea/project-system-gradle/src"/> |
| <fileset dir="${project.home}/../adt/idea/project-system/src"/> |
| <fileset dir="${project.home}/../adt/idea/rt/src"/> |
| <fileset dir="${project.home}/../adt/idea/sdk-updates/src"/> |
| <fileset dir="${project.home}/../adt/idea/smali/gen"/> |
| <fileset dir="${project.home}/../adt/idea/smali/src"/> |
| <fileset dir="${project.home}/../adt/idea/uitest-framework/src"/> |
| <fileset dir="${project.home}/../adt/idea/ultimate/src"/> |
| <fileset dir="${project.home}/../adt/idea/updater-ui/src"/> |
| <fileset dir="${project.home}/../adt/idea/whats-new-assistant/src"/> |
| <fileset dir="${project.home}/../adt/idea/wizard-model/src"/> |
| <fileset dir="${project.home}/../adt/idea/wizard/src"/> |
| <fileset dir="${project.home}/../studio/google/cloud/testing/firebase-testing/src"/> |
| <fileset dir="${project.home}/../studio/google/cloud/testing/test-recorder/src"/> |
| <fileset dir="${project.home}/../studio/google/cloud/tools/android-studio-plugin/src"/> |
| <fileset dir="${project.home}/../studio/google/cloud/tools/core-plugin/src"/> |
| <fileset dir="${project.home}/../studio/google/cloud/tools/google-login-plugin/src"/> |
| <fileset dir="${project.home}/../vendor/google/android-apk/src"/> |
| <fileset dir="${project.home}/../vendor/google/android-ndk/src"/> |
| <fileset dir="${project.home}/../vendor/google/dogfood/plugin/src"/> |
| <fileset dir="${project.home}/../vendor/google/GooglePlayLog"/> |
| </sourcefiles> |
| </structure> |
| <html destdir="${project.home}/../../out/uicoverage/report/"/> |
| </jacoco:report> |
| </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> |