|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<project name="php-mysql-data-layer" default="build" basedir="."> |
| 3 | + <taskdef name="readSemanticVersion" classname="vendor.setbased.phing-extensions.lib.Task.readSemanticVersionTask"/> |
| 4 | + <property name="VERSION" value="0.0.0"/> |
| 5 | + |
| 6 | + <target name="build"> |
| 7 | + <echo message="noting to do."/> |
| 8 | + </target> |
| 9 | + |
| 10 | + <!-- Merges the current branch with a remote branch --> |
| 11 | + <target name="git-merge"> |
| 12 | + <exec command="git rev-parse --abbrev-ref HEAD" outputProperty="CURRENT_BRANCH"/> |
| 13 | + <input message="Your current branch is '${CURRENT_BRANCH}'. Remote branch: " propertyName="BRANCH"/> |
| 14 | + <gitbranch branchname="temp" repository="."/> |
| 15 | + <gitcheckout repository="." branchname="temp"/> |
| 16 | + <gitpull repository="." refspec="${BRANCH}" quiet="false"/> |
| 17 | + <gitcheckout repository="." branchname="${CURRENT_BRANCH}"/> |
| 18 | + <gitmerge repository="." remote="temp"/> |
| 19 | + <gitbranch branchname="temp" repository="." delete="true"/> |
| 20 | + </target> |
| 21 | + |
| 22 | + <!-- Merges the current branch with a remote branch in two steps: step 1 --> |
| 23 | + <target name="git-merge1"> |
| 24 | + <exec command="git rev-parse --abbrev-ref HEAD" outputProperty="CURRENT_BRANCH" checkreturn="true"/> |
| 25 | + <exec command="git fetch -p" passthru="true" checkreturn="true"/> |
| 26 | + <input message="Your current branch is '${CURRENT_BRANCH}'. Remote branch: " propertyName="BRANCH"/> |
| 27 | + <gitbranch branchname="temp" repository="."/> |
| 28 | + <gitcheckout repository="." branchname="temp"/> |
| 29 | + <gitpull repository="." refspec="${BRANCH}" quiet="false"/> |
| 30 | + </target> |
| 31 | + |
| 32 | + <!-- Merges the current branch with a remote branch in two steps: step 2 --> |
| 33 | + <target name="git-merge2"> |
| 34 | + <exec command="git rev-parse --abbrev-ref HEAD" outputProperty="CURRENT_BRANCH" checkreturn="true"/> |
| 35 | + <input message="Your current branch is '${CURRENT_BRANCH}'. Branch: " propertyName="BRANCH"/> |
| 36 | + <gitcheckout repository="." branchname="${BRANCH}"/> |
| 37 | + <gitmerge repository="." remote="temp"/> |
| 38 | + <gitbranch branchname="temp" repository="." delete="true"/> |
| 39 | + </target> |
| 40 | + |
| 41 | + <!-- Creates a new version/release. --> |
| 42 | + <target name="version"> |
| 43 | + <readSemanticVersion file=".version" |
| 44 | + versionProperty="VERSION" |
| 45 | + haltOnError="true"/> |
| 46 | + <gitcommit repository="." message="Release: ${VERSION}" allFiles="true"/> |
| 47 | + <gitpush repository="."/> |
| 48 | + <gittag repository="." name="${VERSION}"/> |
| 49 | + <gitpush repository="." refspec="${VERSION}" quiet="false"/> |
| 50 | + </target> |
| 51 | +</project> |
0 commit comments