Skip to content

Commit bb7da50

Browse files
committed
Migrate to Kotlin DSL
1 parent 569a662 commit bb7da50

4 files changed

Lines changed: 97 additions & 98 deletions

File tree

app/build.gradle

Lines changed: 0 additions & 92 deletions
This file was deleted.

app/build.gradle.kts

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
/*
2+
* Copyright (C) 2023 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+
* 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 = 33
25+
26+
defaultConfig {
27+
applicationId = "com.example.reply"
28+
minSdk = 24
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+
allWarningsAsErrors = false
55+
}
56+
buildFeatures {
57+
compose = true
58+
}
59+
composeOptions {
60+
kotlinCompilerExtensionVersion = "1.4.3"
61+
}
62+
packagingOptions {
63+
resources {
64+
excludes += "/META-INF/{AL2.0,LGPL2.1}"
65+
}
66+
}
67+
}
68+
69+
dependencies {
70+
71+
implementation(platform("androidx.compose:compose-bom:2022.10.00"))
72+
implementation("androidx.activity:activity-compose:1.7.2")
73+
implementation("androidx.compose.material3:material3")
74+
implementation("androidx.compose.material3:material3-window-size-class")
75+
implementation("androidx.compose.material:material-icons-extended")
76+
implementation("androidx.compose.ui:ui")
77+
implementation("androidx.compose.ui:ui-graphics")
78+
implementation("androidx.compose.ui:ui-tooling-preview")
79+
implementation("androidx.core:core-ktx:1.10.1")
80+
implementation("androidx.lifecycle:lifecycle-runtime-ktx:${rootProject.extra["lifecycle_version"]}")
81+
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:${rootProject.extra["lifecycle_version"]}")
82+
83+
androidTestImplementation(platform("androidx.compose:compose-bom:2022.10.00"))
84+
androidTestImplementation("androidx.compose.ui:ui-test-junit4")
85+
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
86+
androidTestImplementation("androidx.test.ext:junit:1.1.5")
87+
testImplementation("junit:junit:4.13.2")
88+
89+
debugImplementation("androidx.compose.ui:ui-test-manifest")
90+
debugImplementation("androidx.compose.ui:ui-tooling")
91+
}

build.gradle renamed to build.gradle.kts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
* limitations under the License.
1515
*/
1616
buildscript {
17-
ext {
18-
lifecycle_version = '2.6.0'
17+
extra.apply {
18+
set("lifecycle_version", "2.6.0")
1919
}
2020
}
2121

2222
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2323
plugins {
24-
id 'com.android.application' version '8.0.0-beta05' apply false
25-
id 'com.android.library' version '8.0.0-beta05' apply false
26-
id 'org.jetbrains.kotlin.android' version '1.8.0' apply false
24+
id("com.android.application") version "8.0.2" apply false
25+
id("com.android.library") version "8.0.2" apply false
26+
id("org.jetbrains.kotlin.android") version "1.8.10" apply false
2727
}

settings.gradle renamed to settings.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ dependencyResolutionManagement {
1313
}
1414
}
1515
rootProject.name = "Reply"
16-
include ':app'
16+
include(":app")

0 commit comments

Comments
 (0)