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.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jmailen.gradle.kotlinter.tasks.LintTask import org.jmailen.gradle.kotlinter.tasks.LintTask
@ -6,7 +5,6 @@ plugins {
id("com.android.application") id("com.android.application")
id("com.mikepenz.aboutlibraries.plugin") id("com.mikepenz.aboutlibraries.plugin")
kotlin("android") kotlin("android")
id("tachiyomi.lint")
kotlin("plugin.serialization") kotlin("plugin.serialization")
id("com.github.zellius.shortcut-helper") id("com.github.zellius.shortcut-helper")
id("com.squareup.sqldelight") id("com.squareup.sqldelight")
@ -22,13 +20,9 @@ val SUPPORTED_ABIS = setOf("armeabi-v7a", "arm64-v8a", "x86", "x86_64")
android { android {
namespace = "eu.kanade.tachiyomi" namespace = "eu.kanade.tachiyomi"
compileSdk = AndroidConfig.compileSdk
ndkVersion = AndroidConfig.ndk
defaultConfig { defaultConfig {
applicationId = "eu.kanade.tachiyomi" applicationId = "eu.kanade.tachiyomi"
minSdk = AndroidConfig.minSdk
targetSdk = AndroidConfig.targetSdk
versionCode = 94 versionCode = 94
versionName = "0.14.3" versionName = "0.14.3"
@ -143,17 +137,6 @@ android {
kotlinCompilerExtensionVersion = compose.versions.compiler.get() 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 { sqldelight {
database("Database") { database("Database") {
packageName = "eu.kanade.tachiyomi" packageName = "eu.kanade.tachiyomi"
@ -167,8 +150,6 @@ dependencies {
implementation(project(":core")) implementation(project(":core"))
implementation(project(":source-api")) implementation(project(":source-api"))
coreLibraryDesugaring(libs.desugar)
// Compose // Compose
implementation(platform(compose.bom)) implementation(platform(compose.bom))
implementation(compose.activity) implementation(compose.activity)
@ -304,12 +285,6 @@ androidComponents {
} }
tasks { tasks {
withType<Test> {
useJUnitPlatform()
testLogging {
events(TestLogEvent.PASSED, TestLogEvent.SKIPPED, TestLogEvent.FAILED)
}
}
withType<LintTask>().configureEach { withType<LintTask>().configureEach {
exclude { it.file.path.contains("generated[\\\\/]".toRegex()) } 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 { buildscript {
dependencies { dependencies {
classpath(libs.android.shortcut.gradle) classpath(libs.android.shortcut.gradle)
@ -11,6 +16,45 @@ plugins {
alias(kotlinx.plugins.serialization) apply false 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") { tasks.register<Delete>("clean") {
delete(rootProject.buildDir) delete(rootProject.buildDir)
} }

View File

@ -1,27 +1,11 @@
plugins { plugins {
id("com.android.library") id("com.android.library")
kotlin("android") kotlin("android")
id("tachiyomi.lint")
kotlin("plugin.serialization") kotlin("plugin.serialization")
} }
android { android {
namespace = "eu.kanade.tachiyomi.core" 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 { dependencies {

View File

@ -1,25 +1,10 @@
plugins { plugins {
id("com.android.library") id("com.android.library")
kotlin("android") kotlin("android")
id("tachiyomi.lint")
} }
android { android {
namespace = "eu.kanade.tachiyomi.i18n" 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 { lint {
disable.addAll(listOf("MissingTranslation", "ExtraTranslation")) disable.addAll(listOf("MissingTranslation", "ExtraTranslation"))

View File

@ -1,26 +1,12 @@
plugins { plugins {
id("com.android.test") id("com.android.test")
kotlin("android") kotlin("android")
id("tachiyomi.lint")
} }
android { android {
namespace = "tachiyomi.macrobenchmark" 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 { defaultConfig {
minSdk = AndroidConfig.minSdk
targetSdk = AndroidConfig.targetSdk
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
} }

View File

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