summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Zschocke <florian.zschocke@devolo.de>2020-01-30 21:47:12 +0100
committerFlorian Zschocke <f.zschocke+git@gmail.com>2022-02-01 22:58:30 +0100
commit7e89c337bc22c825e3251ad418f6bbaa3dfdbac8 (patch)
treeb79bd425a2d2ee8dd0428e054cec819c3b79b9b6
parent3eac7fba0c75a3246082d260e966f8aef054c9f1 (diff)
downloadgitblit-7e89c337bc22c825e3251ad418f6bbaa3dfdbac8.tar.gz
gitblit-7e89c337bc22c825e3251ad418f6bbaa3dfdbac8.zip
Build: create macro for creating the release process script
Refactor the creation of the release process script, from `release.template` into a `macrodef`. Add a new target `releaseScript`, so that the release script can be created after the `tagRelease` target was run. This is helpful if the `tagRelease` target is run by a different, earlier process than the actual release creation process.
-rw-r--r--build.xml87
1 files changed, 60 insertions, 27 deletions
diff --git a/build.xml b/build.xml
index 02c9476d..c08a7b9a 100644
--- a/build.xml
+++ b/build.xml
@@ -896,34 +896,27 @@ GB_RELEASE_TAG=${project.tag}
</mx:if>
<!-- create the release process script -->
- <mx:if>
- <os family="windows" />
- <then>
- <!-- Windows PowerShell script -->
- <!-- set-executionpolicy remotesigned -->
- <property name="recipe" value="release_${project.version}.ps1" />
- </then>
- <else>
- <!-- Bash script -->
- <property name="recipe" value="release_${project.version}.sh" />
- </else>
- </mx:if>
- <delete file="${recipe}" failonerror="false" quiet="true" verbose="false" />
- <!-- Work-around for lack of proper ant property substitution in copy -->
- <property name="dollar" value="$"/>
- <copy file="release.template" tofile="${recipe}">
- <filterset begintoken="${dollar}{" endtoken="}">
- <filter token="project.version" value="${project.version}" />
- <filter token="project.commitId" value="${project.commitId}" />
- <filter token="project.tag" value="${project.tag}" />
- <filter token="project.directory" value="${basedir}" />
- <filter token="maven.directory" value="${maven.directory}" />
- </filterset>
- </copy>
- <chmod file="${recipe}" perm="ugo+rx" />
+ <createReleaseScript
+ projectVersion="${project.version}"
+ projectTag="${project.tag}"
+ projectCommitId="${project.commitId}" />
+ </target>
+
+
+ <!--
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Create the release process script from the template.
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ -->
+ <target name="releaseScript" depends="prepare" description="create the release process script for a release version">
+ <!-- create the release process script -->
+ <createReleaseScript
+ projectVersion="${project.version}"
+ projectTag="${release.tag}"
+ projectCommitId="${release.tag}" />
</target>
-
+
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Prepare for the next point release development cycle.
@@ -951,7 +944,47 @@ GB_RELEASE_TAG=${project.tag}
</mx:commit>
</target>
-
+
+
+
+ <!--
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Create the release process script from the template.
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ -->
+ <macrodef name="createReleaseScript">
+ <attribute name="projectVersion" />
+ <attribute name="projectTag" />
+ <attribute name="projectCommitId" />
+ <sequential>
+ <mx:if>
+ <os family="windows" />
+ <then>
+ <!-- Windows PowerShell script -->
+ <!-- set-executionpolicy remotesigned -->
+ <property name="recipe" value="release_@{projectVersion}.ps1" />
+ </then>
+ <else>
+ <!-- Bash script -->
+ <property name="recipe" value="release_@{projectVersion}.sh" />
+ </else>
+ </mx:if>
+ <delete file="${recipe}" failonerror="false" quiet="true" verbose="false" />
+ <!-- Work-around for lack of proper ant property substitution in copy -->
+ <property name="dollar" value="$"/>
+ <copy file="release.template" tofile="${recipe}">
+ <filterset begintoken="${dollar}{" endtoken="}">
+ <filter token="project.version" value="@{projectVersion}" />
+ <filter token="project.commitId" value="@{projectCommitId}" />
+ <filter token="project.tag" value="@{projectTag}" />
+ <filter token="project.directory" value="${basedir}" />
+ <filter token="maven.directory" value="${maven.directory}" />
+ </filterset>
+ </copy>
+ <chmod file="${recipe}" perm="ugo+rx" />
+ </sequential>
+ </macrodef>
+
<!--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Build Gitblit Docs