aboutsummaryrefslogtreecommitdiff
path: root/build.gradle
diff options
context:
space:
mode:
Diffstat (limited to 'build.gradle')
-rw-r--r--build.gradle46
1 files changed, 38 insertions, 8 deletions
diff --git a/build.gradle b/build.gradle
index 5283f0e..36895c8 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,10 +1,11 @@
+// For android studio 2.3 and plugin 2.3.3
+
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
- classpath 'me.tatarka:gradle-retrolambda:3.5.0'
// NOTE: Do not place your application dependencies here.
}
@@ -19,7 +20,6 @@ repositories {
}
apply plugin: 'com.android.application'
-apply plugin: 'me.tatarka.retrolambda'
allprojects {
gradle.projectsEvaluated {
@@ -31,26 +31,30 @@ allprojects {
android {
compileSdkVersion 24
- buildToolsVersion '25.0.0'
defaultConfig {
applicationId "com.google.android.mobly.snippet.bundled"
- minSdkVersion 11
+ minSdkVersion 15
// Set target to 22 to avoid having to deal with runtime permissions.
targetSdkVersion 22
versionCode 1
versionName "0.0.1"
setProperty("archivesBaseName", "mobly-bundled-snippets")
+ jackOptions {
+ enabled true
+ }
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
lintOptions {
- abortOnError true
+ abortOnError false
checkAllWarnings true
warningsAsErrors true
+ disable 'HardwareIds','MissingApplicationIcon','GoogleAppIndexingWarning','InvalidPackage','OldTargetApi'
}
+ buildToolsVersion '26.0.2'
}
// Produces a jar of source files. Needed for compliance reasons.
@@ -72,13 +76,39 @@ artifacts {
dependencies {
compile 'com.android.support.test:runner:0.5'
compile 'com.google.android.mobly:mobly-snippet-lib:1.2.0'
- compile 'com.google.code.gson:gson:2.6.2'
- compile 'com.google.guava:guava:20.0'
+ compile 'com.google.code.gson:gson:2.8.2'
+ compile 'com.google.guava:guava:23.1-android'
+ compile 'com.google.errorprone:error_prone_annotations:2.1.1'
- testCompile 'com.google.truth:truth:0.32'
+ testCompile 'com.google.errorprone:error_prone_annotations:2.1.1'
+ testCompile 'com.google.guava:guava:23.1-android'
+ testCompile 'com.google.truth:truth:0.36'
testCompile 'junit:junit:4.12'
}
googleJavaFormat {
options style: 'AOSP'
}
+
+// Open lint's HTML report in your default browser or viewer.
+task openLintReport(type: Exec) {
+ def lint_report = "build/reports/lint-results.html"
+ def cmd = "cat"
+ def platform = System.getProperty('os.name').toLowerCase(Locale.ROOT)
+ if (platform.contains("linux")) {
+ cmd = "xdg-open"
+ } else if (platform.contains("mac os x")) {
+ cmd = "open"
+ } else if (platform.contains("windows")) {
+ cmd = "launch"
+ }
+ commandLine cmd, lint_report
+}
+
+task presubmit {
+ dependsOn { ['googleJavaFormat', 'lint', 'openLintReport'] }
+ doLast {
+ println "Fix any lint issues you see. When it looks good, submit the pull request."
+ }
+}
+