diff --git a/app/build.gradle b/app/build.gradle index 650647d73..fabc2e82a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -3,6 +3,15 @@ apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' +def getGitSha = { -> + def stdout = new ByteArrayOutputStream() + exec { + commandLine 'git', 'rev-parse', '--short' , 'HEAD' + standardOutput = stdout + } + return stdout.toString().trim() +} + android { compileSdkVersion 27 buildToolsVersion '27.0.3' @@ -21,8 +30,15 @@ android { shrinkResources true proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } - debug { + debug { } + } + + flavorDimensions "color" + productFlavors { + blue { } + green { applicationIdSuffix ".test" + versionNameSuffix "-"+getGitSha() } } diff --git a/app/src/release/res/drawable/ic_launcher_background.xml b/app/src/blue/res/drawable/ic_launcher_background.xml similarity index 100% rename from app/src/release/res/drawable/ic_launcher_background.xml rename to app/src/blue/res/drawable/ic_launcher_background.xml diff --git a/app/src/release/res/mipmap-hdpi/ic_launcher.png b/app/src/blue/res/mipmap-hdpi/ic_launcher.png similarity index 100% rename from app/src/release/res/mipmap-hdpi/ic_launcher.png rename to app/src/blue/res/mipmap-hdpi/ic_launcher.png diff --git a/app/src/release/res/mipmap-mdpi/ic_launcher.png b/app/src/blue/res/mipmap-mdpi/ic_launcher.png similarity index 100% rename from app/src/release/res/mipmap-mdpi/ic_launcher.png rename to app/src/blue/res/mipmap-mdpi/ic_launcher.png diff --git a/app/src/release/res/mipmap-xhdpi/ic_launcher.png b/app/src/blue/res/mipmap-xhdpi/ic_launcher.png similarity index 100% rename from app/src/release/res/mipmap-xhdpi/ic_launcher.png rename to app/src/blue/res/mipmap-xhdpi/ic_launcher.png diff --git a/app/src/release/res/mipmap-xxhdpi/ic_launcher.png b/app/src/blue/res/mipmap-xxhdpi/ic_launcher.png similarity index 100% rename from app/src/release/res/mipmap-xxhdpi/ic_launcher.png rename to app/src/blue/res/mipmap-xxhdpi/ic_launcher.png diff --git a/app/src/release/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/blue/res/mipmap-xxxhdpi/ic_launcher.png similarity index 100% rename from app/src/release/res/mipmap-xxxhdpi/ic_launcher.png rename to app/src/blue/res/mipmap-xxxhdpi/ic_launcher.png diff --git a/app/src/debug/res/drawable/ic_launcher_background.xml b/app/src/green/res/drawable/ic_launcher_background.xml similarity index 100% rename from app/src/debug/res/drawable/ic_launcher_background.xml rename to app/src/green/res/drawable/ic_launcher_background.xml diff --git a/app/src/debug/res/mipmap-hdpi/ic_launcher.png b/app/src/green/res/mipmap-hdpi/ic_launcher.png similarity index 100% rename from app/src/debug/res/mipmap-hdpi/ic_launcher.png rename to app/src/green/res/mipmap-hdpi/ic_launcher.png diff --git a/app/src/debug/res/mipmap-mdpi/ic_launcher.png b/app/src/green/res/mipmap-mdpi/ic_launcher.png similarity index 100% rename from app/src/debug/res/mipmap-mdpi/ic_launcher.png rename to app/src/green/res/mipmap-mdpi/ic_launcher.png diff --git a/app/src/debug/res/mipmap-xhdpi/ic_launcher.png b/app/src/green/res/mipmap-xhdpi/ic_launcher.png similarity index 100% rename from app/src/debug/res/mipmap-xhdpi/ic_launcher.png rename to app/src/green/res/mipmap-xhdpi/ic_launcher.png diff --git a/app/src/debug/res/mipmap-xxhdpi/ic_launcher.png b/app/src/green/res/mipmap-xxhdpi/ic_launcher.png similarity index 100% rename from app/src/debug/res/mipmap-xxhdpi/ic_launcher.png rename to app/src/green/res/mipmap-xxhdpi/ic_launcher.png diff --git a/app/src/debug/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/green/res/mipmap-xxxhdpi/ic_launcher.png similarity index 100% rename from app/src/debug/res/mipmap-xxxhdpi/ic_launcher.png rename to app/src/green/res/mipmap-xxxhdpi/ic_launcher.png