/* * Copyright (C) 2017. Uber Technologies * * 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. */ plugins { id('com.android.application') } android { compileSdkVersion Integer.parseInt(libs.versions.compile.sdk.get()) namespace "com.uber.myapplication" defaultConfig { applicationId "com.uber.myapplication" minSdkVersion Integer.parseInt(libs.versions.min.sdk.get()) targetSdkVersion Integer.parseInt(libs.versions.target.sdk.get()) versionCode 1 versionName "1.0" } // This avoids a build-time warning when compiling using JDK 24+. JDK 8 is the default target for // Android applications, but support for targeting JDK 8 is deprecated in JDK 24+. compileOptions { sourceCompatibility JavaVersion.VERSION_17 targetCompatibility JavaVersion.VERSION_17 } lint { abortOnError = false } } dependencies { implementation libs.appcompat annotationProcessor libs.error.prone.core annotationProcessor project(":nullaway") annotationProcessor project(path: ":sample-library-model") testImplementation libs.junit4 } // Configure Java compilation for all Android JavaCompile tasks (AGP 8+ compatible) tasks.withType(JavaCompile).configureEach { options.compilerArgs += [ "-XDcompilePolicy=simple", "--should-stop=ifError=FLOW", "-Xplugin:ErrorProne -XepOpt:NullAway:AnnotatedPackages=com.uber", ] options.fork = true options.forkOptions.jvmArgs = [ "--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED", "--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED", "--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED", "--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED", "--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED", "--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED", "--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED", "--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED", "--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED", "--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED" ] } spotless { java { target 'src/*/java/**/*.java' } }