xref: /aosp_15_r20/external/volley/build.gradle (revision a494ed5db247d14ea5602de4a744bb4a531fd3a7)
1buildscript {
2    repositories {
3        gradlePluginPortal()
4        jcenter()
5        google()
6    }
7    dependencies {
8        classpath 'com.android.tools.build:gradle:3.2.1'
9        classpath 'gradle.plugin.com.github.sherter.google-java-format:google-java-format-gradle-plugin:0.6'
10        // NOTE: 0.7 or newer will require upgrading to a newer Android gradle plugin:
11        // https://github.com/tbroyer/gradle-errorprone-plugin/commit/65b1026ebeae1b7ed8c28578c7f6eea512c16bea
12        classpath 'net.ltgt.errorprone:net.ltgt.errorprone.gradle.plugin:0.6.1'
13    }
14}
15
16allprojects {
17    repositories {
18        jcenter()
19        google()
20    }
21}
22
23subprojects {
24    apply plugin: 'com.github.sherter.google-java-format'
25    apply plugin: 'net.ltgt.errorprone'
26
27    googleJavaFormat {
28        toolVersion = '1.5'
29        options style: 'AOSP'
30    }
31
32    apply plugin: 'com.android.library'
33
34    dependencies {
35        // NOTE: Updating ErrorProne introduces new checks that may cause the build to fail. Pin to a
36        // specific version to control these updates.
37        errorprone("com.google.errorprone:error_prone_core:2.3.2")
38        // ErrorProne requires a JDK 9 compiler, so pull one in as a dependency since we use Java 8:
39        // https://github.com/tbroyer/gradle-errorprone-plugin#jdk-8-support
40        errorproneJavac("com.google.errorprone:javac:9+181-r4173-1")
41    }
42
43    group = 'com.android.volley'
44    version = '1.2.1-SNAPSHOT'
45
46    android {
47        useLibrary 'org.apache.http.legacy'
48
49        compileSdkVersion 28
50        buildToolsVersion = '28.0.3'
51
52        defaultConfig {
53            minSdkVersion 8
54        }
55
56        compileOptions {
57            sourceCompatibility JavaVersion.VERSION_1_7
58            targetCompatibility JavaVersion.VERSION_1_7
59        }
60    }
61
62    tasks.withType(JavaCompile) {
63        options.errorprone {
64            check("ParameterComment", net.ltgt.gradle.errorprone.CheckSeverity.ERROR)
65        }
66        options.compilerArgs << "-Xlint:unchecked" << "-Werror"
67    }
68
69    if (it.name != 'testing') {
70        apply from: '../publish.gradle'
71    }
72}
73