Skip to content

Commit

Permalink
Upgrade gradle to 3.1 and android-gradle-plugin to 2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
goober committed Sep 24, 2016
1 parent 19bd194 commit 0a0f189
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 31 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,4 @@ app/src/main/java/com/liato/bankdroid/db/Crypto.java.dev
dev/
app/release.keystore
app/crashlytics.properties
app/keystore.properties
31 changes: 7 additions & 24 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ repositories {
maven { url 'https://maven.fabric.io/public' }
}

def keystorePropertiesFile = project.file("keystore.properties")
def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))

android {
compileSdkVersion 24
Expand All @@ -34,10 +37,10 @@ android {

signingConfigs {
release {
storeFile file("release.keystore")
storePassword ""
keyAlias "andmrkt"
keyPassword ""
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
}
}

Expand All @@ -55,26 +58,6 @@ android {
disable 'InvalidPackage'
}

// Get signing keys for release
gradle.taskGraph.whenReady { taskGraph ->
if(taskGraph.hasTask(':app:assembleRelease')) {
if(System.console() != null) {
def keystorePassword = System.console().readPassword("\nEnter keystore password: ")
keystorePassword = new String(keystorePassword)
if(keystorePassword.isEmpty()) {
throw new InvalidUserDataException("You must enter a keystore password to proceed.")
}
def password = System.console().readPassword("Enter key password: ")
password = new String(password)
if(password.isEmpty()) {
throw new InvalidUserDataException("You must enter a password to proceed.")
}
android.signingConfigs.release.storePassword keystorePassword
android.signingConfigs.release.keyPassword password
}
}
}

buildTypes {
release {
minifyEnabled false
Expand Down
4 changes: 4 additions & 0 deletions app/keystore.properties.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
storePassword=
keyPassword=
keyAlias=andmrkt
storeFile=release.keystore
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.3'
classpath 'com.android.tools.build:gradle:2.2.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -19,5 +19,5 @@ allprojects {
}

task wrapper(type: Wrapper) {
gradleVersion = '2.14.1'
gradleVersion = '3.1'
}
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx10248m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# org.gradle.parallel=true
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Aug 31 22:48:54 CEST 2016
#Sat Sep 24 21:00:18 CEST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.1-bin.zip

0 comments on commit 0a0f189

Please sign in to comment.