annotate teamcity-common.xml @ 689:cccf6b5c2745

Use separate classloader
author Dmitry Neverov <dmitry.neverov@jetbrains.com>
date Tue, 17 Dec 2013 19:53:39 +0100
parents 63fcc9b14221
children 31a1aca3305c
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"
108
63fcc9b14221 update teamcity-common.xml and teamcity-plugin.xml
C:\Users\pavel.sher\AppData\Roaming\The Bat!
parents: 104
diff changeset
34 description="the version of the plugin to put into teamcity-plugin.xml instead of '@Plugin_Version@'"/>
63fcc9b14221 update teamcity-common.xml and teamcity-plugin.xml
C:\Users\pavel.sher\AppData\Roaming\The Bat!
parents: 104
diff changeset
35 <attribute name="plugin.vendor" default="Unknown vendor"
63fcc9b14221 update teamcity-common.xml and teamcity-plugin.xml
C:\Users\pavel.sher\AppData\Roaming\The Bat!
parents: 104
diff changeset
36 description="name of the vendor to put into teamcity-plugin.xml instead of '@Plugin_Vendor@'"/>
63fcc9b14221 update teamcity-common.xml and teamcity-plugin.xml
C:\Users\pavel.sher\AppData\Roaming\The Bat!
parents: 104
diff changeset
37 <attribute name="plugin.vendor.url" default=""
63fcc9b14221 update teamcity-common.xml and teamcity-plugin.xml
C:\Users\pavel.sher\AppData\Roaming\The Bat!
parents: 104
diff changeset
38 description="vendor URL to put into teamcity-plugin.xml instead of '@Plugin_Vendor_Url@'"/>
76
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
39
108
63fcc9b14221 update teamcity-common.xml and teamcity-plugin.xml
C:\Users\pavel.sher\AppData\Roaming\The Bat!
parents: 104
diff changeset
40 <element name="server-additional-files" optional="yes" description="fileset of the files to pack into root of the server plugin part"/>
63fcc9b14221 update teamcity-common.xml and teamcity-plugin.xml
C:\Users\pavel.sher\AppData\Roaming\The Bat!
parents: 104
diff changeset
41 <element name="agent-additional-files" optional="yes" description="fileset of the files to pack into root of the agent plugin part"/>
76
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
42
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
43 <sequential>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
44
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
45 <antcall target="check.already.defined"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
46
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
47 <property name="teamcity.internal.distrib.prep" value="${basedir}/temp/dist_prep"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
48 <property name="teamcity.internal.distrib.prep.agent" value="${teamcity.internal.distrib.prep}/agent"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
49 <property name="teamcity.internal.distrib.prep.common" value="${teamcity.internal.distrib.prep}/common"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
50 <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
51
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
52
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
53 <!-- build jars -->
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
54
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
55 <delete dir="@{out.unpacked}" quiet="true"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
56 <delete dir="${teamcity.internal.distrib.prep}" quiet="true"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
57
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
58 <mkdir dir="@{out.unpacked}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
59
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
60 <condition property="common.needed">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
61 <length string="@{common.output}" when="greater" length="0"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
62 </condition>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
63 <condition property="server.needed">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
64 <length string="@{server.output}" when="greater" length="0"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
65 </condition>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
66 <condition property="agent.needed">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
67 <length string="@{agent.output}" when="greater" length="0"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
68 </condition>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
69
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
70 <condition property="plugin.descriptor.file.needed">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
71 <and>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
72 <available file="@{plugin.descriptor.file}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
73 <length string="@{plugin.descriptor.file}" when="greater" length="0"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
74 </and>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
75 </condition>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
76
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
77 <mkdir dir="${teamcity.internal.distrib.prep.common}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
78 <antcall target="prepare.common.part">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
79 <param name="common.output" value="@{common.output}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
80 <param name="common.jar.path" value="${teamcity.internal.distrib.prep.common}/@{common.jar.name}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
81 </antcall>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
82
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
83 <antcall target="prepare.server.part">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
84 <param name="out.unpacked" value="@{out.unpacked}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
85 <param name="name" value="@{name}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
86 <param name="server.output" value="@{server.output}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
87 <param name="common.jar.path" value="${teamcity.internal.distrib.prep.common}/@{common.jar.name}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
88 <param name="lib.dir" value="@{server.lib.dir}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
89 <param name="lib.includes" value="@{server.lib.includes}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
90 </antcall>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
91
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
92 <antcall target="prepare.agent.part">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
93 <param name="out.unpacked" value="@{out.unpacked}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
94 <param name="name" value="@{name}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
95 <param name="agent.output" value="@{agent.output}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
96 <param name="common.jar.path" value="${teamcity.internal.distrib.prep.common}/@{common.jar.name}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
97 </antcall>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
98
108
63fcc9b14221 update teamcity-common.xml and teamcity-plugin.xml
C:\Users\pavel.sher\AppData\Roaming\The Bat!
parents: 104
diff changeset
99 <!-- copy additional agent files -->
63fcc9b14221 update teamcity-common.xml and teamcity-plugin.xml
C:\Users\pavel.sher\AppData\Roaming\The Bat!
parents: 104
diff changeset
100 <mkdir dir="${teamcity.internal.distrib.prep.agent.jars}/@{name}" />
63fcc9b14221 update teamcity-common.xml and teamcity-plugin.xml
C:\Users\pavel.sher\AppData\Roaming\The Bat!
parents: 104
diff changeset
101 <copy todir="${teamcity.internal.distrib.prep.agent.jars}/@{name}">
63fcc9b14221 update teamcity-common.xml and teamcity-plugin.xml
C:\Users\pavel.sher\AppData\Roaming\The Bat!
parents: 104
diff changeset
102 <fileset dir="${basedir}" excludes="**"/>
63fcc9b14221 update teamcity-common.xml and teamcity-plugin.xml
C:\Users\pavel.sher\AppData\Roaming\The Bat!
parents: 104
diff changeset
103 <agent-additional-files/>
63fcc9b14221 update teamcity-common.xml and teamcity-plugin.xml
C:\Users\pavel.sher\AppData\Roaming\The Bat!
parents: 104
diff changeset
104 </copy>
63fcc9b14221 update teamcity-common.xml and teamcity-plugin.xml
C:\Users\pavel.sher\AppData\Roaming\The Bat!
parents: 104
diff changeset
105
63fcc9b14221 update teamcity-common.xml and teamcity-plugin.xml
C:\Users\pavel.sher\AppData\Roaming\The Bat!
parents: 104
diff changeset
106 <antcall target="pack.agent.part">
63fcc9b14221 update teamcity-common.xml and teamcity-plugin.xml
C:\Users\pavel.sher\AppData\Roaming\The Bat!
parents: 104
diff changeset
107 <param name="out.unpacked" value="@{out.unpacked}"/>
63fcc9b14221 update teamcity-common.xml and teamcity-plugin.xml
C:\Users\pavel.sher\AppData\Roaming\The Bat!
parents: 104
diff changeset
108 <param name="name" value="@{name}"/>
63fcc9b14221 update teamcity-common.xml and teamcity-plugin.xml
C:\Users\pavel.sher\AppData\Roaming\The Bat!
parents: 104
diff changeset
109 </antcall>
63fcc9b14221 update teamcity-common.xml and teamcity-plugin.xml
C:\Users\pavel.sher\AppData\Roaming\The Bat!
parents: 104
diff changeset
110
76
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
111 <!-- copy teamcity-plugin.xml -->
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
112 <antcall target="prepare.plugin.descriptor.file">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
113 <param name="source" value="@{plugin.descriptor.file}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
114 <param name="dest" value="@{out.unpacked}/teamcity-plugin.xml"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
115 <param name="plugin.version" value="@{plugin.version}"/>
108
63fcc9b14221 update teamcity-common.xml and teamcity-plugin.xml
C:\Users\pavel.sher\AppData\Roaming\The Bat!
parents: 104
diff changeset
116 <param name="plugin.vendor" value="@{plugin.vendor}"/>
63fcc9b14221 update teamcity-common.xml and teamcity-plugin.xml
C:\Users\pavel.sher\AppData\Roaming\The Bat!
parents: 104
diff changeset
117 <param name="plugin.vendor.url" value="@{plugin.vendor.url}"/>
76
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
118 </antcall>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
119
108
63fcc9b14221 update teamcity-common.xml and teamcity-plugin.xml
C:\Users\pavel.sher\AppData\Roaming\The Bat!
parents: 104
diff changeset
120 <!-- copy additional server plugin files -->
63fcc9b14221 update teamcity-common.xml and teamcity-plugin.xml
C:\Users\pavel.sher\AppData\Roaming\The Bat!
parents: 104
diff changeset
121 <copy todir="@{out.unpacked}">
63fcc9b14221 update teamcity-common.xml and teamcity-plugin.xml
C:\Users\pavel.sher\AppData\Roaming\The Bat!
parents: 104
diff changeset
122 <fileset dir="${basedir}" excludes="**"/>
63fcc9b14221 update teamcity-common.xml and teamcity-plugin.xml
C:\Users\pavel.sher\AppData\Roaming\The Bat!
parents: 104
diff changeset
123 <server-additional-files/>
76
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
124 </copy>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
125
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
126 <!-- clean -->
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
127 <echo message="Cleaning..."/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
128 <delete dir="${teamcity.internal.distrib.prep}" quiet="true"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
129
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
130 <!-- package in zip -->
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
131 <echo message="Packaging zip..."/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
132 <delete file="@{out}/@{name}.zip" quiet="true"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
133 <zip destfile="@{out}/@{name}.zip">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
134 <fileset dir="@{out.unpacked}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
135 </zip>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
136 <echo message="To install the plugin, place '@{out}\@{name}.zip' into '.BuildServer/plugins' directory"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
137
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
138 </sequential>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
139 </macrodef>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
140
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
141 <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
142 <check.property name="path.variable.teamcitydistribution"
108
63fcc9b14221 update teamcity-common.xml and teamcity-plugin.xml
C:\Users\pavel.sher\AppData\Roaming\The Bat!
parents: 104
diff changeset
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."
76
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
144 />
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
145
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
146 <condition property="teamcity.distribution.not.present">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
147 <not>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
148 <and>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
149 <available file="${path.variable.teamcitydistribution}/webapps/ROOT/WEB-INF/lib"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
150 </and>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
151 </not>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
152 </condition>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
153 <fail if="teamcity.distribution.not.present"
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
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."/>
108
63fcc9b14221 update teamcity-common.xml and teamcity-plugin.xml
C:\Users\pavel.sher\AppData\Roaming\The Bat!
parents: 104
diff changeset
155 <echo message="Using ${path.variable.teamcitydistribution} as TeamCity distribution" />
76
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
156 </target>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
157
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
158 <macrodef name="deploy.teamcity.plugin">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
159 <attribute name="name"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
160 <attribute name="teamcity.data.path" default="${user.home}/.BuildServer" description="path to .BuildServer"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
161 <attribute name="out" default="${teamcity.internal.default.out}" description="directory storing prepared plugin zip"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
162
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
163 <sequential>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
164 <copy file="@{out}/@{name}.zip" todir="@{teamcity.data.path}/plugins" failonerror="true"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
165 </sequential>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
166 </macrodef>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
167
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
168 <macrodef name="undeploy.teamcity.plugin">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
169 <attribute name="name"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
170 <attribute name="teamcity.data.path" default="${user.home}/.BuildServer" description="path to .BuildServer"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
171
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
172 <sequential>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
173 <delete file="@{teamcity.data.path}/plugins/@{name}.zip" quiet="true"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
174 </sequential>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
175 </macrodef>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
176
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
177
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
178 <macrodef name="unpack.teamcity" description="TeamCity distribution unpacking">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
179 <attribute name="distribution.dir" default="${basedir}/teamcity-dist"
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
180 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
181 <attribute name="teamcity.data.path" default="${user.home}/.BuildServer" description="path to .BuildServer"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
182 <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
183
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
184 <sequential>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
185 <delete dir="@{distribution.dir}" quiet="true"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
186 <mkdir dir="@{distribution.dir}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
187
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
188 <!-- TODO: issue error if there are several matching files -->
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
189
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
190 <untar compression="gzip" dest="@{distribution.dir}">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
191 <fileset dir="@{teamcity.tar.gz-location}">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
192 <include name="*.tar.gz"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
193 </fileset>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
194 </untar>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
195
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
196 <move todir="@{distribution.dir}">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
197 <fileset dir="@{distribution.dir}\TeamCity">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
198 <include name="**"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
199 </fileset>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
200 </move>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
201 </sequential>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
202 </macrodef>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
203
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
204
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
205 <!-- ** Implementation ** -->
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
206
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
207 <macrodef name="check.property">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
208 <attribute name="name"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
209 <attribute name="fail-message" default=""/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
210 <attribute name="check-path" default=""/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
211 <sequential>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
212 <condition property="is.configured.@{name}">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
213 <not>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
214 <and>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
215 <isset property="@{name}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
216 <length string="${@{name}}" when="greater" length="0"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
217 </and>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
218 </not>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
219 </condition>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
220 <fail if="is.configured.@{name}"
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
221 message="Property '@{name}' not defined. @{fail-message}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
222 </sequential>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
223 </macrodef>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
224
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
225
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
226 <target name="prepare.common.part" if="common.needed">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
227 <jar destfile="${common.jar.path}">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
228 <fileset dir="${common.output}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
229 </jar>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
230 </target>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
231
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
232
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
233 <target name="prepare.server.part" if="server.needed">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
234 <mkdir dir="${out.unpacked}/server"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
235
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
236 <jar destfile="${out.unpacked}/server/${name}.jar">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
237 <fileset dir="${server.output}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
238 </jar>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
239
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
240 <copy todir="${out.unpacked}/server" failonerror="false">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
241 <fileset file="${common.jar.path}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
242 <fileset dir="${lib.dir}" includes="${lib.includes}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
243 </copy>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
244 </target>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
245
108
63fcc9b14221 update teamcity-common.xml and teamcity-plugin.xml
C:\Users\pavel.sher\AppData\Roaming\The Bat!
parents: 104
diff changeset
246 <target name="pack.agent.part" if="agent.needed">
63fcc9b14221 update teamcity-common.xml and teamcity-plugin.xml
C:\Users\pavel.sher\AppData\Roaming\The Bat!
parents: 104
diff changeset
247 <zip destfile="${out.unpacked}/agent/${name}.zip">
63fcc9b14221 update teamcity-common.xml and teamcity-plugin.xml
C:\Users\pavel.sher\AppData\Roaming\The Bat!
parents: 104
diff changeset
248 <fileset dir="${teamcity.internal.distrib.prep.agent.jars}"/>
63fcc9b14221 update teamcity-common.xml and teamcity-plugin.xml
C:\Users\pavel.sher\AppData\Roaming\The Bat!
parents: 104
diff changeset
249 </zip>
63fcc9b14221 update teamcity-common.xml and teamcity-plugin.xml
C:\Users\pavel.sher\AppData\Roaming\The Bat!
parents: 104
diff changeset
250 </target>
76
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
251
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
252 <target name="prepare.agent.part" if="agent.needed">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
253 <!-- prepare.agent.part -->
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
254 <mkdir dir="${teamcity.internal.distrib.prep.agent}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
255 <mkdir dir="${teamcity.internal.distrib.prep.agent.jars}/${name}/lib"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
256 <mkdir dir="${out.unpacked}/agent"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
257
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
258 <jar destfile="${teamcity.internal.distrib.prep.agent.jars}/${name}/lib/${name}.jar">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
259 <fileset dir="${agent.output}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
260 </jar>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
261
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
262 <copy todir="${teamcity.internal.distrib.prep.agent.jars}/${name}/lib" failonerror="false">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
263 <fileset file="${common.jar.path}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
264 </copy>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
265 </target>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
266
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
267 <target name="prepare.plugin.descriptor.file" if="plugin.descriptor.file.needed">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
268 <echo message="Copying plugin descriptor file '${source}' to '${dest}'."/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
269 <copy file="${source}" tofile="${dest}" failonerror="false"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
270
108
63fcc9b14221 update teamcity-common.xml and teamcity-plugin.xml
C:\Users\pavel.sher\AppData\Roaming\The Bat!
parents: 104
diff changeset
271 <echo message="Replacing '@Plugin_Version@', '@Plugin_Vendor@' and '@Plugin_Vendor_Url@' in the copied plugin descriptor file."/>
63fcc9b14221 update teamcity-common.xml and teamcity-plugin.xml
C:\Users\pavel.sher\AppData\Roaming\The Bat!
parents: 104
diff changeset
272 <replace file="${dest}">
63fcc9b14221 update teamcity-common.xml and teamcity-plugin.xml
C:\Users\pavel.sher\AppData\Roaming\The Bat!
parents: 104
diff changeset
273 <replacefilter token="@version@" value="${plugin.version}"/>
104
8cc11b0cbbd4 add vendor to teamcity-plugin.xml
Pavel.Sher
parents: 76
diff changeset
274 <replacefilter token="@Plugin_Version@" value="${plugin.version}"/>
108
63fcc9b14221 update teamcity-common.xml and teamcity-plugin.xml
C:\Users\pavel.sher\AppData\Roaming\The Bat!
parents: 104
diff changeset
275 <replacefilter token="@Plugin_Vendor@" value="${plugin.vendor}"/>
63fcc9b14221 update teamcity-common.xml and teamcity-plugin.xml
C:\Users\pavel.sher\AppData\Roaming\The Bat!
parents: 104
diff changeset
276 <replacefilter token="@Plugin_Vendor_Url@" value="${plugin.vendor.url}"/>
76
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
277 </replace>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
278 </target>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
279
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
280 <target name="check.already.defined">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
281 <condition property="already.defined">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
282 <isset property="teamcity.internal.distrib.prep"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
283 </condition>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
284 <fail if="already.defined"
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
285 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
286 </target>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
287
108
63fcc9b14221 update teamcity-common.xml and teamcity-plugin.xml
C:\Users\pavel.sher\AppData\Roaming\The Bat!
parents: 104
diff changeset
288 </project>