diff options
author | Torne (Richard Coles) <torne@wolfpuppy.org.uk> | 2012-10-27 21:51:30 +0100 |
---|---|---|
committer | Torne (Richard Coles) <torne@wolfpuppy.org.uk> | 2012-10-27 21:51:30 +0100 |
commit | 9ed7b4fd299fd5007b602f70e472d69fbd66ebf4 (patch) | |
tree | ce28d7b11f4ca09e5553769d51b2cf4d0eb47170 | |
parent | d59ed74b91d261197e3f9bc00eddfead61abb9f7 (diff) | |
download | connectbot-9ed7b4fd299fd5007b602f70e472d69fbd66ebf4.tar.gz connectbot-9ed7b4fd299fd5007b602f70e472d69fbd66ebf4.tar.bz2 connectbot-9ed7b4fd299fd5007b602f70e472d69fbd66ebf4.zip |
Fix broken git version generation.
The regex to edit res/values/notrans.xml no longer matched, so the
version number wasn't being edited. Generate the version number into a
separate resource file that isn't checked in instead, as this is neater.
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | build.xml | 14 | ||||
-rw-r--r-- | res/values/notrans.xml | 4 |
3 files changed, 8 insertions, 11 deletions
@@ -2,4 +2,5 @@ bin gen launchpad-*.tar.gz local.properties +res/values/version.xml *~ @@ -126,18 +126,18 @@ <xpath input="AndroidManifest.xml" expression="/manifest/@android:versionName" output="manifest.version.name" /> - <!-- checkout notrans.xml so we can ignore it in our index --> - <exec executable="git"> - <arg line="checkout res/values/notrans.xml"/> - </exec> - <!-- find out the description of the current Git commit --> <exec executable="git" outputproperty="git.revision"> <arg line="describe --match 'v[0-9]*' --dirty"/> </exec> - <replaceregexp file="${resource.absolute.dir}/values/notrans.xml" encoding="utf8" match='(\x3Cstring name="msg_version">)[^\x3C]*(\x3C/string>)' - replace='\1${ant.project.name} ${manifest.version.name} (${git.revision} ${build.date})\2' /> + <!-- write out to res/values/version.xml --> + <echo file="${resource.absolute.dir}/values/version.xml" encoding="utf8"><![CDATA[<?xml version="1.0" encoding="utf-8"?> +<resources> + <string name="msg_version" translatable="false">${ant.project.name} ${manifest.version.name} (${git.revision} ${build.date})</string> +</resources> +]]></echo> + <echo>Updated "msg_version" to: ${ant.project.name} ${manifest.version.name} (${git.revision} ${build.date})</echo> </target> diff --git a/res/values/notrans.xml b/res/values/notrans.xml index f28cffc..3142ed6 100644 --- a/res/values/notrans.xml +++ b/res/values/notrans.xml @@ -19,10 +19,6 @@ --> <resources> <string name="app_name" translatable="false">ConnectBot</string> - <!-- DO NOT MANUALLY UPDATE VERSION!!! - Updating is update by the ant task "update-version" in build.xml - --> - <string name="msg_version" translatable="false">ConnectBot (working copy)</string> <string name="copyright_info" translatable="false">Before we get started, we need to get some legal information out of the way. ConnectBot is provided under the Apache License, Version 2.0 (the “License”). Here are a few key points:\n\nYou may not use this program except in compliance with the License. You may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.</string> |