From df84b6f628ddd6fb45e3332a75bf8178ba610235 Mon Sep 17 00:00:00 2001 From: Gopalakrishnan Iyer Date: Sat, 11 Jan 2025 20:34:17 -0700 Subject: [PATCH] Convert app `build.gradle` to `.kts` --- app/build.gradle | 101 ------------------------------------------- app/build.gradle.kts | 98 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+), 101 deletions(-) delete mode 100644 app/build.gradle create mode 100644 app/build.gradle.kts diff --git a/app/build.gradle b/app/build.gradle deleted file mode 100644 index 2494088c..00000000 --- a/app/build.gradle +++ /dev/null @@ -1,101 +0,0 @@ -plugins { - id 'com.android.application' - id 'kotlin-android' - id 'kotlin-kapt' -} - -android { - compileSdkVersion 34 - - defaultConfig { - namespace "com.parishod.watomatic" - applicationId "com.parishod.watomatic" - minSdkVersion 21 - targetSdkVersion 34 - versionCode 29 - versionName "1.29" - - javaCompileOptions { - annotationProcessorOptions { - arguments = ["room.schemaLocation":"$projectDir/schemas".toString()] - } - } - - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - - //Disable split language resources on .aab, necessary to allow the language changing - //option to work - bundle { - language { - enableSplit = false - } - } - - buildTypes { - release { - // Enables code shrinking, obfuscation, and optimization for only - // your project's release build type. - minifyEnabled true - - // Enables resource shrinking, which is performed by the - // Android Gradle plugin. - shrinkResources true - - // Includes the default ProGuard rules files that are packaged with - // the Android Gradle plugin. To learn more, go to the section about - // R8 configuration files. - proguardFiles getDefaultProguardFile( - 'proguard-android-optimize.txt'), - 'proguard-rules.pro' - } - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 - } - kotlinOptions { - jvmTarget = '17' - } - buildFeatures { - viewBinding = true - dataBinding = true - buildConfig = true - } - flavorDimensions 'version' - productFlavors { - GooglePlay { - dimension 'version' - } - Default { - dimension 'version' - } - } -} - -dependencies { - - implementation 'androidx.appcompat:appcompat:1.7.0' - implementation "androidx.preference:preference-ktx:1.2.1" - implementation 'com.google.android.material:material:1.12.0' - implementation 'androidx.constraintlayout:constraintlayout:2.1.4' - implementation 'androidx.room:room-runtime:2.6.1' - implementation "androidx.work:work-runtime:2.9.1" - testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.2.1' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1' - kapt 'androidx.room:room-compiler:2.6.1' - implementation "androidx.core:core-ktx:1.13.1" - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - implementation 'com.google.code.gson:gson:2.10.1' - implementation 'com.squareup.retrofit2:retrofit:2.9.0' - implementation 'com.squareup.retrofit2:converter-gson:2.3.0' - implementation 'com.squareup.retrofit2:converter-scalars:2.9.0' - implementation "com.squareup.okhttp3:logging-interceptor:4.7.2" - implementation 'com.github.transferwise:sequence-layout:1.1.1' - implementation "androidx.browser:browser:1.8.0" -} -repositories { - mavenCentral() - maven { url "https://jitpack.io" } -} diff --git a/app/build.gradle.kts b/app/build.gradle.kts new file mode 100644 index 00000000..3369a4c0 --- /dev/null +++ b/app/build.gradle.kts @@ -0,0 +1,98 @@ +plugins { + id("com.android.application") + id("kotlin-android") + id("kotlin-kapt") +} + +android { + compileSdk = 34 + + defaultConfig { + namespace = "com.parishod.watomatic" + applicationId = "com.parishod.watomatic" + minSdk = 21 + targetSdk = 34 + versionCode = 29 + versionName = "1.29" + + javaCompileOptions { + annotationProcessorOptions { + argument("room.schemaLocation", "$projectDir/schemas") + } + } + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } + + //Disable split language resources on .aab, necessary to allow the language changing + //option to work + bundle { + language { + enableSplit = false + } + } + + buildTypes { + getByName("release") { + // Enables code shrinking, obfuscation, and optimization for only + // your project's release build type. + isMinifyEnabled = true + + // Enables resource shrinking, which is performed by the + // Android Gradle plugin. + isShrinkResources = true + + // Includes the default ProGuard rules files that are packaged with + // the Android Gradle plugin. To learn more, go to the section about + // R8 configuration files. + proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + kotlinOptions { + jvmTarget = "17" + } + buildFeatures { + viewBinding = true + dataBinding = true + buildConfig = true + } + flavorDimensions += "version" + productFlavors { + create("GooglePlay") { + dimension = "version" + } + create("Default") { + dimension = "version" + } + } +} + +dependencies { + implementation("androidx.appcompat:appcompat:1.7.0") + implementation("androidx.preference:preference-ktx:1.2.1") + implementation("com.google.android.material:material:1.12.0") + implementation("androidx.constraintlayout:constraintlayout:2.2.0") + implementation("androidx.room:room-runtime:2.6.1") + implementation("androidx.work:work-runtime:2.10.0") + testImplementation("junit:junit:4.13.2") + androidTestImplementation("androidx.test.ext:junit:1.2.1") + androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1") + kapt("androidx.room:room-compiler:2.6.1") + implementation("androidx.core:core-ktx:1.15.0") + implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:${rootProject.extra["kotlin_version"]}") + implementation("com.google.code.gson:gson:2.10.1") + implementation("com.squareup.retrofit2:retrofit:2.9.0") + implementation("com.squareup.retrofit2:converter-gson:2.3.0") + implementation("com.squareup.retrofit2:converter-scalars:2.9.0") + implementation("com.squareup.okhttp3:logging-interceptor:4.7.2") + implementation("com.github.transferwise:sequence-layout:1.1.1") + implementation("androidx.browser:browser:1.8.0") +} +repositories { + mavenCentral() + maven("https://jitpack.io") +}