Jeff Gaston | 8fd9fc8 | 2019-07-26 14:26:10 -0400 | [diff] [blame] | 1 | /* |
Jeff Gaston | 427c4f9 | 2020-01-28 15:24:59 -0500 | [diff] [blame] | 2 | * Copyright 2018 The Android Open Source Project |
Jeff Gaston | 8fd9fc8 | 2019-07-26 14:26:10 -0400 | [diff] [blame] | 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Tiem Song | 20b6936 | 2022-01-25 22:22:52 -0800 | [diff] [blame] | 17 | import androidx.build.ExportAtomicLibraryGroupsToTextTask |
Owen Gray | 74cc259 | 2020-09-24 15:05:40 -0400 | [diff] [blame] | 18 | import androidx.build.LibraryType |
Jeff Gaston | 8fd9fc8 | 2019-07-26 14:26:10 -0400 | [diff] [blame] | 19 | |
| 20 | plugins { |
| 21 | id("AndroidXPlugin") |
| 22 | id("kotlin") |
| 23 | } |
| 24 | |
Alan Viverette | e268c4c | 2021-02-23 18:12:09 -0500 | [diff] [blame] | 25 | sourceSets { |
| 26 | // Pull integration test source code in for use by lint testing framework. |
| 27 | test.resources.srcDirs( |
| 28 | project(":lint-checks:integration-tests") |
| 29 | .projectDir.absolutePath + "/src/main" |
| 30 | ) |
| 31 | } |
| 32 | |
Jeff Gaston | 8fd9fc8 | 2019-07-26 14:26:10 -0400 | [diff] [blame] | 33 | dependencies { |
Aurimas Liutikas | 0044296 | 2021-06-01 17:18:09 -0700 | [diff] [blame] | 34 | compileOnly(libs.androidLintApi) |
Aurimas Liutikas | b3483fd | 2021-06-04 16:56:37 -0700 | [diff] [blame] | 35 | compileOnly(libs.androidLintChecks) |
Aurimas Liutikas | 0044296 | 2021-06-01 17:18:09 -0700 | [diff] [blame] | 36 | compileOnly(libs.kotlinStdlib) |
Jeff Gaston | 427c4f9 | 2020-01-28 15:24:59 -0500 | [diff] [blame] | 37 | |
Aurimas Liutikas | 0044296 | 2021-06-01 17:18:09 -0700 | [diff] [blame] | 38 | testImplementation(libs.kotlinStdlib) |
| 39 | testImplementation(libs.androidLint) |
| 40 | testImplementation(libs.androidLintTests) |
| 41 | testImplementation(libs.junit) |
Jeff Gaston | 8fd9fc8 | 2019-07-26 14:26:10 -0400 | [diff] [blame] | 42 | } |
| 43 | |
| 44 | androidx { |
Jeff Gaston | 427c4f9 | 2020-01-28 15:24:59 -0500 | [diff] [blame] | 45 | name = "Lint checks" |
Owen Gray | 74cc259 | 2020-09-24 15:05:40 -0400 | [diff] [blame] | 46 | type = LibraryType.LINT |
Jeff Gaston | 427c4f9 | 2020-01-28 15:24:59 -0500 | [diff] [blame] | 47 | inceptionYear = "2018" |
| 48 | description = "Internal lint checks" |
Jeff Gaston | 8fd9fc8 | 2019-07-26 14:26:10 -0400 | [diff] [blame] | 49 | } |
Tiem Song | 20b6936 | 2022-01-25 22:22:52 -0800 | [diff] [blame] | 50 | |
| 51 | def exportTaskProvider = tasks.register( |
| 52 | "exportAtomicLibraryGroupsToText", |
| 53 | ExportAtomicLibraryGroupsToTextTask |
| 54 | ) { task -> |
Jeff Gaston | 0a35d65 | 2022-12-06 12:38:00 -0500 | [diff] [blame] | 55 | task.libraryGroups = androidx.AllLibraryGroups |
Tiem Song | 20b6936 | 2022-01-25 22:22:52 -0800 | [diff] [blame] | 56 | |
| 57 | def generatedDirectory = new File(project.buildDir, "generated/resources") |
| 58 | task.outputDir.set(generatedDirectory) |
| 59 | } |
| 60 | |
| 61 | def extension = project.extensions.getByType(JavaPluginExtension.class) |
| 62 | def mainSources = extension.sourceSets.getByName("main") |
| 63 | mainSources.getOutput().dir(exportTaskProvider.flatMap { it.outputDir }) |