Skip to content
Snippets Groups Projects
Commit bcb91d87 authored by Lennart Goedhart's avatar Lennart Goedhart
Browse files

More grade release automation work for #15

parent 6adea8b9
No related branches found
No related tags found
No related merge requests found
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id=":app" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="640gAndroidUploader" external.system.module.version="0.2.0" type="JAVA_MODULE" version="4">
<module external.linked.project.id=":app" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="640gAndroidUploader" external.system.module.version="0.2.1" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android-gradle" name="Android-Gradle">
<configuration>
......@@ -106,6 +106,8 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/transforms" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/reports" />
<excludeFolder url="file://$MODULE_DIR$/build/test-results" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android API 21 Platform" jdkType="Android SDK" />
......
......@@ -4,14 +4,25 @@ plugins {
apply plugin: 'com.android.application'
def gitVersion() {
def process = ['sh', '-c', 'git tag -l | grep -c ".*" -'].execute().text.trim()
return process.toInteger() + 1
}
android {
compileSdkVersion 21
buildToolsVersion "23.0.3"
applicationVariants.all { variant ->
variant.resValue "string", "versionName", variant.versionName
}
defaultConfig {
applicationId "info.nightscout.android"
minSdkVersion 15
targetSdkVersion 21
versionName project.properties['version']
versionCode gitVersion()
}
buildTypes {
......@@ -28,8 +39,59 @@ android {
}
}
task signRelease << {
def command = [
'jarsigner',
'-verbose',
'-sigalg',
'SHA1withRSA',
'-digestalg',
'SHA1',
'-keystore',
'/Users/lgoedhart/keystores/nightscout_android.jks',
'app/build/outputs/apk/app-release-unsigned.apk',
'nightscoutandroidkey'
]
def proc = new ProcessBuilder(command)
.redirectOutput(ProcessBuilder.Redirect.INHERIT)
.redirectInput(ProcessBuilder.Redirect.INHERIT)
.redirectError(ProcessBuilder.Redirect.INHERIT)
.start()
proc.waitFor()
if (0 != proc.exitValue()) {
throw new RuntimeException("Could not sign APK.")
}
}
task zipalignRelease << {
def command = [
'/Users/lgoedhart/Library/Android/sdk/build-tools/23.0.3/zipalign',
'-v',
'4',
'app/build/outputs/apk/app-release-unsigned.apk',
'app/build/outputs/apk/640g-android-uploader.apk'
]
def proc = new ProcessBuilder(command)
.redirectOutput(ProcessBuilder.Redirect.INHERIT)
.redirectInput(ProcessBuilder.Redirect.INHERIT)
.redirectError(ProcessBuilder.Redirect.INHERIT)
.start()
proc.waitFor()
if (0 != proc.exitValue()) {
throw new RuntimeException("Could not align APK.")
}
}
release {
tagTemplate = 'v${version}'
buildTasks = ['assembleRelease']
afterReleaseBuild.dependsOn 'signRelease', 'zipalignRelease'
}
dependencies {
......
version=0.2.1
\ No newline at end of file
version=0.2.0-SNAPSHOT
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="info.nightscout.android"
android:versionCode="1"
android:versionName="@string/version" >
>
<uses-sdk
android:maxSdkVersion="21"
......
......@@ -13,7 +13,6 @@
<string name="eula_title">Disclaimer</string>
<string name="eula_accept">Accept</string>
<string name="eula_refuse">Refuse</string>
<string name="version">0.2.0</string>
<style name="ButtonText">
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">wrap_content</item>
......
......@@ -59,7 +59,7 @@
<PreferenceCategory android:title="App Version">
<Preference
android:key="version"
android:title="@string/version" />
android:title="@string/versionName" />
</PreferenceCategory>
<PreferenceCategory android:title="Debug">
<ListPreference
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment