Move shared configuration to subprojects in root Gradle file (#8951)

* Move shared configuration to subprojects in root Gradle file

* Missed but not forgotten

* Review changes
This commit is contained in:
Andreas 2023-01-21 05:04:22 +01:00 committed by GitHub
parent 7a972dfdb7
commit 2b5d9fd76b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 44 additions and 82 deletions

View file

@ -1,4 +1,3 @@
import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jmailen.gradle.kotlinter.tasks.LintTask
@ -6,7 +5,6 @@ plugins {
id("com.android.application")
id("com.mikepenz.aboutlibraries.plugin")
kotlin("android")
id("tachiyomi.lint")
kotlin("plugin.serialization")
id("com.github.zellius.shortcut-helper")
id("com.squareup.sqldelight")
@ -22,13 +20,9 @@ val SUPPORTED_ABIS = setOf("armeabi-v7a", "arm64-v8a", "x86", "x86_64")
android {
namespace = "eu.kanade.tachiyomi"
compileSdk = AndroidConfig.compileSdk
ndkVersion = AndroidConfig.ndk
defaultConfig {
applicationId = "eu.kanade.tachiyomi"
minSdk = AndroidConfig.minSdk
targetSdk = AndroidConfig.targetSdk
versionCode = 94
versionName = "0.14.3"
@ -143,17 +137,6 @@ android {
kotlinCompilerExtensionVersion = compose.versions.compiler.get()
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
isCoreLibraryDesugaringEnabled = true
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
sqldelight {
database("Database") {
packageName = "eu.kanade.tachiyomi"
@ -167,8 +150,6 @@ dependencies {
implementation(project(":core"))
implementation(project(":source-api"))
coreLibraryDesugaring(libs.desugar)
// Compose
implementation(platform(compose.bom))
implementation(compose.activity)
@ -304,12 +285,6 @@ androidComponents {
}
tasks {
withType<Test> {
useJUnitPlatform()
testLogging {
events(TestLogEvent.PASSED, TestLogEvent.SKIPPED, TestLogEvent.FAILED)
}
}
withType<LintTask>().configureEach {
exclude { it.file.path.contains("generated[\\\\/]".toRegex()) }

View file

@ -1,3 +1,8 @@
import com.android.build.gradle.BaseExtension
import com.android.build.gradle.BasePlugin
import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
buildscript {
dependencies {
classpath(libs.android.shortcut.gradle)
@ -11,6 +16,45 @@ plugins {
alias(kotlinx.plugins.serialization) apply false
}
subprojects {
tasks.withType<KotlinJvmCompile> {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
}
tasks.withType<Test> {
useJUnitPlatform()
testLogging {
events(TestLogEvent.PASSED, TestLogEvent.SKIPPED, TestLogEvent.FAILED)
}
}
plugins.withType<BasePlugin> {
plugins.apply("tachiyomi.lint")
configure<BaseExtension> {
compileSdkVersion(AndroidConfig.compileSdk)
defaultConfig {
minSdk = AndroidConfig.minSdk
targetSdk = AndroidConfig.targetSdk
ndk {
version = AndroidConfig.ndk
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
isCoreLibraryDesugaringEnabled = true
}
dependencies {
add("coreLibraryDesugaring", libs.desugar)
}
}
}
}
tasks.register<Delete>("clean") {
delete(rootProject.buildDir)
}

View file

@ -1,27 +1,11 @@
plugins {
id("com.android.library")
kotlin("android")
id("tachiyomi.lint")
kotlin("plugin.serialization")
}
android {
namespace = "eu.kanade.tachiyomi.core"
compileSdk = AndroidConfig.compileSdk
defaultConfig {
minSdk = AndroidConfig.minSdk
targetSdk = AndroidConfig.targetSdk
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
}
dependencies {

View file

@ -1,25 +1,10 @@
plugins {
id("com.android.library")
kotlin("android")
id("tachiyomi.lint")
}
android {
namespace = "eu.kanade.tachiyomi.i18n"
compileSdk = AndroidConfig.compileSdk
defaultConfig {
minSdk = AndroidConfig.minSdk
targetSdk = AndroidConfig.targetSdk
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
lint {
disable.addAll(listOf("MissingTranslation", "ExtraTranslation"))

View file

@ -1,26 +1,12 @@
plugins {
id("com.android.test")
kotlin("android")
id("tachiyomi.lint")
}
android {
namespace = "tachiyomi.macrobenchmark"
compileSdk = AndroidConfig.compileSdk
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
defaultConfig {
minSdk = AndroidConfig.minSdk
targetSdk = AndroidConfig.targetSdk
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

View file

@ -1,28 +1,16 @@
plugins {
id("com.android.library")
kotlin("android")
id("tachiyomi.lint")
kotlin("plugin.serialization")
}
android {
namespace = "eu.kanade.tachiyomi.source"
compileSdk = AndroidConfig.compileSdk
defaultConfig {
minSdk = AndroidConfig.minSdk
targetSdk = AndroidConfig.targetSdk
consumerProguardFile("consumer-proguard.pro")
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
}
dependencies {