forked from JetBrains/kotlin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTeamCityBuild.xml
90 lines (75 loc) · 3.06 KB
/
TeamCityBuild.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<project name="Jet CI Steps" default="none">
<import file="build.xml" optional="false"/>
<property name="build.number" value="snapshot"/>
<property name="jdk16.home" value="${java.home}"/>
<property name="fail.on.plugin.verifier.error" value="true"/>
<property name="artifact.output.path" value="${basedir}/out/artifacts"/>
<property name="plugin.xml" value="idea/src/META-INF/plugin.xml"/>
<property name="plugin.xml.bk" value="${plugin.xml}.bk"/>
<property name="plugin.verifier" value="${basedir}/PluginVerifier/plugin-verifier-1.0-SNAPSHOT.jar"/>
<property name="plugin.zip" value="${artifact.output.path}/kotlin-plugin-${build.number}.zip" />
<macrodef name="echoprop">
<attribute name="prop"/>
<sequential>
<echo>@{prop}=${@{prop}}</echo>
</sequential>
</macrodef>
<echoprop prop="os.name"/>
<echoprop prop="os.version"/>
<echoprop prop="os.arch"/>
<echoprop prop="java.home"/>
<echoprop prop="java.vendor"/>
<echoprop prop="java.version"/>
<echoprop prop="user.name"/>
<echoprop prop="user.home"/>
<echoprop prop="user.dir"/>
<target name="unzipDependencies">
<unzip dest="ideaSDK">
<fileset dir="ideaSDK" includes="ideaIC*.zip"/>
</unzip>
<delete dir="ideaSDK" includes="ideaIC*.zip"/>
</target>
<target name="cleanupArtifacts">
<delete dir="${artifact.output.path}" includes="*"/>
</target>
<target name="writeVersionToPluginXml">
<copy file="${plugin.xml}" tofile="${plugin.xml.bk}"/>
<copy file="${plugin.xml.bk}" tofile="${plugin.xml}" overwrite="true">
<filterchain>
<replacetokens>
<token key="snapshot" value="${build.number}"/>
</replacetokens>
</filterchain>
</copy>
</target>
<target name="cleanupPluginXml">
<copy file="${plugin.xml.bk}" tofile="${plugin.xml}" overwrite="true"/>
<delete file="${plugin.xml.bk}" quiet="true"/>
</target>
<target name="pre_build" depends="cleanupArtifacts, unzipDependencies, dist, writeVersionToPluginXml">
</target>
<target name="zipArtifact">
<zip destfile="${plugin.zip}">
<zipfileset prefix="Kotlin" dir="${artifact.output.path}/Kotlin"/>
</zip>
<delete dir="${artifact.output.path}/Kotlin" quiet="true"/>
</target>
<target name="verifyPlugin">
<!--
disabled plugin-verifier for now, waiting
for better plugin dependencies handling in it
-->
<!--
<java fork="true" failonerror="${fail.on.plugin.verifier.error}" jar="${plugin.verifier}">
<arg value="-r" />
<arg value="${jdk16.home}" />
<arg value="${plugin.zip}" />
<arg value="${basedir}/ideaSDK" />
</java>
-->
</target>
<target name="post_build" depends="cleanupPluginXml, zipArtifact, verifyPlugin"/>
<target name="none">
<fail message="Either specify pre_build or post_build"/>
</target>
</project>