[Feedback] Implement sending feedback to zendesk
[idea/community.git] / build / gant.xml
1 <project name="Test gant invocation from Ant script" default="doGant" xmlns:resolver="antlib:org.apache.maven.resolver.ant">
2   <dirname property="build.dir" file="${ant.file}"/>
3   <property name="project.home" value="${build.dir}/.."/>
4   <property name="idea.lib" value="${project.home}/lib"/>
5   <property environment="env"/>
6
7   <xmlproperty file="${build.dir}/../.idea/libraries/jps_build_script_dependencies_bootstrap.xml" prefix="jps.bootstrap.library.xml"/>
8   <loadresource property="jps.bootstrap.library.version">
9     <propertyresource name="jps.bootstrap.library.xml.component.library.properties(maven-id)"/>
10     <filterchain>
11       <tokenfilter>
12         <replaceregex pattern="^.*:([0-9.]+)$" replace="\1"/>
13       </tokenfilter>
14     </filterchain>
15   </loadresource>
16
17   <property name="maven.resolver.ant.tasks.version" value="1.2.1"/>
18   <property name="maven.resolver.ant.tasks.file.name" value="maven-resolver-ant-tasks-${maven.resolver.ant.tasks.version}-uber.jar"/>
19   <property name="maven.resolver.ant.tasks.file.path" value="org/apache/maven/resolver/maven-resolver-ant-tasks/${maven.resolver.ant.tasks.version}"/>
20   <property name="maven.resolver.ant.tasks.cache.dir" value="${user.home}/.m2/repository/${maven.resolver.ant.tasks.file.path}"/>
21   <property name="maven.resolver.ant.tasks.cache.file" value="${maven.resolver.ant.tasks.cache.dir}/${maven.resolver.ant.tasks.file.name}"/>
22
23   <condition property="gant.target" value="default">
24     <not>
25       <isset property="gant.target"/>
26     </not>
27   </condition>
28
29   <available file="${maven.resolver.ant.tasks.cache.file}" property="maven.resolver.ant.tasks.file.exists"/>
30
31   <target name="download.resolver" unless="maven.resolver.ant.tasks.file.exists">
32     <mkdir dir="${maven.resolver.ant.tasks.cache.dir}" />
33     <get
34       src="https://cache-redirector.jetbrains.com/repo1.maven.org/maven2/${maven.resolver.ant.tasks.file.path}/${maven.resolver.ant.tasks.file.name}"
35       dest="${maven.resolver.ant.tasks.cache.file}.tmp"
36       verbose="true"/>
37     <move
38       file="${maven.resolver.ant.tasks.cache.file}.tmp"
39       tofile="${maven.resolver.ant.tasks.cache.file}"
40       overwrite="true"/>
41   </target>
42
43   <target name="resolve.buildscript.deps" depends="download.resolver">
44     <taskdef uri="antlib:org.apache.maven.resolver.ant" resource="org/apache/maven/resolver/ant/antlib.xml"
45              classpath="${maven.resolver.ant.tasks.cache.file}"/>
46
47     <resolver:remoterepos id="remoterepos.buildscript">
48       <resolver:remoterepo id="central" url="https://cache-redirector.jetbrains.com/repo1.maven.org/maven2"/>
49       <resolver:remoterepo id="intellij-dependencies" url="https://cache-redirector.jetbrains.com/intellij-dependencies"/>
50       <resolver:remoterepo id="jcenter" url="https://cache-redirector.jetbrains.com/jcenter.bintray.com"/>
51       <resolver:remoterepo id="kotlin-ide-plugin-dependencies" url="https://cache-redirector.jetbrains.com/maven.pkg.jetbrains.space/kotlin/p/kotlin/kotlin-ide-plugin-dependencies"/>
52       <resolver:remoterepo id="teamcity-repository" url="https://cache-redirector.jetbrains.com/download.jetbrains.com/teamcity-repository"/>
53     </resolver:remoterepos>
54
55     <resolver:resolve failOnMissingAttachments="true">
56       <resolver:remoterepos refid="remoterepos.buildscript"/>
57       <resolver:dependencies>
58         <dependency coords="${jps.bootstrap.library.xml.component.library.properties(maven-id)}"/>
59         <dependency coords="com.jetbrains.intellij.platform:test-framework-core:${jps.bootstrap.library.version}"/>
60         <dependency coords="commons-cli:commons-cli:1.2"/>
61         <dependency coords="org.apache.commons:commons-compress:1.21"/>
62         <dependency coords="de.pdark:decentxml:1.4"/>
63       </resolver:dependencies>
64       <resolver:path refid="classpath.buildscripts" classpath="runtime"/>
65     </resolver:resolve>
66
67     <!--
68     <pathconvert property="classpath.buildscripts.property" refid="classpath.buildscripts"/>
69     <echo message="build scripts classpath: ${classpath.buildscripts.property}"/>
70     -->
71   </target>
72
73   <target name="doGant" depends="resolve.buildscript.deps">
74     <path id="gant.classpath">
75       <pathelement path="${project.home}/platform/build-scripts/groovy"/>
76       <pathelement path="${project.home}/platform/build-scripts/downloader/groovy"/>
77       <pathelement path="${project.home}/build/groovy"/>
78       <path refid="classpath.buildscripts" />
79     </path>
80
81     <taskdef name="gant" classname="org.jetbrains.jps.gant.GantWithClasspathTask">
82       <classpath refid="gant.classpath"/>
83     </taskdef>
84
85     <gant file="${gant.script}" target="${gant.target}" inheritAll="true"/>
86   </target>
87 </project>