Skip to content

Commit

Permalink
Fixed build version handling from Gradle so now it's actually a strin…
Browse files Browse the repository at this point in the history
…g instead of a double
  • Loading branch information
Github committed May 7, 2017
1 parent f3b64cc commit c0e1ed2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ android {
applicationId "eu.aero2x.andromedab"
minSdkVersion 19
targetSdkVersion 25
versionCode 2
versionName "1.2.1"
versionCode 4
versionName "1.2.0.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
buildConfigField "double", "MIN_SERVER_VERSION", "1.2"
buildConfigField "String", "MIN_SERVER_VERSION", '"1.2.0"'
}
debug{
buildConfigField "double", "MIN_SERVER_VERSION", "1.2"
buildConfigField "String", "MIN_SERVER_VERSION", '"1.2.0"'
}

}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/eu/aero2x/andromedab/ContactSelect.java
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ public void onResponse(String response) {


//Check if our server version is below the app's required
if (serverVersion.compareTo(new Version("" + BuildConfig.MIN_SERVER_VERSION)) < 0) {
if (serverVersion.compareTo(new Version(BuildConfig.MIN_SERVER_VERSION)) < 0) {
AlertDialog alertDialog = new AlertDialog.Builder(ContactSelect.this).create();
alertDialog.setTitle("Server version too old");
alertDialog.setMessage("Your server is running version " + serverVersion.get() + " but the BUILDCONFIG for the application demands that you be running at least " + BuildConfig.MIN_SERVER_VERSION + "\n\nYou can continue to use the application however behavior is entirely undocumented.");
Expand Down

0 comments on commit c0e1ed2

Please sign in to comment.