Migrate APP gradle file to kotlin dsl

This commit is contained in:
Shinokuni 2024-07-04 12:00:24 +02:00
parent 4fa377bf26
commit 5ada97d60e
5 changed files with 113 additions and 111 deletions

View File

@ -17,7 +17,7 @@ android {
sourceSets {
getByName("androidTest") {
kotlin.srcDirs("$projectDir/androidTest/assets")
assets.srcDirs("$projectDir/androidTest/assets")
}
}

View File

@ -1,97 +0,0 @@
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
}
android {
namespace 'com.readrops.app'
compileSdk rootProject.ext.compileSdkVersion
defaultConfig {
applicationId "com.readrops.app"
minSdk rootProject.ext.minSdkVersion
targetSdk rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
debug {
minifyEnabled false
shrinkResources false
testCoverageEnabled true
applicationIdSuffix ".debug"
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = '17'
}
buildFeatures {
buildConfig true
compose true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.4.0"
}
lint {
abortOnError false
}
}
dependencies {
implementation project(':api')
implementation project(':db')
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.8.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
implementation(libs.bundles.compose)
implementation(libs.compose.activity)
implementation 'androidx.palette:palette-ktx:1.0.0'
implementation(libs.bundles.voyager)
implementation(libs.bundles.lifecycle)
implementation(libs.bundles.coil)
implementation(libs.bundles.coroutines)
androidTestImplementation(libs.coroutines.test)
implementation(libs.bundles.room)
implementation(libs.bundles.paging)
implementation(libs.bundles.koin)
androidTestImplementation(libs.bundles.kointest)
androidTestImplementation 'com.squareup.okhttp3:mockwebserver:4.9.0'
coreLibraryDesugaring(libs.jdk.desugar)
implementation(libs.encrypted.preferences)
implementation(libs.work.manager)
}

97
app/build.gradle.kts Normal file
View File

@ -0,0 +1,97 @@
plugins {
id("com.android.application")
kotlin("android")
}
android {
namespace = "com.readrops.app"
compileSdk = 34
defaultConfig {
applicationId = "com.readrops.app"
minSdk = 21
targetSdk = 34
versionCode = 15
versionName = "2.0-beta01"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
isMinifyEnabled = true
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
debug {
isMinifyEnabled = false
isShrinkResources = false
isTestCoverageEnabled = true
applicationIdSuffix = ".debug"
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
}
}
compileOptions {
isCoreLibraryDesugaringEnabled = true
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
}
buildFeatures {
buildConfig = true
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.4.0"
}
lint {
abortOnError = false
}
}
dependencies {
implementation(project(":api"))
implementation(project(":db"))
implementation("androidx.core:core-ktx:1.7.0")
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("com.google.android.material:material:1.8.0")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
implementation(libs.bundles.compose)
implementation(libs.compose.activity)
implementation("androidx.palette:palette-ktx:1.0.0")
implementation(libs.bundles.voyager)
implementation(libs.bundles.lifecycle)
implementation(libs.bundles.coil)
implementation(libs.bundles.coroutines)
androidTestImplementation(libs.coroutines.test)
implementation(libs.bundles.room)
implementation(libs.bundles.paging)
implementation(libs.bundles.koin)
androidTestImplementation(libs.bundles.kointest)
androidTestImplementation("com.squareup.okhttp3:mockwebserver:4.9.0")
coreLibraryDesugaring(libs.jdk.desugar)
implementation(libs.encrypted.preferences)
implementation(libs.work.manager)
}

View File

@ -1,6 +1,6 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
# proguardFiles setting in build.gradle.kts.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

View File

@ -1,27 +1,27 @@
plugins {
id("com.android.library")
id("org.jetbrains.kotlin.android")
id("org.jetbrains.kotlin.kapt")
id("org.jetbrains.kotlin.plugin.parcelize")
kotlin("android")
kotlin("kapt")
kotlin("plugin.parcelize")
}
android {
namespace = "com.readrops.db"
compileSdkVersion(34)
compileSdk = 34
defaultConfig {
minSdkVersion(21)
targetSdkVersion(34)
buildToolsVersion("34.0.0")
minSdk = 21
targetSdk = 34
buildToolsVersion ="34.0.0"
/*javaCompileOptions {
javaCompileOptions {
annotationProcessorOptions {
arguments = listOf(
arguments += mapOf(
"room.incremental" to "true",
"room.schemaLocation" to "$projectDir/schemas".toString()
)
}
}*/
}
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
@ -29,7 +29,7 @@ android {
sourceSets {
getByName("androidTest") {
kotlin.srcDirs("$projectDir/schemas")
assets.srcDirs("$projectDir/schemas")
}
}
@ -70,6 +70,8 @@ kapt {
}
}
dependencies {
api("androidx.core:core-ktx:1.6.0")
api("androidx.appcompat:appcompat:1.3.0")