From a1df9dbe8914a356531f576b981d317db3bab276 Mon Sep 17 00:00:00 2001 From: Shinokuni Date: Thu, 4 Jul 2024 10:47:11 +0200 Subject: [PATCH] Migrate API gradle file to kotlin dsl --- api/build.gradle | 80 ------------------------------------- api/build.gradle.kts | 83 +++++++++++++++++++++++++++++++++++++++ buildSrc/build.gradle.kts | 9 +++++ 3 files changed, 92 insertions(+), 80 deletions(-) delete mode 100644 api/build.gradle create mode 100644 api/build.gradle.kts create mode 100644 buildSrc/build.gradle.kts diff --git a/api/build.gradle b/api/build.gradle deleted file mode 100644 index b08bf55c..00000000 --- a/api/build.gradle +++ /dev/null @@ -1,80 +0,0 @@ -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' - -android { - compileSdkVersion rootProject.ext.compileSdkVersion - - defaultConfig { - minSdkVersion rootProject.ext.minSdkVersion - targetSdkVersion rootProject.ext.targetSdkVersion - buildToolsVersion rootProject.ext.buildToolsVersion - - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - - - sourceSets { - androidTest.assets.srcDirs += files("$projectDir/androidTest/assets".toString()) - } - - buildTypes { - release { - minifyEnabled true - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - - debug { - minifyEnabled false - testCoverageEnabled true - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 - } - kotlinOptions { - jvmTarget = '17' - freeCompilerArgs = ["-Xstring-concat=inline"] - } - lint { - abortOnError false - } - namespace 'com.readrops.api' -} - -dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation project(':db') - - testImplementation 'junit:junit:4.13' - androidTestImplementation 'androidx.test.ext:junit:1.1.3' - androidTestImplementation 'androidx.test:runner:1.4.0' - androidTestImplementation 'androidx.test:rules:1.4.0' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' - - implementation(libs.bundles.koin) - testImplementation(libs.bundles.kointest) - - implementation(libs.konsumexml) - implementation(libs.kotlinxmlbuilder) - - implementation(libs.okhttp) - testImplementation(libs.okhttp.mockserver) - - implementation('com.squareup.retrofit2:retrofit:2.9.0') { - exclude group: 'com.squareup.okhttp3', module: 'okhttp3' - } - implementation('com.squareup.retrofit2:converter-moshi:2.9.0') { - exclude group: 'com.squareup.moshi', module: 'moshi' - } - - implementation 'com.squareup.moshi:moshi:1.15.1' - - api 'org.jsoup:jsoup:1.13.1' - - debugApi 'com.chimerapps.niddler:niddler:1.5.5' - releaseApi 'com.chimerapps.niddler:niddler-noop:1.5.5' - - testImplementation(libs.coroutines.test) -} diff --git a/api/build.gradle.kts b/api/build.gradle.kts new file mode 100644 index 00000000..bc8e5d27 --- /dev/null +++ b/api/build.gradle.kts @@ -0,0 +1,83 @@ +plugins { + id("com.android.library") + kotlin("android") +} + +android { + namespace = "com.readrops.api" + compileSdkVersion(34) + + defaultConfig { + minSdkVersion(21) + targetSdkVersion(34) + buildToolsVersion("34.0.0") + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } + + sourceSets { + getByName("androidTest") { + kotlin.srcDirs("$projectDir/androidTest/assets") + } + } + + buildTypes { + release { + isMinifyEnabled = true + proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro") + } + + debug { + isMinifyEnabled = false + isTestCoverageEnabled = true + proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro") + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + kotlinOptions { + jvmTarget = "17" + freeCompilerArgs = listOf("-Xstring-concat=inline") + } + lint { + abortOnError = false + } +} + +dependencies { + //implementation fileTree(dir: "libs", include: ["*.jar"]) + implementation(project(":db")) + + testImplementation("junit:junit:4.13") + androidTestImplementation("androidx.test.ext:junit:1.1.3") + androidTestImplementation("androidx.test:runner:1.4.0") + androidTestImplementation("androidx.test:rules:1.4.0") + androidTestImplementation("androidx.test.espresso:espresso-core:3.4.0") + + implementation(libs.bundles.koin) + testImplementation(libs.bundles.kointest) + + implementation(libs.konsumexml) + implementation(libs.kotlinxmlbuilder) + + implementation(libs.okhttp) + testImplementation(libs.okhttp.mockserver) + + implementation("com.squareup.retrofit2:retrofit:2.9.0") { + exclude("com.squareup.okhttp3", "okhttp3") + } + implementation("com.squareup.retrofit2:converter-moshi:2.9.0") { + exclude("com.squareup.moshi", "moshi") + } + + implementation("com.squareup.moshi:moshi:1.15.1") + + api("org.jsoup:jsoup:1.13.1") + + debugApi("com.chimerapps.niddler:niddler:1.5.5") + releaseApi("com.chimerapps.niddler:niddler-noop:1.5.5") + + testImplementation(libs.coroutines.test) +} diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts new file mode 100644 index 00000000..181a9870 --- /dev/null +++ b/buildSrc/build.gradle.kts @@ -0,0 +1,9 @@ +import org.gradle.kotlin.dsl.`kotlin-dsl` + +plugins { + `kotlin-dsl` +} + +repositories { + mavenCentral() +}