Skip to content

Commit b296be5

Browse files
committed
Migrate build scripts to kts
1 parent d9e776c commit b296be5

File tree

5 files changed

+96
-94
lines changed

5 files changed

+96
-94
lines changed

AdaptiveUiCodelab/app/build.gradle

Lines changed: 0 additions & 89 deletions
This file was deleted.
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
/*
2+
* Copyright 2022 Google LLC
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+
* https://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+
17+
plugins {
18+
id("com.android.application")
19+
id("org.jetbrains.kotlin.android")
20+
}
21+
22+
android {
23+
namespace = "com.example.reply"
24+
compileSdk = 34
25+
26+
defaultConfig {
27+
applicationId = "com.example.reply"
28+
minSdk = 21
29+
targetSdk = 33
30+
versionCode = 1
31+
versionName = "1.0"
32+
33+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
34+
vectorDrawables {
35+
useSupportLibrary = true
36+
}
37+
}
38+
39+
buildTypes {
40+
release {
41+
isMinifyEnabled = false
42+
proguardFiles(
43+
getDefaultProguardFile("proguard-android-optimize.txt"),
44+
"proguard-rules.pro"
45+
)
46+
}
47+
}
48+
compileOptions {
49+
sourceCompatibility = JavaVersion.VERSION_1_8
50+
targetCompatibility = JavaVersion.VERSION_1_8
51+
}
52+
kotlinOptions {
53+
jvmTarget = "1.8"
54+
}
55+
buildFeatures {
56+
compose = true
57+
}
58+
composeOptions {
59+
kotlinCompilerExtensionVersion = "1.5.13"
60+
}
61+
packaging {
62+
resources {
63+
excludes += "/META-INF/AL2.0"
64+
excludes += "/META-INF/LGPL2.1"
65+
}
66+
}
67+
}
68+
69+
dependencies {
70+
val composeBom = platform(libs.androidx.compose.bom)
71+
implementation(composeBom)
72+
androidTestImplementation(composeBom)
73+
74+
implementation(libs.androidx.material3)
75+
implementation(libs.androidx.material.icons.extended)
76+
implementation(libs.androidx.ui.tooling.preview)
77+
androidTestImplementation(libs.androidx.ui.test.junit4)
78+
debugImplementation(libs.androidx.ui.tooling)
79+
debugImplementation(libs.androidx.ui.test.manifest)
80+
81+
implementation(libs.androidx.lifecycle.viewmodel.compose)
82+
implementation(libs.androidx.lifecycle.runtime.ktx)
83+
implementation(libs.androidx.activity.compose)
84+
implementation(libs.androidx.core.ktx)
85+
implementation(libs.androidx.window)
86+
implementation(libs.kotlinx.coroutines.android)
87+
88+
testImplementation(libs.junit)
89+
androidTestImplementation(libs.androidx.junit)
90+
androidTestImplementation(libs.androidx.espresso.core)
91+
}

AdaptiveUiCodelab/app/proguard-rules.pro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Add project specific ProGuard rules here.
22
# You can control the set of applied configuration files using the
3-
# proguardFiles setting in build.gradle.
3+
# proguardFiles setting in build.gradle.kts.
44
#
55
# For more details, see
66
# http://developer.android.com/guide/developing/tools/proguard.html
@@ -18,4 +18,4 @@
1818

1919
# If you keep the line number information, uncomment this to
2020
# hide the original source file name.
21-
#-renamesourcefileattribute SourceFile
21+
#-renamesourcefileattribute SourceFile
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ buildscript {
1919
mavenCentral()
2020
}
2121
dependencies {
22-
classpath "com.android.tools.build:gradle:8.4.0"
23-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.23"
22+
classpath("com.android.tools.build:gradle:8.4.0")
23+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.23")
2424
}
2525
}
2626

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
*/
1616

1717
rootProject.name = "Reply"
18-
include ':app'
18+
include(":app")

0 commit comments

Comments
 (0)