[go: nahoru, domu]

blob: 3fccf78f79517139d3d68de5fcc3b6845ef0cd5d [file] [log] [blame]
Jeff Gaston8fd9fc82019-07-26 14:26:10 -04001/*
Jeff Gaston427c4f92020-01-28 15:24:59 -05002 * Copyright 2018 The Android Open Source Project
Jeff Gaston8fd9fc82019-07-26 14:26:10 -04003 *
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 Song20b69362022-01-25 22:22:52 -080017import androidx.build.ExportAtomicLibraryGroupsToTextTask
Owen Gray74cc2592020-09-24 15:05:40 -040018import androidx.build.LibraryType
Jeff Gaston8fd9fc82019-07-26 14:26:10 -040019
20plugins {
21 id("AndroidXPlugin")
22 id("kotlin")
23}
24
Alan Viverettee268c4c2021-02-23 18:12:09 -050025sourceSets {
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 Gaston8fd9fc82019-07-26 14:26:10 -040033dependencies {
Aurimas Liutikas00442962021-06-01 17:18:09 -070034 compileOnly(libs.androidLintApi)
Aurimas Liutikasb3483fd2021-06-04 16:56:37 -070035 compileOnly(libs.androidLintChecks)
Aurimas Liutikas00442962021-06-01 17:18:09 -070036 compileOnly(libs.kotlinStdlib)
Jeff Gaston427c4f92020-01-28 15:24:59 -050037
Aurimas Liutikas00442962021-06-01 17:18:09 -070038 testImplementation(libs.kotlinStdlib)
39 testImplementation(libs.androidLint)
40 testImplementation(libs.androidLintTests)
41 testImplementation(libs.junit)
Jeff Gaston8fd9fc82019-07-26 14:26:10 -040042}
43
44androidx {
Jeff Gaston427c4f92020-01-28 15:24:59 -050045 name = "Lint checks"
Owen Gray74cc2592020-09-24 15:05:40 -040046 type = LibraryType.LINT
Jeff Gaston427c4f92020-01-28 15:24:59 -050047 inceptionYear = "2018"
48 description = "Internal lint checks"
Jeff Gaston8fd9fc82019-07-26 14:26:10 -040049}
Tiem Song20b69362022-01-25 22:22:52 -080050
51def exportTaskProvider = tasks.register(
52 "exportAtomicLibraryGroupsToText",
53 ExportAtomicLibraryGroupsToTextTask
54) { task ->
Jeff Gaston0a35d652022-12-06 12:38:00 -050055 task.libraryGroups = androidx.AllLibraryGroups
Tiem Song20b69362022-01-25 22:22:52 -080056
57 def generatedDirectory = new File(project.buildDir, "generated/resources")
58 task.outputDir.set(generatedDirectory)
59}
60
61def extension = project.extensions.getByType(JavaPluginExtension.class)
62def mainSources = extension.sourceSets.getByName("main")
63mainSources.getOutput().dir(exportTaskProvider.flatMap { it.outputDir })