blob: df7e90370aba63a1ee3eb76298e7e805d4784f67 [file] [log] [blame]
Sergey Vasilinetscb306422018-05-22 14:39:17 -07001/*
2 * Copyright 2018 The Android Open Source Project
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
Aurimas Liutikasf866d102018-06-04 13:25:55 -070017import androidx.build.SupportConfig
Nick Anthonyb4f01cb2019-03-25 14:03:17 +000018import static androidx.build.dependencies.DependenciesKt.CHECKER_FRAMEWORK
Aurimas Liutikasf866d102018-06-04 13:25:55 -070019
Sergey Vasilinetscb306422018-05-22 14:39:17 -070020plugins {
Aurimas Liutikas21ff5d12018-08-15 15:33:13 -070021 id("AndroidXPlugin")
22 id("com.android.application")
Sergey Vasilinetscb306422018-05-22 14:39:17 -070023}
24
25// replace all tests etc with empty task, so we don't run anything
26// it is more effective then task.enabled = false, because we avoid executing deps as well
27def reentrance = false
28project.tasks.whenTaskAdded { task ->
Jeff Gastonaba1e6e2019-03-08 19:19:34 -050029 if (task instanceof org.gradle.api.tasks.testing.Test
Jeff Gastona3d28a72019-03-08 19:19:34 -050030 || task.name.startsWith("assemble")
31 || task.name == "transformDexArchiveWithExternalLibsDexMergerForPublicDebug"
32 || task.name == "transformResourcesWithMergeJavaResForPublicDebug"
33 || task.name == "checkPublicDebugDuplicateClasses") {
34 if (!reentrance) {
Sergey Vasilinetscb306422018-05-22 14:39:17 -070035 reentrance = true
36 project.tasks.replace(task.name)
37 reentrance = false
38 }
39 }
40}
41
42android {
Jake Whartonc2d75492018-07-13 19:24:58 -040043 defaultConfig {
Alan Viverette033f6592018-11-28 17:18:38 -050044 minSdkVersion SupportConfig.COMPILE_SDK_VERSION
Jeff Gastonf5cea8602018-11-06 21:12:41 -050045 javaCompileOptions.annotationProcessorOptions.includeCompileClasspath = false
Jake Whartonc2d75492018-07-13 19:24:58 -040046 }
47
Sergey Vasilinetscb306422018-05-22 14:39:17 -070048 sourceSets {
49 main {
50 manifest.srcFile "AndroidManifest.xml"
51 }
52 }
Oussama Ben Abdelbaki892e5b02018-10-23 22:08:30 +000053 flavorDimensions "library-group"
Sergey Vasilinetscb306422018-05-22 14:39:17 -070054}
Nick Anthonyb4f01cb2019-03-25 14:03:17 +000055
56dependencies {
57 /*
58 * This is needed to build Public Docs for media2:1.0.0-alpha04 and higher
59 * Our current guess is that Doclava isn't checking which dependencies are unique to
60 * the compileOnly configuration, since they're not supposed to be needed at runtime.
61 */
62 compileOnly(CHECKER_FRAMEWORK)
63}
64