comparison teamcity-common.xml @ 108:63fcc9b14221

update teamcity-common.xml and teamcity-plugin.xml
author C:\Users\pavel.sher\AppData\Roaming\The Bat!
date Fri, 02 Jul 2010 22:32:16 +0400
parents 8cc11b0cbbd4
children 31a1aca3305c
comparison
equal deleted inserted replaced
107:d7330bc105aa 108:63fcc9b14221
29 description="name of the directory to store unpacked plugin (not packed into zip)"/> 29 description="name of the directory to store unpacked plugin (not packed into zip)"/>
30 30
31 <attribute name="server.lib.dir" default="" description="directory to get libs for the server part"/> 31 <attribute name="server.lib.dir" default="" description="directory to get libs for the server part"/>
32 <attribute name="server.lib.includes" default="none should match" description="includes pattern of the files in the directory"/> 32 <attribute name="server.lib.includes" default="none should match" description="includes pattern of the files in the directory"/>
33 <attribute name="plugin.version" default="SNAPSHOT" 33 <attribute name="plugin.version" default="SNAPSHOT"
34 description="the version of the plugin to put into teamcity-plugin.xml instead of '@version@'"/> 34 description="the version of the plugin to put into teamcity-plugin.xml instead of '@Plugin_Version@'"/>
35 35 <attribute name="plugin.vendor" default="Unknown vendor"
36 <element name="additional-files" optional="yes" description="fileset of the files to pack into root of the plugin"/> 36 description="name of the vendor to put into teamcity-plugin.xml instead of '@Plugin_Vendor@'"/>
37 <attribute name="plugin.vendor.url" default=""
38 description="vendor URL to put into teamcity-plugin.xml instead of '@Plugin_Vendor_Url@'"/>
39
40 <element name="server-additional-files" optional="yes" description="fileset of the files to pack into root of the server plugin part"/>
41 <element name="agent-additional-files" optional="yes" description="fileset of the files to pack into root of the agent plugin part"/>
37 42
38 <sequential> 43 <sequential>
39 44
40 <antcall target="check.already.defined"/> 45 <antcall target="check.already.defined"/>
41 46
89 <param name="name" value="@{name}"/> 94 <param name="name" value="@{name}"/>
90 <param name="agent.output" value="@{agent.output}"/> 95 <param name="agent.output" value="@{agent.output}"/>
91 <param name="common.jar.path" value="${teamcity.internal.distrib.prep.common}/@{common.jar.name}"/> 96 <param name="common.jar.path" value="${teamcity.internal.distrib.prep.common}/@{common.jar.name}"/>
92 </antcall> 97 </antcall>
93 98
99 <!-- copy additional agent files -->
100 <mkdir dir="${teamcity.internal.distrib.prep.agent.jars}/@{name}" />
101 <copy todir="${teamcity.internal.distrib.prep.agent.jars}/@{name}">
102 <fileset dir="${basedir}" excludes="**"/>
103 <agent-additional-files/>
104 </copy>
105
106 <antcall target="pack.agent.part">
107 <param name="out.unpacked" value="@{out.unpacked}"/>
108 <param name="name" value="@{name}"/>
109 </antcall>
110
94 <!-- copy teamcity-plugin.xml --> 111 <!-- copy teamcity-plugin.xml -->
95 <antcall target="prepare.plugin.descriptor.file"> 112 <antcall target="prepare.plugin.descriptor.file">
96 <param name="source" value="@{plugin.descriptor.file}"/> 113 <param name="source" value="@{plugin.descriptor.file}"/>
97 <param name="dest" value="@{out.unpacked}/teamcity-plugin.xml"/> 114 <param name="dest" value="@{out.unpacked}/teamcity-plugin.xml"/>
98 <param name="plugin.version" value="@{plugin.version}"/> 115 <param name="plugin.version" value="@{plugin.version}"/>
99 </antcall> 116 <param name="plugin.vendor" value="@{plugin.vendor}"/>
100 117 <param name="plugin.vendor.url" value="@{plugin.vendor.url}"/>
101 <!-- copy additional files --> 118 </antcall>
102 <copy todir="@{out.unpacked}" failonerror="false"> 119
103 <fileset dir="${basedir}" excludes="**/*"/> 120 <!-- copy additional server plugin files -->
104 <additional-files/> 121 <copy todir="@{out.unpacked}">
122 <fileset dir="${basedir}" excludes="**"/>
123 <server-additional-files/>
105 </copy> 124 </copy>
106 125
107 <!-- clean --> 126 <!-- clean -->
108 <echo message="Cleaning..."/> 127 <echo message="Cleaning..."/>
109 <delete dir="${teamcity.internal.distrib.prep}" quiet="true"/> 128 <delete dir="${teamcity.internal.distrib.prep}" quiet="true"/>
119 </sequential> 138 </sequential>
120 </macrodef> 139 </macrodef>
121 140
122 <target name="check.teamcitydistribution" description="checks whether TeamCity distribution ready to be used by IDEA-generated build"> 141 <target name="check.teamcitydistribution" description="checks whether TeamCity distribution ready to be used by IDEA-generated build">
123 <check.property name="path.variable.teamcitydistribution" 142 <check.property name="path.variable.teamcitydistribution"
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." 143 fail-message="Please define 'teamcity.distribution' or 'path.variable.teamcitydistribution' property (e.g. in build.properties file). The property should point to unpacked TeamCity .tar.gz or .exe distribution."
125 /> 144 />
126 145
127 <condition property="teamcity.distribution.not.present"> 146 <condition property="teamcity.distribution.not.present">
128 <not> 147 <not>
129 <and> 148 <and>
131 </and> 150 </and>
132 </not> 151 </not>
133 </condition> 152 </condition>
134 <fail if="teamcity.distribution.not.present" 153 <fail if="teamcity.distribution.not.present"
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."/> 154 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."/>
155 <echo message="Using ${path.variable.teamcitydistribution} as TeamCity distribution" />
136 </target> 156 </target>
137 157
138 <macrodef name="deploy.teamcity.plugin"> 158 <macrodef name="deploy.teamcity.plugin">
139 <attribute name="name"/> 159 <attribute name="name"/>
140 <attribute name="teamcity.data.path" default="${user.home}/.BuildServer" description="path to .BuildServer"/> 160 <attribute name="teamcity.data.path" default="${user.home}/.BuildServer" description="path to .BuildServer"/>
221 <fileset file="${common.jar.path}"/> 241 <fileset file="${common.jar.path}"/>
222 <fileset dir="${lib.dir}" includes="${lib.includes}"/> 242 <fileset dir="${lib.dir}" includes="${lib.includes}"/>
223 </copy> 243 </copy>
224 </target> 244 </target>
225 245
246 <target name="pack.agent.part" if="agent.needed">
247 <zip destfile="${out.unpacked}/agent/${name}.zip">
248 <fileset dir="${teamcity.internal.distrib.prep.agent.jars}"/>
249 </zip>
250 </target>
226 251
227 <target name="prepare.agent.part" if="agent.needed"> 252 <target name="prepare.agent.part" if="agent.needed">
228 <!-- prepare.agent.part --> 253 <!-- prepare.agent.part -->
229 <mkdir dir="${teamcity.internal.distrib.prep.agent}"/> 254 <mkdir dir="${teamcity.internal.distrib.prep.agent}"/>
230 <mkdir dir="${teamcity.internal.distrib.prep.agent.jars}/${name}/lib"/> 255 <mkdir dir="${teamcity.internal.distrib.prep.agent.jars}/${name}/lib"/>
235 </jar> 260 </jar>
236 261
237 <copy todir="${teamcity.internal.distrib.prep.agent.jars}/${name}/lib" failonerror="false"> 262 <copy todir="${teamcity.internal.distrib.prep.agent.jars}/${name}/lib" failonerror="false">
238 <fileset file="${common.jar.path}"/> 263 <fileset file="${common.jar.path}"/>
239 </copy> 264 </copy>
240
241 <zip destfile="${out.unpacked}/agent/${name}.zip">
242 <fileset dir="${teamcity.internal.distrib.prep.agent.jars}"/>
243 </zip>
244 </target> 265 </target>
245 266
246 <target name="prepare.plugin.descriptor.file" if="plugin.descriptor.file.needed"> 267 <target name="prepare.plugin.descriptor.file" if="plugin.descriptor.file.needed">
247 <echo message="Copying plugin descriptor file '${source}' to '${dest}'."/> 268 <echo message="Copying plugin descriptor file '${source}' to '${dest}'."/>
248 <copy file="${source}" tofile="${dest}" failonerror="false"/> 269 <copy file="${source}" tofile="${dest}" failonerror="false"/>
249 270
250 <echo message="Replacing '@Plugin_Version@' on '${plugin.version}' in the copied plugin descriptor file."/> 271 <echo message="Replacing '@Plugin_Version@', '@Plugin_Vendor@' and '@Plugin_Vendor_Url@' in the copied plugin descriptor file."/>
251 <replace file="${dest}" value="${plugin.version}"> 272 <replace file="${dest}">
273 <replacefilter token="@version@" value="${plugin.version}"/>
252 <replacefilter token="@Plugin_Version@" value="${plugin.version}"/> 274 <replacefilter token="@Plugin_Version@" value="${plugin.version}"/>
253 <replacefilter token="@Plugin_Vendor@" value="JetBrains, s.r.o."/> 275 <replacefilter token="@Plugin_Vendor@" value="${plugin.vendor}"/>
254 <replacefilter token="@Plugin_Vendor_Url@" value="http://www.jetbrains.com"/> 276 <replacefilter token="@Plugin_Vendor_Url@" value="${plugin.vendor.url}"/>
255 </replace> 277 </replace>
256 </target> 278 </target>
257 279
258 <target name="check.already.defined"> 280 <target name="check.already.defined">
259 <condition property="already.defined"> 281 <condition property="already.defined">