1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-23 09:52:16 -05:00

Automate publishing of the changelogs.

Publishes the changelog on github using a gh-pages branch.

This implementation changes back and forth between git
branches without updating the working tree.  This should
be faster because the branches are unrelated so updating
the tree would require removing and recreating all the files.
This commit is contained in:
Joe Steele 2013-08-01 11:02:49 -04:00
parent 3d6a7b6409
commit 57c998becc
2 changed files with 46 additions and 1 deletions

View File

@ -155,7 +155,7 @@
</target>
<!-- rules -->
<target name="bump-version" depends="-set-version,-commit-version">
<target name="bump-version" depends="-set-version,-commit-version,-update-gh-pages-branch,-push-version">
<echo>Bumped K-9 to ${version-name}</echo>
</target>
@ -166,6 +166,43 @@
<exec executable="git" failonerror="true">
<arg line="tag ${version-name}" />
</exec>
</target>
<!-- Copy the changelog to the gh-pages branch. -->
<target name="-update-gh-pages-branch">
<!-- Check for a clean index, because it's about to be reset -->
<exec executable="git" failonerror="true">
<arg line="diff-index --cached --quiet HEAD" />
</exec>
<exec executable="git" failonerror="true" outputproperty="git-branch-ref" errorproperty="git-branch-ref-error">
<arg line="symbolic-ref HEAD" />
</exec>
<exec executable="git" failonerror="true">
<arg line="symbolic-ref HEAD refs/heads/gh-pages" />
</exec>
<exec executable="git" failonerror="true">
<arg line="reset -q" />
</exec>
<exec executable="git" failonerror="true" outputproperty="git-ls-tree" errorproperty="git-ls-tree-error">
<arg line="ls-tree ${git-branch-ref} res/xml/changelog_master.xml" />
</exec>
<regex property="changelog-path-dst" input="${git-branch-ref}" regexp=".*/([^/]+$)" select="changelog_\1_branch.xml" />
<regex property="git-index-info" input="${git-ls-tree}" regexp="(.*\t).*" select="\1${changelog-path-dst}" />
<exec executable="git" failonerror="true" inputstring="${git-index-info}">
<arg line="update-index --index-info" />
</exec>
<exec executable="git" failonerror="true">
<arg line="commit -m'Update changelog for version ${version-name}'" />
</exec>
<exec executable="git" failonerror="true">
<arg line="symbolic-ref HEAD ${git-branch-ref}" />
</exec>
<exec executable="git" failonerror="true">
<arg line="reset -q" />
</exec>
</target>
<target name="-push-version">
<exec executable="git" failonerror="true">
<arg line="push" />
</exec>

View File

@ -1,4 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="changelog_style.xsl"?>
<!--
The master change log is kept in res/xml/changelog_master.xml.
Locale specific versions are kept in res/xml-<locale qualifier>/changelog.xml.
Don't edit the changelog_<name>_branch.xml files in the gh-pages branch.
They are automatically updated with "ant bump-version".
-->
<changelog>
<release version="4.508" versioncode="18008" >
<change>Move 'share' menu item back, at least for the moment</change>