annotate teamcity-common.xml @ 99:09cca4213a3d Darjeeling-5.0.x

TW-11493
author Pavel.Sher
date Sat, 03 Apr 2010 12:24:57 +0400
parents 84f8c95be7bb
children 8cc11b0cbbd4
rev   line source
76
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
1 <?xml version="1.0" encoding="UTF-8"?>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
2 <project name="TeamCityPluginCommon">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
3
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
4 <!--
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
5 Tasks:
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
6 package.teamcity.plugin
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
7 deploy.teamcity.plugin
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
8 undeploy.teamcity.plugin
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
9 unpack.teamcity
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
10
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
11 Targets:
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
12 check.teamcitydistribution
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
13 -->
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
14
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
15 <property name="path.variable.teamcitydistribution" value="${teamcity.distribution}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
16
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
17 <property name="teamcity.internal.default.out" value="dist"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
18
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
19
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
20 <macrodef name="package.teamcity.plugin" description="packages TeamCity plugin">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
21 <attribute name="name" description="name of the plugin"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
22 <attribute name="server.output" default="" description="path to compiled server plugin output"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
23 <attribute name="agent.output" default="" description="path to compiled agent plugin output"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
24 <attribute name="common.output" default="" description="path to compiled common plugin output"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
25 <attribute name="out" default="${teamcity.internal.default.out}" description="directory to put prepared plugin zip into"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
26 <attribute name="plugin.descriptor.file" default="${basedir}/teamcity-plugin.xml" description="path to teamcity-plugin.xml file"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
27 <attribute name="common.jar.name" default="@{name}-common.jar" description="name of the shared jar between server and agent"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
28 <attribute name="out.unpacked" default="@{out}/unpacked"
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
29 description="name of the directory to store unpacked plugin (not packed into zip)"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
30
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
31 <attribute name="server.lib.dir" default="" description="directory to get libs for the server part"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
32 <attribute name="server.lib.includes" default="none should match" description="includes pattern of the files in the directory"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
33 <attribute name="plugin.version" default="SNAPSHOT"
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
34 description="the version of the plugin to put into teamcity-plugin.xml instead of '@version@'"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
35
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
36 <element name="additional-files" optional="yes" description="fileset of the files to pack into root of the plugin"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
37
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
38 <sequential>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
39
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
40 <antcall target="check.already.defined"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
41
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
42 <property name="teamcity.internal.distrib.prep" value="${basedir}/temp/dist_prep"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
43 <property name="teamcity.internal.distrib.prep.agent" value="${teamcity.internal.distrib.prep}/agent"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
44 <property name="teamcity.internal.distrib.prep.common" value="${teamcity.internal.distrib.prep}/common"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
45 <property name="teamcity.internal.distrib.prep.agent.jars" value="${teamcity.internal.distrib.prep.agent}/unpacked"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
46
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
47
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
48 <!-- build jars -->
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
49
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
50 <delete dir="@{out.unpacked}" quiet="true"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
51 <delete dir="${teamcity.internal.distrib.prep}" quiet="true"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
52
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
53 <mkdir dir="@{out.unpacked}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
54
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
55 <condition property="common.needed">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
56 <length string="@{common.output}" when="greater" length="0"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
57 </condition>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
58 <condition property="server.needed">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
59 <length string="@{server.output}" when="greater" length="0"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
60 </condition>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
61 <condition property="agent.needed">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
62 <length string="@{agent.output}" when="greater" length="0"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
63 </condition>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
64
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
65 <condition property="plugin.descriptor.file.needed">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
66 <and>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
67 <available file="@{plugin.descriptor.file}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
68 <length string="@{plugin.descriptor.file}" when="greater" length="0"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
69 </and>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
70 </condition>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
71
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
72 <mkdir dir="${teamcity.internal.distrib.prep.common}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
73 <antcall target="prepare.common.part">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
74 <param name="common.output" value="@{common.output}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
75 <param name="common.jar.path" value="${teamcity.internal.distrib.prep.common}/@{common.jar.name}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
76 </antcall>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
77
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
78 <antcall target="prepare.server.part">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
79 <param name="out.unpacked" value="@{out.unpacked}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
80 <param name="name" value="@{name}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
81 <param name="server.output" value="@{server.output}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
82 <param name="common.jar.path" value="${teamcity.internal.distrib.prep.common}/@{common.jar.name}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
83 <param name="lib.dir" value="@{server.lib.dir}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
84 <param name="lib.includes" value="@{server.lib.includes}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
85 </antcall>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
86
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
87 <antcall target="prepare.agent.part">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
88 <param name="out.unpacked" value="@{out.unpacked}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
89 <param name="name" value="@{name}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
90 <param name="agent.output" value="@{agent.output}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
91 <param name="common.jar.path" value="${teamcity.internal.distrib.prep.common}/@{common.jar.name}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
92 </antcall>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
93
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
94 <!-- copy teamcity-plugin.xml -->
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
95 <antcall target="prepare.plugin.descriptor.file">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
96 <param name="source" value="@{plugin.descriptor.file}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
97 <param name="dest" value="@{out.unpacked}/teamcity-plugin.xml"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
98 <param name="plugin.version" value="@{plugin.version}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
99 </antcall>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
100
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
101 <!-- copy additional files -->
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
102 <copy todir="@{out.unpacked}" failonerror="false">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
103 <fileset dir="${basedir}" excludes="**/*"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
104 <additional-files/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
105 </copy>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
106
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
107 <!-- clean -->
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
108 <echo message="Cleaning..."/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
109 <delete dir="${teamcity.internal.distrib.prep}" quiet="true"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
110
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
111 <!-- package in zip -->
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
112 <echo message="Packaging zip..."/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
113 <delete file="@{out}/@{name}.zip" quiet="true"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
114 <zip destfile="@{out}/@{name}.zip">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
115 <fileset dir="@{out.unpacked}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
116 </zip>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
117 <echo message="To install the plugin, place '@{out}\@{name}.zip' into '.BuildServer/plugins' directory"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
118
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
119 </sequential>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
120 </macrodef>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
121
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
122 <target name="check.teamcitydistribution" description="checks whether TeamCity distribution ready to be used by IDEA-generated build">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
123 <check.property name="path.variable.teamcitydistribution"
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
124 fail-message="Please define 'teamcity.distribution' or 'path.variable.teamcitydistribution' property in build.properties file (see build.properties.dist). The property should point to unpacked TeamCity .tar.gz or .exe distribution."
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
125 />
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
126
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
127 <condition property="teamcity.distribution.not.present">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
128 <not>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
129 <and>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
130 <available file="${path.variable.teamcitydistribution}/webapps/ROOT/WEB-INF/lib"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
131 </and>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
132 </not>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
133 </condition>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
134 <fail if="teamcity.distribution.not.present"
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
135 message="Cannot find TeamCity distribution at path '${path.variable.teamcitydistribution}'. The property 'teamcity.distribution' or 'path.variable.teamcitydistribution' should point to unpacked TeamCity .tar.gz or .exe distribution."/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
136 </target>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
137
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
138 <macrodef name="deploy.teamcity.plugin">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
139 <attribute name="name"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
140 <attribute name="teamcity.data.path" default="${user.home}/.BuildServer" description="path to .BuildServer"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
141 <attribute name="out" default="${teamcity.internal.default.out}" description="directory storing prepared plugin zip"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
142
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
143 <sequential>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
144 <copy file="@{out}/@{name}.zip" todir="@{teamcity.data.path}/plugins" failonerror="true"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
145 </sequential>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
146 </macrodef>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
147
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
148 <macrodef name="undeploy.teamcity.plugin">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
149 <attribute name="name"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
150 <attribute name="teamcity.data.path" default="${user.home}/.BuildServer" description="path to .BuildServer"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
151
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
152 <sequential>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
153 <delete file="@{teamcity.data.path}/plugins/@{name}.zip" quiet="true"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
154 </sequential>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
155 </macrodef>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
156
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
157
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
158 <macrodef name="unpack.teamcity" description="TeamCity distribution unpacking">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
159 <attribute name="distribution.dir" default="${basedir}/teamcity-dist"
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
160 description="path to put unpacked TeamCity distribution into. Warning: the content of the directory will be deleted!"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
161 <attribute name="teamcity.data.path" default="${user.home}/.BuildServer" description="path to .BuildServer"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
162 <attribute name="teamcity.tar.gz-location" default="${basedir}" description="path where TeamCity-NNNN.tar.gz file resides"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
163
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
164 <sequential>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
165 <delete dir="@{distribution.dir}" quiet="true"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
166 <mkdir dir="@{distribution.dir}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
167
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
168 <!-- TODO: issue error if there are several matching files -->
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
169
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
170 <untar compression="gzip" dest="@{distribution.dir}">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
171 <fileset dir="@{teamcity.tar.gz-location}">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
172 <include name="*.tar.gz"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
173 </fileset>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
174 </untar>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
175
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
176 <move todir="@{distribution.dir}">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
177 <fileset dir="@{distribution.dir}\TeamCity">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
178 <include name="**"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
179 </fileset>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
180 </move>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
181 </sequential>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
182 </macrodef>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
183
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
184
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
185 <!-- ** Implementation ** -->
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
186
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
187 <macrodef name="check.property">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
188 <attribute name="name"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
189 <attribute name="fail-message" default=""/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
190 <attribute name="check-path" default=""/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
191 <sequential>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
192 <condition property="is.configured.@{name}">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
193 <not>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
194 <and>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
195 <isset property="@{name}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
196 <length string="${@{name}}" when="greater" length="0"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
197 </and>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
198 </not>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
199 </condition>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
200 <fail if="is.configured.@{name}"
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
201 message="Property '@{name}' not defined. @{fail-message}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
202 </sequential>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
203 </macrodef>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
204
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
205
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
206 <target name="prepare.common.part" if="common.needed">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
207 <jar destfile="${common.jar.path}">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
208 <fileset dir="${common.output}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
209 </jar>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
210 </target>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
211
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
212
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
213 <target name="prepare.server.part" if="server.needed">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
214 <mkdir dir="${out.unpacked}/server"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
215
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
216 <jar destfile="${out.unpacked}/server/${name}.jar">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
217 <fileset dir="${server.output}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
218 </jar>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
219
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
220 <copy todir="${out.unpacked}/server" failonerror="false">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
221 <fileset file="${common.jar.path}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
222 <fileset dir="${lib.dir}" includes="${lib.includes}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
223 </copy>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
224 </target>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
225
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
226
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
227 <target name="prepare.agent.part" if="agent.needed">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
228 <!-- prepare.agent.part -->
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
229 <mkdir dir="${teamcity.internal.distrib.prep.agent}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
230 <mkdir dir="${teamcity.internal.distrib.prep.agent.jars}/${name}/lib"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
231 <mkdir dir="${out.unpacked}/agent"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
232
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
233 <jar destfile="${teamcity.internal.distrib.prep.agent.jars}/${name}/lib/${name}.jar">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
234 <fileset dir="${agent.output}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
235 </jar>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
236
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
237 <copy todir="${teamcity.internal.distrib.prep.agent.jars}/${name}/lib" failonerror="false">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
238 <fileset file="${common.jar.path}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
239 </copy>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
240
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
241 <zip destfile="${out.unpacked}/agent/${name}.zip">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
242 <fileset dir="${teamcity.internal.distrib.prep.agent.jars}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
243 </zip>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
244 </target>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
245
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
246 <target name="prepare.plugin.descriptor.file" if="plugin.descriptor.file.needed">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
247 <echo message="Copying plugin descriptor file '${source}' to '${dest}'."/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
248 <copy file="${source}" tofile="${dest}" failonerror="false"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
249
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
250 <echo message="Replacing '@version@' on '${plugin.version}' in the copied plugin descriptor file."/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
251 <replace file="${dest}" value="${plugin.version}">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
252 <replacetoken><![CDATA[@version@]]></replacetoken>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
253 </replace>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
254 </target>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
255
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
256 <target name="check.already.defined">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
257 <condition property="already.defined">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
258 <isset property="teamcity.internal.distrib.prep"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
259 </condition>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
260 <fail if="already.defined"
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
261 message="It seems you are trying to use the script several times in the same context. This script does not support such use. Please call this script as a separate Ant process, via 'ant' task."/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
262 </target>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
263
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
264 </project>