-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
50 lines (45 loc) · 2.52 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
45
46
47
48
49
50
<?xml version="1.0" encoding="UTF-8"?>
<project name="php-mysql-data-layer" default="build" basedir=".">
<taskdef name="readSemanticVersion" classname="vendor.setbased.phing-extensions.lib.Task.readSemanticVersionTask"/>
<property name ="VERSION" value="0.0.0"/>
<target name="build">
</target>
<!-- Merges the current branch with a remote branch -->
<target name="git-merge">
<exec command="git rev-parse --abbrev-ref HEAD" outputProperty="CURRENT_BRANCH"/>
<input message="Your current branch is '${CURRENT_BRANCH}'. Remote branch: " propertyName="BRANCH"/>
<gitbranch branchname="temp" repository="."/>
<gitcheckout repository="." branchname="temp"/>
<gitpull repository="." refspec="${BRANCH}" quiet="false"/>
<gitcheckout repository="." branchname="${CURRENT_BRANCH}"/>
<gitmerge repository="." remote="temp"/>
<gitbranch branchname="temp" repository="." delete="true"/>
</target>
<!-- Merges the current branch with a remote branch in two steps: step 1 -->
<target name="git-merge1">
<exec command="git rev-parse --abbrev-ref HEAD" outputProperty="CURRENT_BRANCH" checkreturn="true"/>
<exec command="git fetch -p" passthru="true" checkreturn="true"/>
<input message="Your current branch is '${CURRENT_BRANCH}'. Remote branch: " propertyName="BRANCH"/>
<gitbranch branchname="temp" repository="."/>
<gitcheckout repository="." branchname="temp"/>
<gitpull repository="." refspec="${BRANCH}" quiet="false"/>
</target>
<!-- Merges the current branch with a remote branch in two steps: step 2 -->
<target name="git-merge2">
<exec command="git rev-parse --abbrev-ref HEAD" outputProperty="CURRENT_BRANCH" checkreturn="true"/>
<input message="Your current branch is '${CURRENT_BRANCH}'. Branch: " propertyName="BRANCH"/>
<gitcheckout repository="." branchname="${BRANCH}"/>
<gitmerge repository="." remote="temp"/>
<gitbranch branchname="temp" repository="." delete="true"/>
</target>
<!-- Creates a new version/release. -->
<target name="version">
<readSemanticVersion file=".version"
versionProperty="VERSION"
haltOnError="true"/>
<gitcommit repository="." message="Release: ${VERSION}" allFiles="true"/>
<gitpush repository="."/>
<gittag repository="." name="${VERSION}"/>
<gitpush repository="." refspec="${VERSION}" quiet="false"/>
</target>
</project>