forked from appirio-tech/direct-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-master-utils.xml
140 lines (109 loc) · 4.64 KB
/
build-master-utils.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<?xml version="1.0" encoding="UTF-8"?>
<!-- ======================================================================
Dec 2, 2008 11:05:12 PM
Build Master Utils
TCSDEVELOPER
====================================================================== -->
<project name="tools.master.utils">
<description>
Defines utitlity tasks.
</description>
<taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
<!-- = = = = = = = = = = = = = = = = =
scriptdef: version-path
Gets the svn path of a specific version of a subproject.
This task is only used within the 'execute-all' task.
= = = = = = = = = = = = = = = = = = = = -->
<scriptdef name="version-path" language="groovy" classpathref="script.path"
description="Gets the svn path of a specific version of a subproject.">
<!-- prefix of the properties containing the subproject information -->
<attribute name="prefix" />
<!-- the property which holds the svn path of the specific version -->
<attribute name="property" />
<!-- the version for which to find the svnpath -->
<attribute name="version" />
<![CDATA[
def prefix = attributes.prefix
def version = attributes.version
def value = project.getProperty("${prefix}.version.${version}")
if (value == null)
{
value = version
}
def svnbase = project.getProperty("${prefix}.svnbase")
project.setProperty("${attributes.property}", "${svnbase}/${value}")
]]>
</scriptdef>
<scriptdef name="tag-path" language="groovy" classpathref="script.path"
description="Gets the svn path of a specific version of a subproject.">
<!-- prefix of the properties containing the subproject information -->
<attribute name="prefix" />
<!-- the property which holds the svn path of the specific version -->
<attribute name="property" />
<!-- the version for which to find the svnpath -->
<attribute name="tag" />
<![CDATA[
def prefix = attributes.prefix
def tag = attributes.tag
def svnbase = project.getProperty("${prefix}.svnbase")
project.setProperty("${attributes.property}", "${svnbase}/tags/${tag}")
]]>
</scriptdef>
<scriptdef name="branch-path" language="groovy" classpathref="script.path"
description="Gets the svn path of a specific version of a subproject.">
<!-- prefix of the properties containing the subproject information -->
<attribute name="prefix" />
<!-- the property which holds the svn path of the specific version -->
<attribute name="property" />
<!-- the version for which to find the svnpath -->
<attribute name="branch" />
<![CDATA[
def prefix = attributes.prefix
def branch = attributes.branch
def svnbase = project.getProperty("${prefix}.svnbase")
project.setProperty("${attributes.property}", "${svnbase}/branches/${branch}")
]]>
</scriptdef>
<!-- = = = = = = = = = = = = = = = = =
macrodef: svnex
This tasks execute svn operations against cached credentials,
or prompt for password if svn.username property is set.
= = = = = = = = = = = = = = = = = -->
<macrodef name="svnex">
<!-- the operations to be performed via subversion -->
<element name="operation" implicit="true"/>
<sequential>
<if>
<isset property="svn.username"/>
<then>
<if>
<not>
<isset property="svn.password"/>
</not>
<then>
<input addproperty="svn.password" message="Please enter svn password: "/>
</then>
</if>
<svn javahl="false" username="${svn.username}" password="${svn.password}">
<operation />
</svn>
</then>
<else>
<svn javahl="false">
<operation />
</svn>
</else>
</if>
</sequential>
</macrodef>
<condition property="is_windows">
<and>
<os family="windows"/>
</and>
</condition>
<condition property="is_unix">
<and>
<os family="unix"/>
</and>
</condition>
</project>