diff --git a/.travis.yml b/.travis.yml index ba52ba244d..ef3279222c 100755 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ android: components: - tools - platform-tools - - build-tools-28.0.2 + - build-tools-28.0.3 - android-28 before_install: diff --git a/build.gradle b/build.gradle index fed2cfaa62..184953350a 100644 --- a/build.gradle +++ b/build.gradle @@ -18,10 +18,10 @@ import net.ltgt.gradle.errorprone.CheckSeverity plugins { id "com.github.sherter.google-java-format" version "0.8" - id "net.ltgt.errorprone" version "0.6" apply false + id "net.ltgt.errorprone" version "0.7" apply false id "com.github.johnrengelman.shadow" version "2.0.4" apply false id 'com.github.kt3k.coveralls' version '2.6.3' apply false - id 'com.android.application' version '3.1.4' apply false + id 'com.android.application' version '3.3.1' apply false } repositories { diff --git a/gradle/dependencies.gradle b/gradle/dependencies.gradle index ae1b0177b3..8a6a63c8f5 100755 --- a/gradle/dependencies.gradle +++ b/gradle/dependencies.gradle @@ -37,7 +37,6 @@ def build = [ errorProneTestHelpers : "com.google.errorprone:error_prone_test_helpers:${versions.errorProne}", checkerDataflow : ["org.checkerframework:dataflow:${versions.checkerFramework}", "org.checkerframework:javacutil:${versions.checkerFramework}"], - gradleErrorPronePlugin : "net.ltgt.gradle:gradle-errorprone-plugin:0.0.16", guava : "com.google.guava:guava:22.0", javaxValidation : "javax.validation:validation-api:2.0.1.Final", jsr305Annotations : "com.google.code.findbugs:jsr305:3.0.2", @@ -48,7 +47,7 @@ def build = [ commonscli : "commons-cli:commons-cli:${versions.commonscli}", // android stuff - buildToolsVersion: "28.0.2", + buildToolsVersion: "28.0.3", compileSdkVersion: 28, ci: "true" == System.getenv("CI"), minSdkVersion: 16, diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 457aad0d98..5c2d1cf016 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e0b3fb8d70..51fb1c466d 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.3.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index cccdd3d517..93a3797226 100755 --- a/gradlew +++ b/gradlew @@ -1,4 +1,19 @@ #!/usr/bin/env sh +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ############################################################################## ## @@ -28,7 +43,7 @@ APP_NAME="Gradle" APP_BASE_NAME=`basename "$0"` # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" diff --git a/gradlew.bat b/gradlew.bat index e95643d6a2..15e1ee37a7 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,3 +1,19 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem http://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + @if "%DEBUG%" == "" @echo off @rem ########################################################################## @rem @@ -14,7 +30,7 @@ set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome diff --git a/sample-app/build.gradle b/sample-app/build.gradle index f6ede10f98..5a7eabbd5d 100644 --- a/sample-app/build.gradle +++ b/sample-app/build.gradle @@ -14,6 +14,7 @@ * limitations under the License. */ +import com.android.build.gradle.api.BaseVariant import net.ltgt.gradle.errorprone.CheckSeverity plugins { @@ -39,6 +40,29 @@ android { lintOptions { abortOnError false } + + DomainObjectSet variants = getApplicationVariants() // or getLibraryVariants() in libraries + variants.addAll(getTestVariants()) + variants.addAll(getUnitTestVariants()) + variants.configureEach { variant -> + variant.getJavaCompileProvider().configure { + options.errorprone { + check("NullAway", CheckSeverity.ERROR) + option("NullAway:AnnotatedPackages", "com.uber") + } + } + } + + // If you want to disable NullAway in justs tests, you can do the below +// DomainObjectSet testVariants = getTestVariants() +// testVariants.addAll(getUnitTestVariants()) +// testVariants.configureEach { variant -> +// variant.getJavaCompileProvider().configure { +// options.errorprone { +// check("NullAway", CheckSeverity.OFF) +// } +// } +// } } dependencies { @@ -49,14 +73,3 @@ dependencies { testImplementation deps.test.junit4 } - -tasks.withType(JavaCompile) { - // remove the if condition if you want to run NullAway on test code - if (!name.toLowerCase().contains("test")) { - options.errorprone { - check("NullAway", CheckSeverity.ERROR) - option("NullAway:AnnotatedPackages", "com.uber") - } - } -} -