mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-27 11:42:16 -05:00
Merge pull request #354 from zjw/publish_changelog
Automated change log publication
This commit is contained in:
commit
57ad9977bc
73
build.xml
73
build.xml
@ -86,6 +86,7 @@
|
||||
<property name="rclib" value="${out.dir}/K9RemoteControl.jar" />
|
||||
<property name="rcdir" value="com/fsck/k9/remotecontrol/**" />
|
||||
|
||||
<property name="changelog-path-src" value="res/xml/changelog_master.xml" />
|
||||
<condition property="android.executable" value="android.bat">
|
||||
<os family="windows" />
|
||||
</condition>
|
||||
@ -129,6 +130,36 @@
|
||||
<regex property="version-name" input="${major}." regexp="(\d+.)" replace="\1${minor}" />
|
||||
</target>
|
||||
|
||||
<target name="-pre-bump-check" depends="-get-version-name,-auto-incr-version">
|
||||
<xpath
|
||||
input="${changelog-path-src}"
|
||||
expression="/changelog/release[@version='${version-name}']/@version"
|
||||
output="changelog-test" />
|
||||
|
||||
<if.contrib>
|
||||
<equals arg1="${changelog-test}" arg2="${version-name}" />
|
||||
<else>
|
||||
<fail>No changelog for ${version-name}.</fail>
|
||||
</else>
|
||||
</if.contrib>
|
||||
|
||||
<exec executable="git" failonerror="true" outputproperty="git-status" errorproperty="git-status-error">
|
||||
<arg line="status -s ${changelog-path-src}" />
|
||||
</exec>
|
||||
<if.contrib>
|
||||
<equals arg1="${git-status}" arg2="" />
|
||||
<else>
|
||||
<fail>Uncomitted changelog edits.</fail>
|
||||
</else>
|
||||
</if.contrib>
|
||||
|
||||
<!-- Check for a clean index, because it will be reset in -update-gh-pages-branch -->
|
||||
<exec executable="git" failonerror="true">
|
||||
<arg line="diff-index --cached --quiet HEAD" />
|
||||
</exec>
|
||||
|
||||
</target>
|
||||
|
||||
<target name="-set-version" depends="-get-version-name,-get-version-code">
|
||||
<!-- pass -Dversion-name=4.200 to define the version instead of auto-incrementing it -->
|
||||
<if.contrib>
|
||||
@ -139,9 +170,7 @@
|
||||
</if.contrib>
|
||||
|
||||
<echo>Setting version to ${version-name}</echo>
|
||||
<exec executable="perl" failonerror="true">
|
||||
<arg line="-0 -ne '/\x3Crelease version=\x22${version-name}\x22/ or die qq/No changelog for ${version-name}\n/' res/xml/changelog_master.xml" />
|
||||
</exec>
|
||||
|
||||
<replace file="AndroidManifest.xml"
|
||||
token="android:versionName="${current-version-name}""
|
||||
value="android:versionName="${version-name}"" summary="true"
|
||||
@ -155,7 +184,7 @@
|
||||
</target>
|
||||
|
||||
<!-- rules -->
|
||||
<target name="bump-version" depends="-set-version,-commit-version">
|
||||
<target name="bump-version" depends="-pre-bump-check,-set-version,-commit-version,-update-gh-pages-branch,-push-version">
|
||||
<echo>Bumped K-9 to ${version-name}</echo>
|
||||
</target>
|
||||
|
||||
@ -166,11 +195,41 @@
|
||||
<exec executable="git" failonerror="true">
|
||||
<arg line="tag ${version-name}" />
|
||||
</exec>
|
||||
<exec executable="git" failonerror="true">
|
||||
<arg line="push" />
|
||||
</target>
|
||||
|
||||
<!-- Copy the changelog to the gh-pages branch. -->
|
||||
<target name="-update-gh-pages-branch">
|
||||
<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="push origin tag ${version-name}" />
|
||||
<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} ${changelog-path-src}" />
|
||||
</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 origin HEAD gh-pages tag ${version-name}" />
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user