aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTorne (Richard Coles) <torne@wolfpuppy.org.uk>2012-10-27 21:51:30 +0100
committerTorne (Richard Coles) <torne@wolfpuppy.org.uk>2012-10-27 21:51:30 +0100
commit9ed7b4fd299fd5007b602f70e472d69fbd66ebf4 (patch)
treece28d7b11f4ca09e5553769d51b2cf4d0eb47170
parentd59ed74b91d261197e3f9bc00eddfead61abb9f7 (diff)
downloadconnectbot-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--.gitignore1
-rw-r--r--build.xml14
-rw-r--r--res/values/notrans.xml4
3 files changed, 8 insertions, 11 deletions
diff --git a/.gitignore b/.gitignore
index 61075a9..7829861 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,4 +2,5 @@ bin
gen
launchpad-*.tar.gz
local.properties
+res/values/version.xml
*~
diff --git a/build.xml b/build.xml
index ac99fb5..b7e3e32 100644
--- a/build.xml
+++ b/build.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 &#x201C;License&#x201D;). 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 &#x201C;AS IS&#x201D; 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>