mirror of
https://github.com/moparisthebest/k-9
synced 2025-02-07 02:30:10 -05:00
More robust parsing of changelog in build.xml
This commit is contained in:
parent
57c998becc
commit
6e62081390
27
build.xml
27
build.xml
@ -86,6 +86,7 @@
|
|||||||
<property name="rclib" value="${out.dir}/K9RemoteControl.jar" />
|
<property name="rclib" value="${out.dir}/K9RemoteControl.jar" />
|
||||||
<property name="rcdir" value="com/fsck/k9/remotecontrol/**" />
|
<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">
|
<condition property="android.executable" value="android.bat">
|
||||||
<os family="windows" />
|
<os family="windows" />
|
||||||
</condition>
|
</condition>
|
||||||
@ -139,9 +140,29 @@
|
|||||||
</if.contrib>
|
</if.contrib>
|
||||||
|
|
||||||
<echo>Setting version to ${version-name}</echo>
|
<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" />
|
<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>
|
</exec>
|
||||||
|
<if.contrib>
|
||||||
|
<equals arg1="${git-status}" arg2="" />
|
||||||
|
<else>
|
||||||
|
<fail>Uncomitted changelog edits.</fail>
|
||||||
|
</else>
|
||||||
|
</if.contrib>
|
||||||
|
|
||||||
<replace file="AndroidManifest.xml"
|
<replace file="AndroidManifest.xml"
|
||||||
token="android:versionName="${current-version-name}""
|
token="android:versionName="${current-version-name}""
|
||||||
value="android:versionName="${version-name}"" summary="true"
|
value="android:versionName="${version-name}"" summary="true"
|
||||||
@ -184,7 +205,7 @@
|
|||||||
<arg line="reset -q" />
|
<arg line="reset -q" />
|
||||||
</exec>
|
</exec>
|
||||||
<exec executable="git" failonerror="true" outputproperty="git-ls-tree" errorproperty="git-ls-tree-error">
|
<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" />
|
<arg line="ls-tree ${git-branch-ref} ${changelog-path-src}" />
|
||||||
</exec>
|
</exec>
|
||||||
<regex property="changelog-path-dst" input="${git-branch-ref}" regexp=".*/([^/]+$)" select="changelog_\1_branch.xml" />
|
<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}" />
|
<regex property="git-index-info" input="${git-ls-tree}" regexp="(.*\t).*" select="\1${changelog-path-dst}" />
|
||||||
|
Loading…
Reference in New Issue
Block a user