annotate teamcity-common.xml @ 939:7528d38018b1

merge
author Dmitry Neverov <dmitry.neverov@gmail.com>
date Wed, 09 Dec 2015 13:07:03 +0100
parents 31a1aca3305c
children
rev   line source
76
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
1 <?xml version="1.0" encoding="UTF-8"?>
732
31a1aca3305c Update copyright
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents: 108
diff changeset
2 <!--
31a1aca3305c Update copyright
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents: 108
diff changeset
3 ~ Copyright 2000-2014 JetBrains s.r.o.
31a1aca3305c Update copyright
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents: 108
diff changeset
4 ~
31a1aca3305c Update copyright
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents: 108
diff changeset
5 ~ Licensed under the Apache License, Version 2.0 (the "License");
31a1aca3305c Update copyright
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents: 108
diff changeset
6 ~ you may not use this file except in compliance with the License.
31a1aca3305c Update copyright
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents: 108
diff changeset
7 ~ You may obtain a copy of the License at
31a1aca3305c Update copyright
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents: 108
diff changeset
8 ~
31a1aca3305c Update copyright
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents: 108
diff changeset
9 ~ http://www.apache.org/licenses/LICENSE-2.0
31a1aca3305c Update copyright
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents: 108
diff changeset
10 ~
31a1aca3305c Update copyright
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents: 108
diff changeset
11 ~ Unless required by applicable law or agreed to in writing, software
31a1aca3305c Update copyright
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents: 108
diff changeset
12 ~ distributed under the License is distributed on an "AS IS" BASIS,
31a1aca3305c Update copyright
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents: 108
diff changeset
13 ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31a1aca3305c Update copyright
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents: 108
diff changeset
14 ~ See the License for the specific language governing permissions and
31a1aca3305c Update copyright
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents: 108
diff changeset
15 ~ limitations under the License.
31a1aca3305c Update copyright
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents: 108
diff changeset
16 -->
31a1aca3305c Update copyright
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents: 108
diff changeset
17
76
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
18 <project name="TeamCityPluginCommon">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
19
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
20 <!--
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
21 Tasks:
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
22 package.teamcity.plugin
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
23 deploy.teamcity.plugin
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
24 undeploy.teamcity.plugin
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
25 unpack.teamcity
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
26
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
27 Targets:
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
28 check.teamcitydistribution
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
29 -->
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
30
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
31 <property name="path.variable.teamcitydistribution" value="${teamcity.distribution}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
32
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
33 <property name="teamcity.internal.default.out" value="dist"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
34
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
35
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
36 <macrodef name="package.teamcity.plugin" description="packages TeamCity plugin">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
37 <attribute name="name" description="name of the plugin"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
38 <attribute name="server.output" default="" description="path to compiled server plugin output"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
39 <attribute name="agent.output" default="" description="path to compiled agent plugin output"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
40 <attribute name="common.output" default="" description="path to compiled common plugin output"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
41 <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
42 <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
43 <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
44 <attribute name="out.unpacked" default="@{out}/unpacked"
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
45 description="name of the directory to store unpacked plugin (not packed into zip)"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
46
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
47 <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
48 <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
49 <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
50 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
51 <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
52 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
53 <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
54 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
55
108
63fcc9b14221 update teamcity-common.xml and teamcity-plugin.xml
C:\Users\pavel.sher\AppData\Roaming\The Bat!
parents: 104
diff changeset
56 <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
57 <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
58
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
59 <sequential>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
60
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
61 <antcall target="check.already.defined"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
62
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
63 <property name="teamcity.internal.distrib.prep" value="${basedir}/temp/dist_prep"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
64 <property name="teamcity.internal.distrib.prep.agent" value="${teamcity.internal.distrib.prep}/agent"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
65 <property name="teamcity.internal.distrib.prep.common" value="${teamcity.internal.distrib.prep}/common"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
66 <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
67
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
68
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
69 <!-- build jars -->
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
70
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
71 <delete dir="@{out.unpacked}" quiet="true"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
72 <delete dir="${teamcity.internal.distrib.prep}" quiet="true"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
73
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
74 <mkdir dir="@{out.unpacked}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
75
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
76 <condition property="common.needed">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
77 <length string="@{common.output}" when="greater" length="0"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
78 </condition>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
79 <condition property="server.needed">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
80 <length string="@{server.output}" when="greater" length="0"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
81 </condition>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
82 <condition property="agent.needed">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
83 <length string="@{agent.output}" when="greater" length="0"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
84 </condition>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
85
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
86 <condition property="plugin.descriptor.file.needed">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
87 <and>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
88 <available file="@{plugin.descriptor.file}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
89 <length string="@{plugin.descriptor.file}" when="greater" length="0"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
90 </and>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
91 </condition>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
92
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
93 <mkdir dir="${teamcity.internal.distrib.prep.common}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
94 <antcall target="prepare.common.part">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
95 <param name="common.output" value="@{common.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
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
99 <antcall target="prepare.server.part">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
100 <param name="out.unpacked" value="@{out.unpacked}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
101 <param name="name" value="@{name}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
102 <param name="server.output" value="@{server.output}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
103 <param name="common.jar.path" value="${teamcity.internal.distrib.prep.common}/@{common.jar.name}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
104 <param name="lib.dir" value="@{server.lib.dir}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
105 <param name="lib.includes" value="@{server.lib.includes}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
106 </antcall>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
107
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
108 <antcall target="prepare.agent.part">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
109 <param name="out.unpacked" value="@{out.unpacked}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
110 <param name="name" value="@{name}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
111 <param name="agent.output" value="@{agent.output}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
112 <param name="common.jar.path" value="${teamcity.internal.distrib.prep.common}/@{common.jar.name}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
113 </antcall>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
114
108
63fcc9b14221 update teamcity-common.xml and teamcity-plugin.xml
C:\Users\pavel.sher\AppData\Roaming\The Bat!
parents: 104
diff changeset
115 <!-- 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
116 <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
117 <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
118 <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
119 <agent-additional-files/>
63fcc9b14221 update teamcity-common.xml and teamcity-plugin.xml
C:\Users\pavel.sher\AppData\Roaming\The Bat!
parents: 104
diff changeset
120 </copy>
63fcc9b14221 update teamcity-common.xml and teamcity-plugin.xml
C:\Users\pavel.sher\AppData\Roaming\The Bat!
parents: 104
diff changeset
121
63fcc9b14221 update teamcity-common.xml and teamcity-plugin.xml
C:\Users\pavel.sher\AppData\Roaming\The Bat!
parents: 104
diff changeset
122 <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
123 <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
124 <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
125 </antcall>
63fcc9b14221 update teamcity-common.xml and teamcity-plugin.xml
C:\Users\pavel.sher\AppData\Roaming\The Bat!
parents: 104
diff changeset
126
76
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
127 <!-- copy teamcity-plugin.xml -->
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
128 <antcall target="prepare.plugin.descriptor.file">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
129 <param name="source" value="@{plugin.descriptor.file}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
130 <param name="dest" value="@{out.unpacked}/teamcity-plugin.xml"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
131 <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
132 <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
133 <param name="plugin.vendor.url" value="@{plugin.vendor.url}"/>
76
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
134 </antcall>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
135
108
63fcc9b14221 update teamcity-common.xml and teamcity-plugin.xml
C:\Users\pavel.sher\AppData\Roaming\The Bat!
parents: 104
diff changeset
136 <!-- 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
137 <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
138 <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
139 <server-additional-files/>
76
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
140 </copy>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
141
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
142 <!-- clean -->
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
143 <echo message="Cleaning..."/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
144 <delete dir="${teamcity.internal.distrib.prep}" quiet="true"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
145
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
146 <!-- package in zip -->
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
147 <echo message="Packaging zip..."/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
148 <delete file="@{out}/@{name}.zip" quiet="true"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
149 <zip destfile="@{out}/@{name}.zip">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
150 <fileset dir="@{out.unpacked}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
151 </zip>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
152 <echo message="To install the plugin, place '@{out}\@{name}.zip' into '.BuildServer/plugins' directory"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
153
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 <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
158 <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
159 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
160 />
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
161
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
162 <condition property="teamcity.distribution.not.present">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
163 <not>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
164 <and>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
165 <available file="${path.variable.teamcitydistribution}/webapps/ROOT/WEB-INF/lib"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
166 </and>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
167 </not>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
168 </condition>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
169 <fail if="teamcity.distribution.not.present"
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
170 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
171 <echo message="Using ${path.variable.teamcitydistribution} as TeamCity distribution" />
76
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
172 </target>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
173
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
174 <macrodef name="deploy.teamcity.plugin">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
175 <attribute name="name"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
176 <attribute name="teamcity.data.path" default="${user.home}/.BuildServer" description="path to .BuildServer"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
177 <attribute name="out" default="${teamcity.internal.default.out}" description="directory storing prepared plugin zip"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
178
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
179 <sequential>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
180 <copy file="@{out}/@{name}.zip" todir="@{teamcity.data.path}/plugins" failonerror="true"/>
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 <macrodef name="undeploy.teamcity.plugin">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
185 <attribute name="name"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
186 <attribute name="teamcity.data.path" default="${user.home}/.BuildServer" description="path to .BuildServer"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
187
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
188 <sequential>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
189 <delete file="@{teamcity.data.path}/plugins/@{name}.zip" quiet="true"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
190 </sequential>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
191 </macrodef>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
192
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
193
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
194 <macrodef name="unpack.teamcity" description="TeamCity distribution unpacking">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
195 <attribute name="distribution.dir" default="${basedir}/teamcity-dist"
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
196 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
197 <attribute name="teamcity.data.path" default="${user.home}/.BuildServer" description="path to .BuildServer"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
198 <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
199
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
200 <sequential>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
201 <delete dir="@{distribution.dir}" quiet="true"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
202 <mkdir dir="@{distribution.dir}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
203
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
204 <!-- TODO: issue error if there are several matching files -->
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
205
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
206 <untar compression="gzip" dest="@{distribution.dir}">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
207 <fileset dir="@{teamcity.tar.gz-location}">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
208 <include name="*.tar.gz"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
209 </fileset>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
210 </untar>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
211
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
212 <move todir="@{distribution.dir}">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
213 <fileset dir="@{distribution.dir}\TeamCity">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
214 <include name="**"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
215 </fileset>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
216 </move>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
217 </sequential>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
218 </macrodef>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
219
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
220
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
221 <!-- ** Implementation ** -->
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
222
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
223 <macrodef name="check.property">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
224 <attribute name="name"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
225 <attribute name="fail-message" default=""/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
226 <attribute name="check-path" default=""/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
227 <sequential>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
228 <condition property="is.configured.@{name}">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
229 <not>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
230 <and>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
231 <isset property="@{name}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
232 <length string="${@{name}}" when="greater" length="0"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
233 </and>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
234 </not>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
235 </condition>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
236 <fail if="is.configured.@{name}"
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
237 message="Property '@{name}' not defined. @{fail-message}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
238 </sequential>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
239 </macrodef>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
240
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
241
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
242 <target name="prepare.common.part" if="common.needed">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
243 <jar destfile="${common.jar.path}">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
244 <fileset dir="${common.output}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
245 </jar>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
246 </target>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
247
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
248
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
249 <target name="prepare.server.part" if="server.needed">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
250 <mkdir dir="${out.unpacked}/server"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
251
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
252 <jar destfile="${out.unpacked}/server/${name}.jar">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
253 <fileset dir="${server.output}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
254 </jar>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
255
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
256 <copy todir="${out.unpacked}/server" failonerror="false">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
257 <fileset file="${common.jar.path}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
258 <fileset dir="${lib.dir}" includes="${lib.includes}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
259 </copy>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
260 </target>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
261
108
63fcc9b14221 update teamcity-common.xml and teamcity-plugin.xml
C:\Users\pavel.sher\AppData\Roaming\The Bat!
parents: 104
diff changeset
262 <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
263 <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
264 <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
265 </zip>
63fcc9b14221 update teamcity-common.xml and teamcity-plugin.xml
C:\Users\pavel.sher\AppData\Roaming\The Bat!
parents: 104
diff changeset
266 </target>
76
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
267
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
268 <target name="prepare.agent.part" if="agent.needed">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
269 <!-- prepare.agent.part -->
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
270 <mkdir dir="${teamcity.internal.distrib.prep.agent}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
271 <mkdir dir="${teamcity.internal.distrib.prep.agent.jars}/${name}/lib"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
272 <mkdir dir="${out.unpacked}/agent"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
273
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
274 <jar destfile="${teamcity.internal.distrib.prep.agent.jars}/${name}/lib/${name}.jar">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
275 <fileset dir="${agent.output}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
276 </jar>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
277
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
278 <copy todir="${teamcity.internal.distrib.prep.agent.jars}/${name}/lib" failonerror="false">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
279 <fileset file="${common.jar.path}"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
280 </copy>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
281 </target>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
282
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
283 <target name="prepare.plugin.descriptor.file" if="plugin.descriptor.file.needed">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
284 <echo message="Copying plugin descriptor file '${source}' to '${dest}'."/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
285 <copy file="${source}" tofile="${dest}" failonerror="false"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
286
108
63fcc9b14221 update teamcity-common.xml and teamcity-plugin.xml
C:\Users\pavel.sher\AppData\Roaming\The Bat!
parents: 104
diff changeset
287 <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
288 <replace file="${dest}">
63fcc9b14221 update teamcity-common.xml and teamcity-plugin.xml
C:\Users\pavel.sher\AppData\Roaming\The Bat!
parents: 104
diff changeset
289 <replacefilter token="@version@" value="${plugin.version}"/>
104
8cc11b0cbbd4 add vendor to teamcity-plugin.xml
Pavel.Sher
parents: 76
diff changeset
290 <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
291 <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
292 <replacefilter token="@Plugin_Vendor_Url@" value="${plugin.vendor.url}"/>
76
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
293 </replace>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
294 </target>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
295
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
296 <target name="check.already.defined">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
297 <condition property="already.defined">
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
298 <isset property="teamcity.internal.distrib.prep"/>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
299 </condition>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
300 <fail if="already.defined"
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
301 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
302 </target>
84f8c95be7bb teamcity-common.xml added
Pavel.Sher
parents:
diff changeset
303
108
63fcc9b14221 update teamcity-common.xml and teamcity-plugin.xml
C:\Users\pavel.sher\AppData\Roaming\The Bat!
parents: 104
diff changeset
304 </project>