-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
44 lines (38 loc) · 1.66 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<project name="OpenCoverRunner-build" default="dist" basedir=".">
<property name="home" value="${artifact.output.path}"/>
<target name="replace-tokens-in-teamcity-plugin-xml">
<echo message="replacing tokens in teamcity-plugin.xml file under ${home}"/>
<tstamp>
<format property="snapshot" pattern="yyyyddMMHHmmss"/>
</tstamp>
<condition property="build.number" value="snapshot-${snapshot}" else="${build.number}">
<not>
<isset property="build.number"/>
</not>
</condition>
<echo message="Setting version to: ${build.number}"/>
<!-- update all references in teamcity-plugin.xml files -->
<replace dir="${home}" summary="true">
<include name="**/teamcity-plugin.xml"/>
<replacefilter token="@Plugin_Version@" value="${build.number}"/>
<replacefilter token="@Plugin_Vendor@" value="mindriven"/>
<replacefilter token="@Plugin_Vendor_Url@" value="https://github.com/mindriven"/>
</replace>
</target>
<target name="deploy">
<property name="TCPluginsDir" value="D:\TeamCity\Configuration\plugins"/>
<copy file="${home}/artifacts/plugin_zip/openCoverRunner.zip" overwrite="true" tofile="${TCPluginsDir}/openCoverRunner.zip" />
<exec executable="cmd.exe">
<arg line="/c net stop 'TeamCity Server'"/>
</exec>
<exec executable="cmd.exe">
<arg line="/c net start 'TeamCity Server'"/>
</exec>
<exec executable="cmd.exe">
<arg line="/c net stop 'TeamCity Build Agent'"/>
</exec>
<exec executable="cmd.exe">
<arg line="/c net start 'TeamCity Build Agent'"/>
</exec>
</target>
</project>