blob: 64b67d7fe4f17d2d6382ac1a99769d59562028c1 [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
17import com.android.build.gradle.BaseExtension
18import com.android.build.gradle.api.AndroidBasePlugin
19import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
20
21plugins {
22 alias(libs.plugins.android.application) apply false
23 alias(libs.plugins.android.library) apply false
24 alias(libs.plugins.kotlin.android) apply false
25}
26
27allprojects {
28 extra["jetpackComposeVersion"] = "1.4.0-beta01"
29}
30
31subprojects {
32 plugins.withType<AndroidBasePlugin> {
33 configure<BaseExtension> {
34 compileSdkVersion(33)
35
36 defaultConfig {
37 minSdk = 21
38 targetSdk = 34
39 }
40
41 compileOptions {
42 sourceCompatibility = JavaVersion.VERSION_17
43 targetCompatibility = JavaVersion.VERSION_17
44 }
45 }
46 }
47
48 afterEvaluate {
49 plugins.withType<AndroidBasePlugin> {
50 configure<BaseExtension> {
51 if (buildFeatures.compose == true) {
52 composeOptions {
53 kotlinCompilerExtensionVersion = "1.4.4"
54 }
55 }
56 }
57 }
58 }
59
60 tasks.withType<KotlinCompile> {
61 kotlinOptions {
62 jvmTarget = "17"
63 freeCompilerArgs = listOf("-Xjvm-default=all")
64 }
65 }
66}