ExactCalculator: Migrate to from Groovy to Kotlin DSL
Change-Id: I3e183fed6c642a47fa335da73adcf5fdaee472b9
diff --git a/build.gradle b/build.gradle
deleted file mode 100644
index 1a7c281..0000000
--- a/build.gradle
+++ /dev/null
@@ -1,45 +0,0 @@
-plugins {
- id 'com.android.application' version '8.1.2'
-}
-
-android {
- namespace "com.android.calculator2"
- compileSdk 34
-
- defaultConfig {
- applicationId 'com.android.calculator2'
- minSdk 31
- targetSdk 34
- versionCode 1
- versionName "1.0"
- }
-
- buildTypes {
- debug {
- minifyEnabled false
- }
- release {
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard.flags'
- }
- }
- compileOptions {
- sourceCompatibility JavaVersion.VERSION_1_8
- targetCompatibility JavaVersion.VERSION_1_8
- }
- sourceSets {
- main {
- res.srcDirs = ['res']
- java.srcDirs = ['src']
- assets.srcDirs = ['assets']
- manifest.srcFile 'AndroidManifest.xml'
- }
- }
-}
-
-dependencies {
- implementation files('cr.jar')
-
- implementation 'androidx.gridlayout:gridlayout:1.0.0'
- implementation 'androidx.webkit:webkit:1.7.0'
- implementation 'com.google.android.material:material:1.9.0'
-}
diff --git a/build.gradle.kts b/build.gradle.kts
new file mode 100644
index 0000000..1dfe394
--- /dev/null
+++ b/build.gradle.kts
@@ -0,0 +1,64 @@
+/*
+ * SPDX-FileCopyrightText: 2023 The LineageOS Project
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+plugins {
+ id("com.android.application") version "8.1.2"
+ id("org.jetbrains.kotlin.android") version "1.7.10"
+}
+
+android {
+ compileSdk = 34
+ namespace = "com.android.calculator2"
+
+ defaultConfig {
+ applicationId = "com.android.calculator2"
+ minSdk = 31
+ targetSdk = 34
+ versionCode = 1
+ versionName = "1.0"
+ }
+
+ buildTypes {
+ getByName("release") {
+ // Enables code shrinking, obfuscation, and optimization.
+ isMinifyEnabled = true
+
+ // Enables resource shrinking.
+ isShrinkResources = true
+
+ // Includes the default ProGuard rules files.
+ setProguardFiles(
+ listOf(
+ getDefaultProguardFile("proguard-android.txt"),
+ "proguard.flags"
+ )
+ )
+ }
+ getByName("debug") {
+ // Append .dev to package name so we won't conflict with AOSP build.
+ applicationIdSuffix = ".dev"
+ }
+ }
+ compileOptions {
+ sourceCompatibility = JavaVersion.VERSION_17
+ targetCompatibility = JavaVersion.VERSION_17
+ }
+ sourceSets {
+ getByName("main") {
+ res.srcDirs("res")
+ java.srcDirs("src")
+ assets.srcDirs("assets")
+ manifest.srcFile("AndroidManifest.xml")
+ }
+ }
+}
+
+dependencies {
+ implementation(files("cr.jar"))
+
+ implementation("androidx.gridlayout:gridlayout:1.0.0")
+ implementation("androidx.webkit:webkit:1.7.0")
+ implementation("com.google.android.material:material:1.9.0")
+}
diff --git a/settings.gradle b/settings.gradle.kts
similarity index 66%
rename from settings.gradle
rename to settings.gradle.kts
index 2a9285c..a6bebf3 100644
--- a/settings.gradle
+++ b/settings.gradle.kts
@@ -1,8 +1,13 @@
+/*
+ * SPDX-FileCopyrightText: 2023 The LineageOS Project
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
pluginManagement {
repositories {
+ gradlePluginPortal()
google()
mavenCentral()
- gradlePluginPortal()
}
}
dependencyResolutionManagement {
@@ -12,3 +17,4 @@
mavenCentral()
}
}
+rootProject.name = "ExactCalculator"