-
-
Save gianpaolof/fc62abd365be874b73e0740bb2728dd2 to your computer and use it in GitHub Desktop.
Revisions
-
olivierperez revised this gist
Nov 29, 2016 . 2 changed files with 9 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,4 +10,5 @@ Useful tricks for Android gradle files - isIdeBuild - nice buildConfigField - private signing certificate - specify the file name of production release - tests shown in console This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ testOptions.unitTests.all { testLogging { events 'passed', 'skipped', 'failed', 'standardOut', 'standardError' outputs.upToDateWhen { false } showStandardStreams = true } } -
olivierperez revised this gist
Nov 18, 2016 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,8 @@ signingConfigs { release { storeFile file(System.env.MYAPP_PRIVATE_KEY) keyAlias System.env.MYAPP_ALIAS storePassword System.env.MYAPP_STORE_PASSWORD keyPassword System.env.MYAPP_PASSWORD } } -
olivierperez revised this gist
Oct 13, 2016 . 4 changed files with 13 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,5 +9,5 @@ Useful tricks for Android gradle files - git sha - isIdeBuild - nice buildConfigField - private signing certificate - specify the file name of production release This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,7 @@ // .gitignore /app/src/prod/res-gen // file: app/build.gradle apply from: '../forceRU.gradle' This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,5 @@ def MAJOR_VERSION = 1 def MINOR_VERSION = 0 def gitCount() { def cmd = 'git rev-list --count HEAD' @@ -8,12 +9,12 @@ def gitCount() { android { productFlavors { dev { versionCode MAJOR_VERSION * 100000 + MINOR_VERSION * 1000 // and/or buildConfigField "String", "GIT_COUNT", "\"\"" } prod { versionCode MAJOR_VERSION * 100000 + MINOR_VERSION * 1000 + getCount() // and/or buildConfigField "String", "GIT_COUNT", "\"${gitCount()}\"" // Example: Crashlytics.setString("Git Count", BuildConfig.GIT_COUNT); This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,19 +3,20 @@ buildTypes { def ENABLE_LOGS = "ENABLE_LOGS" def BOOLEAN = "boolean" def TRUE = "true" def FALSE = "false" release { buildConfigField BOOLEAN, ENABLE_LOGS, FALSE } releaseWithLogs { buildConfigField BOOLEAN, ENABLE_LOGS, TRUE } debug { buildConfigField BOOLEAN, ENABLE_LOGS, TRUE } } -
olivierperez revised this gist
Oct 10, 2016 . 2 changed files with 20 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,6 +4,7 @@ Useful tricks for Android gradle files - ci_job - dependencies - force a lang for a specific flavor - gcm flavorish google-services.json - git commit count - git sha - isIdeBuild This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ // Put google-services.json in your flavors directories // Then Git-ignore "app/google-services.json" gradle.taskGraph.beforeTask { Task task -> if (task.name ==~ /process.*GoogleServices/) { android.applicationVariants.all { variant -> if (task.name ==~ /(?i)process${variant.name}GoogleServices/) { def envFlavor = variant.productFlavors.get(0).name copy { from "./src/${envFlavor}" into '.' include 'google-services.json' } } } } } -
olivierperez revised this gist
Oct 4, 2016 . 1 changed file with 12 additions and 10 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,13 +1,15 @@ buildTypes { applicationVariants.all { variant -> variant.outputs.each { output -> if (variant.productFlavors[0].name.equals("prod")) { output.outputFile = new File( output.outputFile.parent, output.outputFile.name.replace( "app-prod-regular-release-unsigned", "monApp-prod-unsigned-" + versionName + "-" + versionCode ) ); } } } } -
olivierperez revised this gist
Oct 4, 2016 . 2 changed files with 15 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,4 +8,5 @@ Useful tricks for Android gradle files - git sha - isIdeBuild - nice buildConfigField - nrivate signing certificate - specify the file name of production release This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ applicationVariants.all { variant -> variant.outputs.each { output -> if (variant.productFlavors[0].name.equals("prod")) { output.outputFile = new File( output.outputFile.parent, output.outputFile.name.replace( "app-prod-regular-release-unsigned", "monApp-prod-unsigned-" + versionName + "-" + versionCode ) ); } } } -
olivierperez revised this gist
Oct 4, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,8 +4,8 @@ Useful tricks for Android gradle files - ci_job - dependencies - force a lang for a specific flavor - git commit count - git sha - isIdeBuild - nice buildConfigField - nrivate signing certificate -
olivierperez revised this gist
Sep 23, 2016 . 2 changed files with 9 additions and 9 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,16 +6,16 @@ def gitCount() { } android { productFlavors { dev { versionName VERSION_NAME // and/or buildConfigField "String", "GIT_COUNT", "\"\"" } prod { versionName "$VERSION_NAME-${gitCount()}" // and/or buildConfigField "String", "GIT_COUNT", "\"${gitCount()}\"" // Example: Crashlytics.setString("Git Count", BuildConfig.GIT_COUNT); } } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,14 +7,14 @@ def gitSha() { } android { productFlavors { dev { versionName VERSION_NAME // and/or buildConfigField "String", "GIT_SHA", "\"\"" } prod { versionName "$VERSION_NAME-${gitSha()}" // and/or buildConfigField "String", "GIT_SHA", "\"${gitSha()}\"" // Example: Crashlytics.setString("Git SHA", BuildConfig.GIT_SHA); -
olivierperez revised this gist
Sep 23, 2016 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,9 @@ def VERSION_NAME = "1.0" def gitSha() { // def cmd = 'git log -1 --format="%h"' def cmd = 'git rev-parse --short HEAD' cmd.execute().text.trim() } android { @@ -14,9 +14,9 @@ android { buildConfigField "String", "GIT_SHA", "\"\"" } debug { versionName VERSION_NAME + "-" + gitSha() // and/or buildConfigField "String", "GIT_SHA", "\"${gitSha()}\"" // Example: Crashlytics.setString("Git SHA", BuildConfig.GIT_SHA); } } -
olivierperez revised this gist
Sep 23, 2016 . 4 changed files with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes.File renamed without changes.File renamed without changes.File renamed without changes. -
olivierperez revised this gist
Sep 23, 2016 . 1 changed file with 7 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,11 +1,11 @@ Useful tricks for Android gradle files - build time - ci_job - dependencies - force a lang for a specific flavor - git sha - git commit count - isIdeBuild - nice buildConfigField - nrivate signing certificate -
olivierperez revised this gist
Sep 23, 2016 . 3 changed files with 24 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,8 @@ Useful tricks for Android gradle files - Build time - git sha - git commit count - Force a lang for a specific flavor - Nice buildConfigField - Private signing certificate This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ def VERSION_NAME = "1.0" def gitCount() { def cmd = 'git rev-list --count HEAD' cmd.execute().text.trim().toInteger() } android { buildTypes { release { versionName VERSION_NAME // and/or buildConfigField "String", "GIT_COUNT", "\"\"" } debug { versionName VERSION_NAME + "-" + gitCount()() // and/or buildConfigField "String", "GIT_COUNT", "\"${gitCount()()}\"" // Example: Crashlytics.setString("Git Count", BuildConfig.GIT_COUNT); } } } File renamed without changes. -
olivierperez revised this gist
Sep 19, 2016 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,8 +3,8 @@ Useful tricks for Android gradle files - Build time - Find git version - Force a lang for a specific flavor - Nice buildConfigField - Private signing certificate - ci_job - dependencies - isIdeBuild -
olivierperez revised this gist
Sep 19, 2016 . 2 changed files with 31 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1 +1,10 @@ Useful tricks for Android gradle files - Build time - Find git version - Force a lang for a specific flavor - Private signing certificate - ci_job - dependencies - isIdeBuild - Nice buildConfigField This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ buildTypes { def ENABLE_LOGS = "ENABLE_LOGS" def TRUE = "true" def FALSE = "false" release { buildConfigField "boolean", ENABLE_LOGS, FALSE } releaseWithLogs { buildConfigField "boolean", ENABLE_LOGS, TRUE } debug { buildConfigField "boolean", ENABLE_LOGS, TRUE } } -
olivierperez revised this gist
Sep 15, 2016 . 2 changed files with 46 additions and 38 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,46 @@ // file: app/build.gradle apply from: '../forceRU.gradle' android { sourceSets { prod { res.srcDirs += ['src/prod/res-gen'] } } } // file: forceRU.gradle project.afterEvaluate { android { applicationVariants.all { variant -> logger.trace("variant.name: ${variant.name}") logger.trace("variant.productFlavors[0].name: ${variant.productFlavors[0].name}") // Force RU values only for prod flavor if ("prod".equals(variant.productFlavors[0].name)) { def forceRU = task("forceRU${variant.name.capitalize()}") variant.mergeResources.dependsOn forceRU forceRU << { logger.info("Forcing strings to RU...") File valuesRU = file("src/main/res/values-ru") if (valuesRU.isDirectory() && valuesRU.list().length > 0) { logger.debug("Directory \"" + valuesRU.path + "\" exists") copy { from "src/main/res/values-ru/" into 'src/prod/res-gen/values/' include '*' } } else { throw new RuntimeException("\"" + valuesRU.path + "\" is not a drectory or is empty.") } } } } } } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,38 +0,0 @@ -
olivierperez revised this gist
Sep 14, 2016 . 1 changed file with 38 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,38 @@ // file: app/build.gradle apply from: '../forceRU.gradle' // file: forceRU.gradle project.afterEvaluate { android { applicationVariants.all { variant -> // println("variant.name: ${variant.name}") // println("variant.productFlavors[0].name: ${variant.productFlavors[0].name}") // Force RU strings only for prod flavor if ("prod".equals(variant.productFlavors[0].name)) { def forceRU = task("forceRU${variant.name}") variant.mergeResources.dependsOn forceRU forceRU << { println("Forcing strings to RU...") File stringsRU = file("src/main/res/values-ru/strings.xml") if (stringsRU.exists()) { println("File: " + stringsRU.path + " exists") copy { from "src/main/res/values-ru/" into 'src/prod/res/values/' include '*' } } else { throw new RuntimeException("File: " + stringsRU.path + " does not exist") } } } } } } -
olivierperez revised this gist
Sep 14, 2016 . 2 changed files with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -15,6 +15,7 @@ android { versionName VERSION_NAME + "-" + buildTime() // and/or buildConfigField "String", "BUILD_TIME", "\"${buildTime()}\"" // Example: Crashlytics.setString("Build time", BuildConfig.BUILD_TIME); } } } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -17,6 +17,7 @@ android { versionName VERSION_NAME + "-" + gitVersion() // and/or buildConfigField "String", "GIT_SHA", "\"${gitVersion()}\"" // Example: Crashlytics.setString("Git SHA", BuildConfig.GIT_SHA); } } } -
olivierperez revised this gist
Sep 14, 2016 . 2 changed files with 4 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ def VERSION_NAME = "1.0" def buildTime() { new Date().format("yyyy-MM-dd'T'HH:mm:ss'Z'", TimeZone.getTimeZone("UTC") } android { This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,9 @@ def VERSION_NAME = "1.0" def gitVersion() { // def cmd = 'git log -1 --format="%h"' def cmd = 'git rev-parse --short HEAD' cmd.execute().text.trim().toInteger() } android { -
olivierperez revised this gist
Sep 14, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ def VERSION_NAME = "1.0" def gitVersion() { def cmd = 'git log -1 --format="%h"' cmd.execute().text.trim().toInteger() } -
olivierperez revised this gist
Sep 14, 2016 . 1 changed file with 20 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ def VERSION_NAME = "1.0" def buildTime() { new Date().format("yyyy-MM-dd'T'HH:mm:ss'Z'", TimeZone.getTimeZone("UTC") } android { buildTypes { release { versionName VERSION_NAME // and/or buildConfigField "String", "BUILD_TIME", "\"\"" } debug { versionName VERSION_NAME + "-" + buildTime() // and/or buildConfigField "String", "BUILD_TIME", "\"${buildTime()}\"" } } } -
olivierperez revised this gist
Sep 14, 2016 . No changes.There are no files selected for viewing
-
olivierperez revised this gist
Sep 14, 2016 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,9 +9,13 @@ android { buildTypes { release { versionName VERSION_NAME // and/or buildConfigField "String", "GIT_SHA", "\"\"" } debug { versionName VERSION_NAME + "-" + gitVersion() // and/or buildConfigField "String", "GIT_SHA", "\"${gitVersion()}\"" } } } -
olivierperez revised this gist
Sep 14, 2016 . 1 changed file with 17 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ def VERSION_NAME = "1.0" def gitVersion() { def cmd = 'git rev-list HEAD --first-parent --count' cmd.execute().text.trim().toInteger() } android { buildTypes { release { versionName VERSION_NAME } debug { versionName VERSION_NAME + "-" + gitVersion() } } } -
olivierperez revised this gist
Sep 14, 2016 . 1 changed file with 8 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ signingConfigs { release { storeFile "${System.env.MYAPP_PRIVATE_KEY}" keyAlias "${System.env.MYAPP_ALIAS}" storePassword "${System.env.MYAPP_STORE_PASSWORD}" keyPassword "${System.env.MYAPP_PASSWORD}" } } -
olivierperez revised this gist
Sep 14, 2016 . 2 changed files with 2 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,6 @@ ext.versions = [ // etc... ] ext.deps = [ // Dependency injection dagger : "com.google.dagger:dagger:${versions.dagger}", @@ -15,10 +14,8 @@ ext.deps = [ rxAndroid : "io.reactivex:rxandroid:${versions.rxAndroid}", rxJava : "io.reactivex:rxjava:${versions.rxJava}", rxJavaProguard : "com.artemzin.rxjava:proguard-rules:${versions.rxJava}.0", ] dependencies { // Dependency injection compile deps.dagger This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,11 +1,11 @@ // Trick 1 allprojects { ext { isCIBuild = System.getenv('BUILD_ID') } } // Trick 2 allprojects { ext { isIdeBuild = project.properties['android.injected.invoked.from.ide'] == 'true' -
olivierperez revised this gist
Sep 14, 2016 . 1 changed file with 31 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ ext.versions = [ dagger : '2.7', rxAndroid : '1.2.1', rxJava : '1.1.6', // etc... ] ext.deps = [ // Dependency injection dagger : "com.google.dagger:dagger:${versions.dagger}", daggerCompiler : "com.google.dagger:dagger-compiler:${versions.dagger}", // RxJava rxAndroid : "io.reactivex:rxandroid:${versions.rxAndroid}", rxJava : "io.reactivex:rxjava:${versions.rxJava}", rxJavaProguard : "com.artemzin.rxjava:proguard-rules:${versions.rxJava}.0", ] dependencies { // Dependency injection compile deps.dagger apt deps.daggerCompiler // RxJava compile deps.rxAndroid compile deps.rxJava compile deps.rxJavaProguard } -
olivierperez revised this gist
Sep 14, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1 +1 @@ Useful tricks for Android gradle files -
olivierperez created this gist
Sep 14, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ Android - Gradle tricks This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,46 @@ task ci_job { group = 'ci' } if (project.hasProperty('buildVariant') && !project.property('buildVariant').isEmpty()) { def checkVariant = '[RegularRelease]' def testVariant = '[MockDebug]' project.afterEvaluate { /* Assemble */ def assemble = tasks["assemble${buildVariant}"] assemble.mustRunAfter clean /* Unit test */ def unitTests = project.tasks["test${testVariant}UnitTest"] unitTests.mustRunAfter assemble unitTests.onlyIf { !project.hasProperty('skipUnitTest') || project.property('skipUnitTest') != 'true' } /* Quality */ task quality quality.dependsOn project.tasks["lint${checkVariant}"] quality.dependsOn project.tasks["findbugs${checkVariant}"] quality.dependsOn project.tasks["checkstyle"] quality.onlyIf { !project.hasProperty('skipQuality') || project.property('skipQuality') != 'true' } /* Execute all */ ci_job.dependsOn clean ci_job.dependsOn assemble ci_job.dependsOn unitTests ci_job.dependsOn quality } } else { ci_job << { println "Nothing to do, buildVariant is not wel defined" } } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ // V1 allprojects { ext { isCIBuild = System.getenv('BUILD_ID') } } // V2 allprojects { ext { isIdeBuild = project.properties['android.injected.invoked.from.ide'] == 'true' } }