forked from SWG-Source/swg-main
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgit_targets.xml
executable file
·195 lines (187 loc) · 5.28 KB
/
git_targets.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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
<?xml version="1.0" encoding="UTF-8"?>
<project name="git_targets" basedir="." >
<!-- ===============================
Git tasks
==================================== -->
<macrodef name = "git">
<attribute name = "command" />
<attribute name = "dir" default = "" />
<element name = "args" optional = "true" />
<sequential>
<echo message = "git @{command}" />
<exec executable = "git" dir = "@{dir}" failonerror="true">
<arg value = "@{command}" />
<args/>
</exec>
</sequential>
</macrodef>
<macrodef name = "git-clone-pull">
<attribute name = "repository" />
<attribute name = "dest" />
<attribute name = "branch" />
<sequential>
<git command = "clone">
<args>
<arg value = "@{repository}" />
<arg line = "-b @{branch}" />
<arg value = "@{dest}" />
</args>
</git>
<git-pull branch="@{branch}" dir="@{dest}" />
</sequential>
</macrodef>
<macrodef name = "git-pull">
<attribute name = "dir" />
<attribute name = "branch" />
<sequential>
<echo>Pulling @{dir}, branch: @{branch}</echo>
<git command = "pull" dir="@{dir}" >
<args>
<arg value = "origin" />
<arg value = "@{branch}" />
</args>
</git>
</sequential>
</macrodef>
<macrodef name = "git-push">
<attribute name = "dir" />
<attribute name = "branch" />
<sequential>
<echo>Pushing @{dir} to @{branch}</echo>
<git command = "push" dir="@{dir}" >
<args>
<arg value = "origin" />
<arg value = "@{branch}" />
</args>
</git>
</sequential>
</macrodef>
<macrodef name = "git-checkout">
<attribute name = "branch" />
<attribute name = "dir" />
<sequential>
<echo>Checking out @{branch} branch</echo>
<git command="checkout" dir="@{dir}">
<args>
<arg value="@{branch}" />
</args>
</git>
</sequential>
</macrodef>
<macrodef name = "git-commit">
<attribute name = "comment" />
<attribute name = "file" />
<attribute name = "dir" />
<attribute name = "branch" />
<sequential>
<echo>Commiting @{file} to git on branch @{branch}</echo>
<git command="add" dir="@{dir}">
<args>
<arg value="@{file}" />
</args>
</git>
<git command="commit" dir="@{dir}">
<args>
<arg value="@{file}" />
<arg line="-m '${comment}'" />
</args>
</git>
<git-push branch="${branch}" dir="@{dir}" />
</sequential>
</macrodef>
<macrodef name = "git-tag">
<attribute name = "comment" />
<attribute name = "dir" />
<attribute name = "version" />
<sequential>
<if>
<isset property="dont_zip" />
<then/>
<else>
<echo>Tagging @{dir} @{version} </echo>
<git command="tag" dir="@{dir}">
<args>
<arg line="-a @{version}" />
<arg line="-m '@{comment}'" />
</args>
</git>
<git-push branch="@{version}" dir="@{dir}" />
</else>
</if>
</sequential>
</macrodef>
<macrodef name = "git-update-submods">
<attribute name = "dir" default = "" />
<sequential>
<git command = "submodule" dir="@{dir}">
<args>
<arg line="update"/>
<arg line="--init"/>
<arg line="--recursive"/>
</args>
</git>
</sequential>
</macrodef>
<!--
<target name="git_tag">
<git command="tag" dir="staging/${extn}">
<args>
<arg line="-a ${next_version}" />
<arg line="-m '${comment}'" />
</args>
</git>
<git-push-tag branch="${next_version}" dir="staging/${extn}" />
</target>-->
<!-- ===============================
Modman tasks
==================================== -->
<macrodef name="modman">
<attribute name="command" />
<attribute name="dir" default="" />
<element name="args" optional="true" />
<sequential>
<echo message="modman @{command} in @{dir}" />
<exec executable="modman" dir="@{dir}">
<arg value="@{command}" />
<args/>
</exec>
</sequential>
</macrodef>
<macrodef name="modman-clone">
<attribute name="repos" />
<attribute name="dest" />
<attribute name="branch" />
<sequential>
<modman command="clone" dir="@{dest}">
<args>
<arg value="@{repos}" />
<arg line="--branch @{branch}" />
</args>
</modman>
</sequential>
</macrodef>
<macrodef name="modman-clone-overlay">
<attribute name="extn" />
<attribute name="dest" />
<attribute name="branch" />
<attribute name="repos" />
<sequential>
<echo>Cloning @{extn} with branch @{branch} (named: @{extn}@{branch})</echo>
<modman command="clone" dir="@{dest}">
<args>
<arg value="@{extn}@{branch}" />
<arg value="@{repos}" />
<arg line="--branch @{branch}" />
</args>
</modman>
</sequential>
</macrodef>
<macrodef name="modman-update">
<attribute name="dir" />
<attribute name="extn" />
<sequential>
<echo>Updating @{dir}, extn: @{extn}</echo>
<modman command="update" extn="@{extn}" dir="@{dest}" />
</sequential>
</macrodef>
</project>