+AndroidManifest.xml
ant.properties
bin
gen
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.saurik.backport"
- android:versionCode="1"
- android:versionName="1.0"
->
- <application android:label="Backport" >
- <meta-data android:name="com.saurik.substrate.main" android:value=".Hook"/>
- </application>
-
- <uses-sdk android:minSdkVersion="9" android:targetSdkVersion="17"/>
- <uses-permission android:name="cydia.permission.SUBSTRATE"/>
-</manifest>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.saurik.backport"
+ android:versionCode="${monotonic}"
+ android:versionName="${version}"
+>
+ <application android:label="Backport">
+ <meta-data android:name="com.saurik.substrate.main" android:value=".Hook"/>
+ </application>
+
+ <uses-sdk android:minSdkVersion="9" android:targetSdkVersion="17"/>
+ <uses-permission android:name="cydia.permission.SUBSTRATE"/>
+</manifest>
--- /dev/null
+#!/bin/bash
+
+set -e
+
+if [[ $# -eq 0 ]]; then
+ flags=(--dirty="+")
+else
+ flags=("$@")
+fi
+
+monotonic=$(git log -1 --pretty=format:%ct)
+version=$(git describe --tags --match="v*" "${flags[@]}" | sed -e 's@-\([^-]*\)-\([^-]*\)$@+\1.\2@;s@^v@@;s@%@~@g')
+
+exec sed -e "
+ s/\${monotonic}/${monotonic}/g;
+ s/\${version}/${version}/g;
+" AndroidManifest.xml.in >AndroidManifest.xml