Created
July 28, 2019 06:49
-
-
Save Slowhand0309/bc5ce0fc1e08b326649f58bd451ef026 to your computer and use it in GitHub Desktop.
[Gradle Tips] #Android #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 characters
// buildTypesに応じたgoogle-services.jsonをapp/.へコピー | |
gradle.taskGraph.beforeTask { Task task -> | |
if (task.name ==~ /process.*GoogleServices/) { | |
applicationVariants.all { variant -> | |
if (task.name ==~ /(?i)process${variant.name}GoogleServices/) { | |
copy { | |
from "src/${variant.name}" | |
into "." | |
include "google-services.json" | |
} | |
} | |
} | |
} | |
} |
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 characters
dependencies { | |
// Debug | |
[ | |
"hyperion-core", | |
"hyperion-attr", | |
"hyperion-measurement", | |
"hyperion-disk", | |
"hyperion-crash", | |
"hyperion-shared-preferences" | |
].forEach { | |
debugImplementation("com.willowtreeapps.hyperion:$it:0.9.27") { | |
exclude group: 'com.android.support' | |
} | |
} | |
} |
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 characters
configurations { | |
ktlint | |
} | |
dependencies { | |
ktlint "com.github.shyiko:ktlint:0.29.0" | |
} | |
task ktlint(type: JavaExec, group: "verification") { | |
description = "Check Kotlin code style." | |
classpath = configurations.ktlint | |
main = "com.github.shyiko.ktlint.Main" | |
args "--android", "--color", "--reporter=plain", "--reporter=checkstyle,output=${buildDir}/reports/ktlint-results.xml", "src/**/*.kt" | |
ignoreExitValue true | |
} | |
check.dependsOn ktlint |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment