740 lines
34 KiB
XML
740 lines
34 KiB
XML
<project name="Update Dependencies" default="update">
|
|
<property name="ideaVersion" value="141.1010.3"/>
|
|
|
|
<property name="kotlin.bootstrap.locator" value="buildType:bt345,tag:bootstrap,status:SUCCESS" />
|
|
<property name="kotlin.bootstrap.locator.force" value="false"/>
|
|
|
|
<property name="markdown.locator" value="buildType:IntelliJMarkdownParser_Build,status:SUCCESS"/>
|
|
|
|
<property name="bootstrap.build.no.tests" value="false"/>
|
|
|
|
<condition property="os.tag" value="win.zip">
|
|
<os family="windows"/>
|
|
</condition>
|
|
|
|
<condition property="os.tag" value="mac.zip">
|
|
<os family="mac"/>
|
|
</condition>
|
|
|
|
<condition property="os.tag" value="tar.gz">
|
|
<and>
|
|
<os family="unix"/>
|
|
<not>
|
|
<os family="mac"/>
|
|
</not>
|
|
</and>
|
|
</condition>
|
|
|
|
<property name="idea.sdk.fetch.needed" value="true"/>
|
|
|
|
<property name="dependencies.info.file" value="dependencies/dependencies.properties"/>
|
|
|
|
<property file="${dependencies.info.file}" prefix="dependencies.info.prev"/>
|
|
|
|
<target name="update" depends="fetch-third-party,fetch-annotations" description="Update dependencies from public server">
|
|
<execute_update_with_id_resolve
|
|
teamcity.server.url="https://teamcity.jetbrains.com"
|
|
build.locator.request="buildType:bt410,status:SUCCESS,branch:idea/${ideaVersion}"/>
|
|
</target>
|
|
|
|
<target name="jb_update" depends="fetch-third-party,fetch-annotations" description="Update dependencies from internal server">
|
|
<execute_update_with_id_resolve
|
|
teamcity.server.url="http://buildserver.labs.intellij.net"
|
|
build.locator.request="buildType:bt3498,status:SUCCESS,branch:/idea/${ideaVersion}"/>
|
|
</target>
|
|
|
|
<target name="jb_update_continuous_139" depends="fetch-third-party,fetch-annotations">
|
|
<execute_update_with_id_resolve
|
|
teamcity.server.url="http://buildserver.labs.intellij.net"
|
|
build.locator.request="buildType:ijplatform_IjPlatformMaster_IdeaTrunk_CommunityDist,status:SUCCESS"/>
|
|
</target>
|
|
|
|
<target name="jb_update_continuous_141" depends="fetch-third-party,fetch-annotations">
|
|
<execute_update_with_id_resolve
|
|
teamcity.server.url="http://buildserver.labs.intellij.net"
|
|
build.locator.request="buildType:ijplatform_IjPlatform141_IdeaTrunk_CommunityDist,status:SUCCESS"/>
|
|
</target>
|
|
|
|
<target name="jb_update_continuous_142" depends="fetch-third-party,fetch-annotations">
|
|
<execute_update_with_id_resolve
|
|
teamcity.server.url="http://buildserver.labs.intellij.net"
|
|
build.locator.request="buildType:bt662,status:SUCCESS"/>
|
|
</target>
|
|
|
|
<macrodef name="get-maven-library">
|
|
<attribute name="prefix"/>
|
|
<attribute name="lib"/>
|
|
<attribute name="version"/>
|
|
<attribute name="bin" default="true"/>
|
|
<attribute name="src" default="true"/>
|
|
<attribute name="server" default="http://repository.jetbrains.com/remote-repos"/>
|
|
<attribute name="jar.name.base" default="@{lib}-@{version}"/>
|
|
<attribute name="target.jar.name.base" default="@{jar.name.base}"/>
|
|
<attribute name="path" default="@{prefix}/@{lib}/@{version}/@{jar.name.base}"/>
|
|
<attribute name="download" default="dependencies/download"/>
|
|
<attribute name="dependencies" default="dependencies"/>
|
|
<sequential>
|
|
<taskdef resource="net/sf/antcontrib/antcontrib.properties" classpath="${basedir}/dependencies/ant-contrib.jar"/>
|
|
<if>
|
|
<istrue value="@{bin}"/>
|
|
<then>
|
|
<get src="@{server}/@{path}.jar" dest="@{download}/@{jar.name.base}.jar" usetimestamp="true"/>
|
|
<copy file="@{download}/@{jar.name.base}.jar" tofile="@{dependencies}/@{target.jar.name.base}.jar" overwrite="true"/>
|
|
</then>
|
|
</if>
|
|
|
|
<if>
|
|
<istrue value="@{src}"/>
|
|
<then>
|
|
<get src="@{server}/@{path}-sources.jar" dest="@{download}/@{jar.name.base}-sources.jar" usetimestamp="true"/>
|
|
<copy file="@{download}/@{jar.name.base}-sources.jar" tofile="@{dependencies}/@{target.jar.name.base}-sources.jar"
|
|
overwrite="true"/>
|
|
</then>
|
|
</if>
|
|
</sequential>
|
|
</macrodef>
|
|
|
|
<macrodef name="get-ant-library">
|
|
<attribute name="version"/>
|
|
<attribute name="folderName"/>
|
|
<sequential>
|
|
<get src="http://archive.apache.org/dist/ant/binaries/apache-ant-@{version}-bin.tar.gz"
|
|
dest="dependencies/download/apache-ant-@{version}-bin.tar.gz" usetimestamp="true"/>
|
|
|
|
<get src="http://archive.apache.org/dist/ant/source/apache-ant-@{version}-src.zip"
|
|
dest="dependencies/apache-ant-@{version}-src.zip" usetimestamp="true"/>
|
|
|
|
<delete dir="dependencies/@{folderName}" failonerror="false"/>
|
|
<untar src="dependencies/download/apache-ant-@{version}-bin.tar.gz" dest="dependencies" compression="gzip"/>
|
|
<move file="dependencies/apache-ant-@{version}" tofile="dependencies/@{folderName}"/>
|
|
</sequential>
|
|
</macrodef>
|
|
|
|
<target name="fetch-third-party">
|
|
<mkdir dir="dependencies"/>
|
|
<mkdir dir="dependencies/download"/>
|
|
|
|
<!-- ProGuard -->
|
|
<get src="http://heanet.dl.sourceforge.net/project/proguard/proguard/5.1/proguard5.1.zip"
|
|
dest="dependencies/download/proguard5.1.zip" usetimestamp="true"/>
|
|
|
|
<delete file="dependencies/proguard.jar" failonerror="false"/>
|
|
<unzip src="dependencies/download/proguard5.1.zip" dest="dependencies">
|
|
<patternset>
|
|
<include name="proguard5.1/lib/proguard.jar"/>
|
|
</patternset>
|
|
<mapper type="flatten"/>
|
|
</unzip>
|
|
|
|
<!-- ant contrib -->
|
|
<get src="http://heanet.dl.sourceforge.net/project/ant-contrib/ant-contrib/1.0b3/ant-contrib-1.0b3-bin.zip"
|
|
dest="dependencies/download/ant-contrib-1.0b3-bin.zip" usetimestamp="true"/>
|
|
|
|
<delete file="dependencies/ant-contrib.jar" failonerror="false"/>
|
|
<unzip src="dependencies/download/ant-contrib-1.0b3-bin.zip" dest="dependencies">
|
|
<patternset>
|
|
<include name="ant-contrib/ant-contrib-1.0b3.jar"/>
|
|
</patternset>
|
|
<mapper type="merge" to="ant-contrib.jar"/>
|
|
</unzip>
|
|
|
|
<!-- JarJar -->
|
|
<get src="http://jarjar.googlecode.com/files/jarjar-1.2.jar" dest="dependencies/download/jarjar-1.2.jar" usetimestamp="true"/>
|
|
<copy file="dependencies/download/jarjar-1.2.jar" tofile="dependencies/jarjar.jar" overwrite="true"/>
|
|
|
|
<!-- ant 1.7.0, 1.8.0 -->
|
|
<get-ant-library version="1.7.0" folderName="ant-1.7"/>
|
|
<get-ant-library version="1.8.0" folderName="ant-1.8"/>
|
|
|
|
<!-- dx.jar -->
|
|
<property name="android-build-tools.zip" value="build-tools_r21.1.1-linux.zip"/>
|
|
<get
|
|
src="https://dl-ssl.google.com/android/repository/${android-build-tools.zip}"
|
|
dest="dependencies/download/${android-build-tools.zip}"
|
|
usetimestamp="true"/>
|
|
<unzip src="dependencies/download/${android-build-tools.zip}" dest="dependencies"/>
|
|
|
|
<property name="android-sources.tgz" value="dx.tar.gz"/>
|
|
<get
|
|
src="https://android.googlesource.com/platform/dalvik/+archive/android-5.0.0_r2/${android-sources.tgz}"
|
|
dest="dependencies/download/${android-sources.tgz}"
|
|
usetimestamp="true"/>
|
|
<delete dir="dependencies/dx-src" failonerror="false"/>
|
|
<untar src="dependencies/download/${android-sources.tgz}" dest="dependencies/dx-src" compression="gzip"/>
|
|
|
|
<!-- jflex 1.4 -->
|
|
<mkdir dir="dependencies/jflex"/>
|
|
<get src="https://raw.github.com/JetBrains/intellij-community/master/tools/lexer/jflex-1.4/lib/JFlex.jar"
|
|
dest="dependencies/jflex/JFlex.jar" usetimestamp="true"/>
|
|
<get src="https://raw.github.com/JetBrains/intellij-community/master/tools/lexer/idea-flex.skeleton"
|
|
dest="dependencies/jflex/idea-flex.skeleton" usetimestamp="true"/>
|
|
|
|
<!-- jline -->
|
|
<get-maven-library prefix="jline" lib="jline" version="2.9" target.jar.name.base="jline"/>
|
|
|
|
<!-- jansi -->
|
|
<!--
|
|
<get-maven-library prefix="org/fusesource/jansi" lib="jansi" version="1.9"/>
|
|
-->
|
|
|
|
<!-- Guava 17 sources-->
|
|
<get-maven-library prefix="com/google/guava" lib="guava" version="17.0" bin="false"/>
|
|
|
|
<!-- ASM -->
|
|
<get src="https://raw.github.com/JetBrains/intellij-community/master/lib/src/asm5-src.zip"
|
|
dest="dependencies/asm5-src.zip"/>
|
|
<!-- <get-asm-sources-and-rename-packages asm.version="5.0.1"/> -->
|
|
|
|
<!-- Junit Sources -->
|
|
<get-maven-library prefix="junit" lib="junit" version="4.11" bin="false"/>
|
|
<get-maven-library prefix="org/hamcrest" lib="hamcrest-core" version="1.3" bin="false"/>
|
|
|
|
<!-- Protocol Buffers -->
|
|
<get-maven-library prefix="com/google/protobuf" lib="protobuf-java" version="2.5.0" bin="false"/>
|
|
|
|
<!-- Android SDK platform -->
|
|
<get_android_sdk version.full="21_r01" version.number="21" version.buildtools="21.1.1"/>
|
|
|
|
<!-- CLI Parser -->
|
|
<get-maven-library prefix="com/github/spullara/cli-parser" lib="cli-parser" version="1.1.1"/>
|
|
|
|
<!-- Rhino -->
|
|
<get-maven-library prefix="org/mozilla" lib="rhino" version="1.7.6"/>
|
|
|
|
<!-- Closure Compiler -->
|
|
<!-- A download url taken from http://code.google.com/p/closure-compiler/wiki/BinaryDownloads -->
|
|
<get src="http://dl.google.com/closure-compiler/compiler-20131014.zip"
|
|
dest="dependencies/download/closure-compiler.zip" usetimestamp="true"/>
|
|
|
|
<delete file="dependencies/closure-compiler.jar" failonerror="false"/>
|
|
<unzip src="dependencies/download/closure-compiler.zip" dest="dependencies">
|
|
<patternset>
|
|
<include name="compiler.jar"/>
|
|
</patternset>
|
|
<mapper type="merge" to="closure-compiler.jar"/>
|
|
</unzip>
|
|
|
|
<delete file="dependencies/android.jar" failonerror="false"/>
|
|
<get src="http://dl-ssl.google.com/android/repository/android-19_r02.zip"
|
|
dest="dependencies/download/android-sdk.zip" usetimestamp="true"/>
|
|
<unzip src="dependencies/download/android-sdk.zip" dest="dependencies">
|
|
<patternset>
|
|
<include name="**/android.jar"/>
|
|
</patternset>
|
|
<mapper type="flatten"/>
|
|
</unzip>
|
|
|
|
<taskdef resource="net/sf/antcontrib/antcontrib.properties" classpath="${basedir}/dependencies/ant-contrib.jar"/>
|
|
|
|
<!-- Bootstrap compiler -->
|
|
<if>
|
|
<or>
|
|
<not><isset property="teamcity.version"/></not>
|
|
<and>
|
|
<istrue value="${kotlin.bootstrap.locator.force}"/>
|
|
<istrue value="${bootstrap.build.no.tests}"/>
|
|
</and>
|
|
</or>
|
|
<then>
|
|
<!-- Download bootstrap compiler for local build -->
|
|
<download_teamcity_artifact
|
|
teamcity.server.url="https://teamcity.jetbrains.com"
|
|
build.locator.request="${kotlin.bootstrap.locator}"
|
|
artifact.path="kotlin-plugin-{build.number}.zip"
|
|
dest="dependencies/download/bootstrap-compiler.zip"
|
|
usetimestamp="true"/>
|
|
|
|
<delete dir="dependencies/bootstrap-compiler" failonerror="false"/>
|
|
<unzip src="dependencies/download/bootstrap-compiler.zip" dest="dependencies/bootstrap-compiler"/>
|
|
</then>
|
|
<else>
|
|
<!-- Teamcity should provide bootstrap compiler with dependency feature -->
|
|
<if>
|
|
<not>
|
|
<and>
|
|
<available file="dependencies/bootstrap-compiler/Kotlin"/>
|
|
</and>
|
|
</not>
|
|
<then>
|
|
<fail message="Bootstrap compiler is expected to be downloaded to 'dependencies/bootstrap-compiler' by TeamCity"/>
|
|
</then>
|
|
<else>
|
|
<echo message="Bootstrap compiler found in 'dependencies/bootstrap-compiler'"/>
|
|
</else>
|
|
</if>
|
|
</else>
|
|
</if>
|
|
|
|
<if>
|
|
<matches pattern="mac\.zip|tar\.gz" string="${os.tag}"/>
|
|
<then>
|
|
<!-- Java can't manipulate permissions -->
|
|
<exec executable="find">
|
|
<arg value="dependencies/bootstrap-compiler/Kotlin/kotlinc/bin"/>
|
|
<arg line="-name 'kotlin*' ! -name '*.bat' -exec chmod a+x '{}' ;"/>
|
|
</exec>
|
|
</then>
|
|
</if>
|
|
|
|
<!-- Markdown parser -->
|
|
<download_teamcity_artifact
|
|
teamcity.server.url="https://teamcity.jetbrains.com"
|
|
build.locator.request="${markdown.locator}"
|
|
artifact.path="markdown_jar/markdown.jar"
|
|
dest="dependencies/markdown.jar"
|
|
usetimestamp="true"
|
|
build.number.pattern="\d+\s-\sKotlin\s[\d\.]+"
|
|
/>
|
|
|
|
</target>
|
|
|
|
<macrodef name="get_android_sdk">
|
|
<attribute name="version.full"/>
|
|
<attribute name="version.number"/>
|
|
<attribute name="version.buildtools"/>
|
|
<sequential>
|
|
<taskdef resource="net/sf/antcontrib/antcontrib.properties" classpath="${basedir}/dependencies/ant-contrib.jar"/>
|
|
|
|
<condition property="android.os.tag" value="windows">
|
|
<os family="windows"/>
|
|
</condition>
|
|
|
|
<condition property="android.os.tag" value="macosx">
|
|
<os family="mac"/>
|
|
</condition>
|
|
|
|
<condition property="android.os.tag" value="linux">
|
|
<and>
|
|
<os family="unix"/>
|
|
<not>
|
|
<os family="mac"/>
|
|
</not>
|
|
</and>
|
|
</condition>
|
|
|
|
<delete dir="dependencies/androidSDK" failonerror="false"/>
|
|
<get
|
|
src="https://dl-ssl.google.com/android/repository/android-@{version.full}.zip"
|
|
dest="dependencies/android_sdk.zip" usetimestamp="true"/>
|
|
|
|
<unzip src="dependencies/android_sdk.zip" dest="dependencies/androidSDK/platforms/android-@{version.number}/">
|
|
<cutdirsmapper dirs="1"/>
|
|
</unzip>
|
|
|
|
<get
|
|
src="https://dl-ssl.google.com/android/repository/build-tools_r@{version.buildtools}-${android.os.tag}.zip"
|
|
dest="dependencies/android_buildtools.zip" usetimestamp="true"/>
|
|
|
|
<unzip src="dependencies/android_buildtools.zip" dest="dependencies/androidSDK/build-tools/@{version.buildtools}/">
|
|
<cutdirsmapper dirs="1"/>
|
|
</unzip>
|
|
|
|
<if>
|
|
<equals arg1="${android.os.tag}" arg2="windows"/>
|
|
<then/>
|
|
<else>
|
|
<exec executable="chmod">
|
|
<arg value="a+x"/>
|
|
<arg path="dependencies/androidSDK/build-tools/@{version.buildtools}/aapt"/>
|
|
<arg path="dependencies/androidSDK/build-tools/@{version.buildtools}/aidl"/>
|
|
<arg path="dependencies/androidSDK/build-tools/@{version.buildtools}/dx"/>
|
|
<arg path="dependencies/androidSDK/build-tools/@{version.buildtools}/zipalign"/>
|
|
</exec>
|
|
</else>
|
|
</if>
|
|
</sequential>
|
|
</macrodef>
|
|
|
|
<macrodef name="build-protobuf-java-lite">
|
|
<sequential>
|
|
<condition property="kotlinc.executable.path" value="kotlinc.bat" else="kotlinc">
|
|
<os family="windows"/>
|
|
</condition>
|
|
|
|
<exec executable="dependencies/bootstrap-compiler/Kotlin/kotlinc/bin/${kotlinc.executable.path}" failonerror="true">
|
|
<arg value="-script"/>
|
|
<arg value="generators/infrastructure/build-protobuf-lite.kts"/>
|
|
<arg value="${basedir}/ideaSDK/lib/protobuf-2.5.0.jar"/>
|
|
<arg value="${basedir}/dependencies/protobuf-2.5.0-lite.jar"/>
|
|
</exec>
|
|
</sequential>
|
|
</macrodef>
|
|
|
|
<macrodef name="get-asm-sources-and-rename-packages">
|
|
<attribute name="asm.version"/>
|
|
<sequential>
|
|
<!-- Download ASM sources -->
|
|
<get-maven-library prefix="org/ow2/asm" lib="asm-debug-all" version="@{asm.version}" bin="false"/>
|
|
|
|
<!-- Rename packages in the sources -->
|
|
<delete dir="dependencies/download/asm-src" failonerror="false"/>
|
|
<unzip src="dependencies/download/asm-debug-all-@{asm.version}-sources.jar" dest="dependencies/download/asm-src">
|
|
<patternset>
|
|
<include name="**/*"/>
|
|
</patternset>
|
|
</unzip>
|
|
|
|
<replaceregexp match="org\.objectweb\.asm" replace="org.jetbrains.org.objectweb.asm" flags="g">
|
|
<fileset dir="dependencies/download/asm-src/">
|
|
<include name="**/*.java"/>
|
|
</fileset>
|
|
</replaceregexp>
|
|
|
|
<move file="dependencies/download/asm-src/org/objectweb/asm"
|
|
tofile="dependencies/download/asm-src/org/jetbrains/org/objectweb/asm"/>
|
|
|
|
<zip destfile="dependencies/jetbrains-asm-all-@{asm.version}-src.zip" basedir="dependencies/download/asm-src"/>
|
|
</sequential>
|
|
</macrodef>
|
|
|
|
<macrodef name="execute_update_with_id_resolve">
|
|
<attribute name="teamcity.server.url"/>
|
|
<attribute name="build.locator.request"/>
|
|
|
|
<sequential>
|
|
<loadresource property="execute.build.id">
|
|
<url url="@{teamcity.server.url}/guestAuth/app/rest/builds/?locator=@{build.locator.request},count:1"/>
|
|
<filterchain>
|
|
<tokenfilter>
|
|
<filetokenizer/>
|
|
<replaceregex pattern="^(.*)\sid="(\d+)"(.*)$" replace="\2" flags="s"/>
|
|
</tokenfilter>
|
|
</filterchain>
|
|
</loadresource>
|
|
|
|
<if>
|
|
<equals arg1="${dependencies.info.prev.idea.build.id}" arg2="${execute.build.id}"/>
|
|
<then>
|
|
<echo message="IDEA build id: ${execute.build.id}. Already downloaded."/>
|
|
</then>
|
|
<else>
|
|
<echo message="IDEA build id: ${execute.build.id}, previous build id: ${dependencies.info.prev.idea.build.id}"/>
|
|
<execute_update base.url="@{teamcity.server.url}/guestAuth/app/rest/builds/id:${execute.build.id}"/>
|
|
|
|
<propertyfile file="${dependencies.info.file}">
|
|
<entry key="idea.build.id" value="${execute.build.id}"/>
|
|
</propertyfile>
|
|
</else>
|
|
</if>
|
|
</sequential>
|
|
</macrodef>
|
|
|
|
<macrodef name="download_teamcity_artifact">
|
|
<attribute name="teamcity.server.url"/>
|
|
<attribute name="build.locator.request"/>
|
|
<attribute name="artifact.path"/>
|
|
<attribute name="dest"/>
|
|
<attribute name="usetimestamp"/>
|
|
<attribute name="build.number.pattern" default="[\d\.]+"/>
|
|
|
|
<sequential>
|
|
<local name="artifact.build.id"/>
|
|
|
|
<local name="build.request.url"/>
|
|
<property name="build.request.url" value="@{teamcity.server.url}/guestAuth/app/rest/builds/?locator=@{build.locator.request},count:1"/>
|
|
|
|
<echo message="Requested URL ${build.request.url}"/>
|
|
|
|
<loadresource property="artifact.build.id">
|
|
<url url="${build.request.url}"/>
|
|
<filterchain>
|
|
<tokenfilter>
|
|
<filetokenizer/>
|
|
<replaceregex pattern="^(.*)\sid="(\d+)"(.*)$" replace="\2" flags="s"/>
|
|
</tokenfilter>
|
|
</filterchain>
|
|
</loadresource>
|
|
|
|
<local name="processed.artifact.path"/>
|
|
|
|
<local name="artifact.build.number"/>
|
|
<loadresource property="artifact.build.number">
|
|
<url url="${build.request.url}"/>
|
|
<filterchain>
|
|
<tokenfilter>
|
|
<filetokenizer/>
|
|
<replaceregex pattern="^(.*)\snumber="(@{build.number.pattern})"(.*)$" replace="\2" flags="s"/>
|
|
</tokenfilter>
|
|
</filterchain>
|
|
</loadresource>
|
|
|
|
<propertyregex property="processed.artifact.path"
|
|
input="@{artifact.path}"
|
|
regexp="\{build.number\}"
|
|
replace="${artifact.build.number}"
|
|
global="true"
|
|
defaultvalue="@{artifact.path}"/>
|
|
|
|
<echo message="Build Number: ${artifact.build.number} Build Id: ${artifact.build.id}"/>
|
|
|
|
<get
|
|
src="@{teamcity.server.url}/guestAuth/app/rest/builds/id:${artifact.build.id}/artifacts/content/${processed.artifact.path}"
|
|
dest="@{dest}" usetimestamp="@{usetimestamp}"/>
|
|
</sequential>
|
|
</macrodef>
|
|
|
|
<macrodef name="execute_update">
|
|
<attribute name="base.url"/>
|
|
|
|
<sequential>
|
|
<taskdef resource="net/sf/antcontrib/antcontrib.properties" classpath="${basedir}/dependencies/ant-contrib.jar"/>
|
|
|
|
<loadresource property="idea.build.number">
|
|
<url url="@{base.url}/artifacts/children"/>
|
|
<filterchain>
|
|
<tokenfilter>
|
|
<filetokenizer/>
|
|
|
|
<replaceregex pattern="^(.*)ideaIC-([\w\.]+)\.win\.zip(.*)$" replace="\2" flags="s"/>
|
|
</tokenfilter>
|
|
</filterchain>
|
|
</loadresource>
|
|
|
|
<property name="idea.archive.name" value="ideaIC-${idea.build.number}.${os.tag}"/>
|
|
|
|
<echo message="IDEA build number: ${idea.build.number}"/>
|
|
<echo message="IDEA archive file: ${idea.archive.name}"/>
|
|
|
|
<property name="content.base.url" value="@{base.url}/artifacts/content"/>
|
|
|
|
<property name="core" value="ideaSDK/core"/>
|
|
<property name="core-analysis" value="ideaSDK/core-analysis"/>
|
|
<property name="jps" value="ideaSDK/jps"/>
|
|
<property name="jps-test" value="${jps}/test"/>
|
|
|
|
<if>
|
|
<istrue value="${idea.sdk.fetch.needed}"/>
|
|
|
|
<then>
|
|
<delete dir="ideaSDK" failonerror="false">
|
|
<exclude name="config-idea/**"/>
|
|
<exclude name="system-idea/**"/>
|
|
</delete>
|
|
|
|
<mkdir dir="${core}"/>
|
|
<mkdir dir="${core-analysis}"/>
|
|
<mkdir dir="${jps}"/>
|
|
<mkdir dir="${jps-test}"/>
|
|
<get src="${content.base.url}/core/intellij-core.jar" dest="${core}/intellij-core.jar"/>
|
|
<get src="${content.base.url}/core/intellij-core-analysis.jar" dest="${core-analysis}/intellij-core-analysis.jar"/>
|
|
<get src="${content.base.url}/core/annotations.jar" dest="${core}/annotations.jar"/>
|
|
<get src="${content.base.url}/core/guava-17.0.jar" dest="${core}/guava-17.0.jar"/>
|
|
<get src="${content.base.url}/core/picocontainer.jar" dest="${core}/picocontainer.jar"/>
|
|
<get src="${content.base.url}/core/trove4j.jar" dest="${core}/trove4j.jar"/>
|
|
<!--<get src="${content.base.url}/core/snappy-java-1.0.5.jar" dest="${core}/snappy-java-1.0.5.jar"/>-->
|
|
|
|
<get src="${content.base.url}/jps/standalone-jps-IC-${idea.build.number}.zip"
|
|
dest="dependencies/download/standalone-jps.zip"/>
|
|
|
|
<property name="jps.extracted.dir" value="dependencies/download/standalone-jps"/>
|
|
<unzip src="dependencies/download/standalone-jps.zip" dest="${jps.extracted.dir}"/>
|
|
|
|
<copy todir="${jps}" flatten="true">
|
|
<resources>
|
|
<file file="${jps.extracted.dir}/groovy-jps-plugin.jar"/>
|
|
<file file="${jps.extracted.dir}/groovy_rt.jar"/>
|
|
<file file="${jps.extracted.dir}/jdom.jar"/>
|
|
<file file="${jps.extracted.dir}/jgoodies-forms.jar"/>
|
|
<file file="${jps.extracted.dir}/jna.jar"/>
|
|
<file file="${jps.extracted.dir}/jps-builders.jar"/>
|
|
<file file="${jps.extracted.dir}/jps-model.jar"/>
|
|
<file file="${jps.extracted.dir}/log4j.jar"/>
|
|
<file file="${jps.extracted.dir}/nanoxml-2.2.3.jar"/>
|
|
<file file="${jps.extracted.dir}/protobuf-2.5.0.jar"/>
|
|
<file file="${jps.extracted.dir}/trove4j.jar"/>
|
|
<file file="${jps.extracted.dir}/ui-designer-jps-plugin.jar"/>
|
|
<file file="${jps.extracted.dir}/util.jar"/>
|
|
</resources>
|
|
</copy>
|
|
|
|
<get src="${content.base.url}/jps/jps-build-test-IC-${idea.build.number}.jar" dest="${jps-test}/jps-build-test.jar"
|
|
usetimestamp="true"/>
|
|
|
|
<delete file="dependencies/download/${idea.archive.name}" failonerror="false"/>
|
|
<get src="${content.base.url}/${idea.archive.name}" dest="dependencies/download/${idea.archive.name}"/>
|
|
|
|
<delete file="dependencies/download/idea-sdk-sources.zip" failonerror="false"/>
|
|
<get src="${content.base.url}/sources.zip" dest="dependencies/download/idea-sdk-sources.zip"/>
|
|
</then>
|
|
</if>
|
|
|
|
<if>
|
|
<matches pattern=".+\.win\.zip" string="${idea.archive.name}"/>
|
|
<then>
|
|
<unzip src="dependencies/download/${idea.archive.name}" dest="ideaSDK"/>
|
|
</then>
|
|
<elseif>
|
|
<matches pattern=".+\.mac\.zip" string="${idea.archive.name}"/>
|
|
<then>
|
|
<unzip src="dependencies/download/${idea.archive.name}" dest="ideaSDK">
|
|
<cutdirsmapper dirs="2"/>
|
|
</unzip>
|
|
<!-- Java can't manipulate permissions -->
|
|
<exec executable="chmod">
|
|
<arg value="a+x"/>
|
|
<arg path="ideaSDK/bin/fsnotifier"/>
|
|
<arg path="ideaSDK/bin/inspect.sh"/>
|
|
<arg path="ideaSDK/bin/printenv.py"/>
|
|
<arg path="ideaSDK/bin/restarter"/>
|
|
</exec>
|
|
</then>
|
|
</elseif>
|
|
<else>
|
|
<untar src="dependencies/download/${idea.archive.name}" dest="ideaSDK" compression="gzip">
|
|
<cutdirsmapper dirs="1"/>
|
|
</untar>
|
|
<!-- Java can't manipulate permissions -->
|
|
<exec executable="chmod">
|
|
<arg value="a+x"/>
|
|
<arg path="ideaSDK/bin/fsnotifier"/>
|
|
<arg path="ideaSDK/bin/fsnotifier64"/>
|
|
<arg path="ideaSDK/bin/inspect.sh"/>
|
|
<arg path="ideaSDK/bin/idea.sh"/>
|
|
</exec>
|
|
</else>
|
|
</if>
|
|
|
|
<mkdir dir="ideaSDK/sources"/>
|
|
<copy file="dependencies/download/idea-sdk-sources.zip" tofile="ideaSDK/sources/sources.zip" overwrite="true"/>
|
|
|
|
<copy file="ideaSDK/lib/jdom.jar" todir="${core}"/>
|
|
<copy file="ideaSDK/lib/jna.jar" todir="${core}"/>
|
|
<copy file="ideaSDK/lib/log4j.jar" todir="${core}"/>
|
|
<copy file="ideaSDK/lib/xstream-1.4.3.jar" todir="${core}"/>
|
|
<copy file="ideaSDK/lib/xpp3-1.1.4-min.jar" todir="${core}"/>
|
|
<copy file="ideaSDK/lib/jsr166e.jar" todir="${core}"/>
|
|
<copy file="ideaSDK/lib/asm-all.jar" todir="${core}"/>
|
|
|
|
<!-- TODO temporary workaround since util-rt is not packaged into intellij-core.jar -->
|
|
<copy file="ideaSDK/lib/util.jar" todir="${core}"/>
|
|
|
|
<!--
|
|
This one needs to be deleted because otherwise it gets onto the classpath
|
|
together with junit-4.10.jar and the classloading goes crazy that breaks
|
|
many nice features of IDEA including diffs in the test console.
|
|
-->
|
|
<delete file="ideaSDK/lib/junit.jar"/>
|
|
|
|
<build-protobuf-java-lite/>
|
|
</sequential>
|
|
</macrodef>
|
|
|
|
<target name="fetch-annotations">
|
|
<mkdir dir="dependencies/annotations"/>
|
|
<get
|
|
src="https://teamcity.jetbrains.com/guestAuth/repository/download/Kotlin_KAnnotator_InferJdkAnnotations/shipWithKotlin.tcbuildtag/kotlin-jdk-annotations.jar"
|
|
dest="dependencies/annotations/kotlin-jdk-annotations.jar" usetimestamp="true"/>
|
|
<get
|
|
src="https://teamcity.jetbrains.com/guestAuth/repository/download/Kotlin_KAnnotator_InferJdkAnnotations/shipWithKotlin.tcbuildtag/kotlin-android-sdk-annotations.jar"
|
|
dest="dependencies/annotations/kotlin-android-sdk-annotations.jar" usetimestamp="true"/>
|
|
</target>
|
|
|
|
<target name="get_android_studio">
|
|
<taskdef resource="net/sf/antcontrib/antcontrib.properties" classpath="${basedir}/dependencies/ant-contrib.jar"/>
|
|
|
|
<condition property="android.os.tag" value="windows">
|
|
<os family="windows"/>
|
|
</condition>
|
|
|
|
<condition property="android.os.tag" value="mac">
|
|
<os family="mac"/>
|
|
</condition>
|
|
|
|
<condition property="android.os.tag" value="linux">
|
|
<and>
|
|
<os family="unix"/>
|
|
<not>
|
|
<os family="mac"/>
|
|
</not>
|
|
</and>
|
|
</condition>
|
|
|
|
<if>
|
|
<not>
|
|
<and>
|
|
<isset property="android.version"/>
|
|
<isset property="android.build.version"/>
|
|
</and>
|
|
</not>
|
|
<then>
|
|
<loadresource property="android.version">
|
|
<url url="http://tools.android.com/download/studio/canary/latest"/>
|
|
<filterchain>
|
|
<tokenfilter>
|
|
<filetokenizer/>
|
|
<replaceregex
|
|
pattern="^(.*)https?://dl\.google\.com/dl/android/studio/ide-zips/([\d\.]+)/android-studio-ide(.*)$"
|
|
replace="\2" flags="s"/>
|
|
</tokenfilter>
|
|
</filterchain>
|
|
</loadresource>
|
|
<loadresource property="android.build.version">
|
|
<url url="http://tools.android.com/download/studio/canary/latest"/>
|
|
<filterchain>
|
|
<tokenfilter>
|
|
<filetokenizer/>
|
|
<replaceregex
|
|
pattern="^(.*)https?://dl\.google\.com/dl/android/studio/ide-zips/[\d\.]+/android-studio-ide-([\d\.]+)-(.*)$"
|
|
replace="\2" flags="s"/>
|
|
</tokenfilter>
|
|
</filterchain>
|
|
</loadresource>
|
|
</then>
|
|
</if>
|
|
|
|
<echo message="Download android studio: ${android.version} ${android.build.version}"/>
|
|
|
|
<property name="android.file.name" value="android-studio-ide-${android.build.version}-${android.os.tag}.zip"/>
|
|
<property name="android.studio.url"
|
|
value="http://dl.google.com/dl/android/studio/ide-zips/${android.version}/${android.file.name}"/>
|
|
<property name="android.destination.dir" value="android-studio/sdk"/>
|
|
|
|
<mkdir dir="dependencies/download"/>
|
|
|
|
<get src="${android.studio.url}" dest="dependencies/download" usetimestamp="true"/>
|
|
|
|
<delete dir="${android.destination.dir}" failonerror="false" includeemptydirs="true">
|
|
<exclude name="config/**"/>
|
|
<exclude name="system/**"/>
|
|
</delete>
|
|
|
|
<unzip src="dependencies/download/${android.file.name}" dest="${android.destination.dir}">
|
|
<cutdirsmapper dirs="1"/>
|
|
</unzip>
|
|
|
|
<if>
|
|
<matches pattern=".+windows\.zip" string="${android.file.name}"/>
|
|
<then>
|
|
</then>
|
|
<elseif>
|
|
<matches pattern=".+mac\.zip" string="${android.file.name}"/>
|
|
<then>
|
|
<exec executable="chmod">
|
|
<arg value="a+x"/>
|
|
<arg path="${android.destination.dir}/bin/fsnotifier"/>
|
|
<arg path="${android.destination.dir}/bin/inspect.sh"/>
|
|
<arg path="${android.destination.dir}/bin/printenv.py"/>
|
|
<arg path="${android.destination.dir}/bin/update_studio.sh"/>
|
|
</exec>
|
|
</then>
|
|
</elseif>
|
|
<elseif>
|
|
<matches pattern=".+linux\.zip" string="${android.file.name}"/>
|
|
<then>
|
|
<exec executable="chmod">
|
|
<arg value="a+x"/>
|
|
<arg path="${android.destination.dir}/bin/fsnotifier"/>
|
|
<arg path="${android.destination.dir}/bin/fsnotifier64"/>
|
|
<arg path="${android.destination.dir}/bin/inspect.sh"/>
|
|
<arg path="${android.destination.dir}/bin/studio.sh"/>
|
|
<arg path="${android.destination.dir}/bin/update_studio.sh"/>
|
|
</exec>
|
|
</then>
|
|
</elseif>
|
|
<else>
|
|
<fail message="File name '${android.file.name}' wasn't matched"/>
|
|
</else>
|
|
</if>
|
|
</target>
|
|
</project>
|