blob: 1c8ddcb431d2e30550cb0e3ff0acd3e6d19357a0 [file] [log] [blame]
Chaohui Wang4c18b352023-06-08 16:11:22 +08001/*
2 * Copyright 2022 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
Chaohui Wangef4a2212023-08-16 10:15:18 +080017import com.android.build.api.dsl.CommonExtension
Chaohui Wang4c18b352023-06-08 16:11:22 +080018import com.android.build.gradle.BaseExtension
19import com.android.build.gradle.api.AndroidBasePlugin
20import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
21
22plugins {
23 alias(libs.plugins.android.application) apply false
24 alias(libs.plugins.android.library) apply false
25 alias(libs.plugins.kotlin.android) apply false
26}
27
28allprojects {
Chaohui Wangfbb02222023-10-28 23:56:05 +080029 extra["jetpackComposeVersion"] = "1.6.0-alpha08"
Chaohui Wang4c18b352023-06-08 16:11:22 +080030}
31
32subprojects {
33 plugins.withType<AndroidBasePlugin> {
34 configure<BaseExtension> {
Chaohui Wangf7f3e962023-06-23 12:22:25 +080035 compileSdkVersion(34)
Chaohui Wang4c18b352023-06-08 16:11:22 +080036
37 defaultConfig {
38 minSdk = 21
39 targetSdk = 34
40 }
41
42 compileOptions {
43 sourceCompatibility = JavaVersion.VERSION_17
44 targetCompatibility = JavaVersion.VERSION_17
45 }
46 }
47 }
48
49 afterEvaluate {
50 plugins.withType<AndroidBasePlugin> {
Chaohui Wangef4a2212023-08-16 10:15:18 +080051 the(CommonExtension::class).apply {
Chaohui Wang4c18b352023-06-08 16:11:22 +080052 if (buildFeatures.compose == true) {
53 composeOptions {
Chaohui Wangef4a2212023-08-16 10:15:18 +080054 kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get()
Chaohui Wang4c18b352023-06-08 16:11:22 +080055 }
56 }
57 }
58 }
59 }
60
61 tasks.withType<KotlinCompile> {
62 kotlinOptions {
63 jvmTarget = "17"
64 freeCompilerArgs = listOf("-Xjvm-default=all")
65 }
66 }
67}