Revert "Update android.gradle to v9 (major) (#3105)"
This reverts commit 34afdabcfe.
This commit is contained in:
@@ -49,14 +49,14 @@ jobs:
|
||||
|
||||
- name: Run unit tests
|
||||
id: unit_tests
|
||||
run: ./gradlew testDebugUnitTest
|
||||
run: ./gradlew testReleaseUnitTest
|
||||
|
||||
- name: Upload test report
|
||||
if: steps.unit_tests.outcome == 'failure'
|
||||
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||
with:
|
||||
name: test-report-${{ github.sha }}
|
||||
path: app/build/reports/tests/testDebugUnitTest
|
||||
path: app/build/reports/tests/testReleaseUnitTest
|
||||
|
||||
- name: Upload APK
|
||||
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||
|
||||
@@ -89,8 +89,8 @@ android {
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
getByName("preview").res.directories.add("src/debug/res")
|
||||
getByName("benchmark").res.directories.add("src/debug/res")
|
||||
getByName("preview").res.srcDirs("src/debug/res")
|
||||
getByName("benchmark").res.srcDirs("src/debug/res")
|
||||
}
|
||||
|
||||
splits {
|
||||
@@ -139,6 +139,10 @@ android {
|
||||
viewBinding = true
|
||||
buildConfig = true
|
||||
aidl = true
|
||||
|
||||
// Disable some unused things
|
||||
renderScript = false
|
||||
shaders = false
|
||||
}
|
||||
|
||||
lint {
|
||||
|
||||
@@ -1,13 +1,6 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath(libs.kotlin.gradle)
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
alias(libs.plugins.aboutLibraries) apply false
|
||||
alias(libs.plugins.android.application) apply false
|
||||
alias(libs.plugins.android.kmp.library) apply false
|
||||
alias(libs.plugins.android.library) apply false
|
||||
alias(libs.plugins.android.test) apply false
|
||||
alias(libs.plugins.firebase.crashlytics) apply false
|
||||
|
||||
@@ -26,7 +26,6 @@ dependencies {
|
||||
|
||||
api(libs.sqldelight.androidxPaging)
|
||||
|
||||
compileOnly(platform(libs.androidx.compose.bom))
|
||||
compileOnly(libs.androidx.compose.runtimeAnnotation)
|
||||
|
||||
testImplementation(libs.bundles.test)
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
android.nonTransitiveRClass=false
|
||||
android.useAndroidX=true
|
||||
|
||||
kotlin.code.style=official
|
||||
kotlin.mpp.androidSourceSetLayoutVersion=2
|
||||
|
||||
org.gradle.caching=true
|
||||
org.gradle.configureondemand=true
|
||||
|
||||
@@ -1,50 +1,21 @@
|
||||
import com.android.build.api.dsl.ApplicationDefaultConfig
|
||||
import com.android.build.api.dsl.CommonExtension
|
||||
import com.android.build.api.dsl.CompileOptions
|
||||
import com.android.build.api.dsl.DefaultConfig
|
||||
import mihon.gradle.configurations.configureAndroid
|
||||
import mihon.gradle.configurations.configureKotlin
|
||||
import mihon.gradle.extensions.android
|
||||
import mihon.gradle.extensions.alias
|
||||
import mihon.gradle.extensions.configureTest
|
||||
import mihon.gradle.extensions.coreLibraryDesugaring
|
||||
import mihon.gradle.extensions.libs
|
||||
import mihon.gradle.extensions.mihonx
|
||||
import mihon.gradle.extensions.plugins
|
||||
import org.gradle.api.Plugin
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.kotlin.dsl.dependencies
|
||||
|
||||
@Suppress("UNUSED")
|
||||
class PluginAndroidBase : Plugin<Project> {
|
||||
override fun apply(target: Project): Unit = with(target) {
|
||||
plugins {
|
||||
alias(libs.plugins.kotlin.android)
|
||||
}
|
||||
|
||||
configureKotlin()
|
||||
configureTest()
|
||||
|
||||
android {
|
||||
defaultConfig {
|
||||
minSdk = mihonx.versions.android.sdk.min.get().toInt()
|
||||
if (this is ApplicationDefaultConfig) {
|
||||
targetSdk = mihonx.versions.android.sdk.target.get().toInt()
|
||||
}
|
||||
|
||||
ndkVersion = mihonx.versions.android.ndk.get()
|
||||
}
|
||||
|
||||
compileSdk = mihonx.versions.android.sdk.compile.get().toInt()
|
||||
|
||||
compileOptions {
|
||||
isCoreLibraryDesugaringEnabled = true
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
coreLibraryDesugaring(libs.android.desugar)
|
||||
}
|
||||
configureAndroid()
|
||||
}
|
||||
}
|
||||
|
||||
private fun CommonExtension.defaultConfig(block: DefaultConfig.() -> Unit) {
|
||||
defaultConfig.apply(block)
|
||||
}
|
||||
|
||||
private fun CommonExtension.compileOptions(block: CompileOptions.() -> Unit) {
|
||||
compileOptions.apply(block)
|
||||
}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import com.android.build.api.dsl.BuildFeatures
|
||||
import com.android.build.api.dsl.CommonExtension
|
||||
import mihon.gradle.extensions.alias
|
||||
import mihon.gradle.extensions.android
|
||||
import mihon.gradle.extensions.api
|
||||
@@ -33,7 +31,3 @@ class PluginComposeAndroid : Plugin<Project> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun CommonExtension.buildFeatures(block: BuildFeatures.() -> Unit) {
|
||||
buildFeatures.apply(block)
|
||||
}
|
||||
|
||||
@@ -1,44 +1,32 @@
|
||||
import com.android.build.api.dsl.KotlinMultiplatformAndroidLibraryTarget
|
||||
import mihon.gradle.configurations.configureAndroid
|
||||
import mihon.gradle.configurations.configureKotlin
|
||||
import mihon.gradle.extensions.alias
|
||||
import mihon.gradle.extensions.configureTest
|
||||
import mihon.gradle.extensions.coreLibraryDesugaring
|
||||
import mihon.gradle.extensions.libs
|
||||
import mihon.gradle.extensions.mihonx
|
||||
import mihon.gradle.extensions.plugins
|
||||
import org.gradle.api.Plugin
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.kotlin.dsl.configure
|
||||
import org.gradle.kotlin.dsl.dependencies
|
||||
import org.gradle.kotlin.dsl.withType
|
||||
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
|
||||
import kotlin.text.toInt
|
||||
|
||||
@Suppress("UNUSED")
|
||||
class PluginKotlinMultiplatform : Plugin<Project> {
|
||||
override fun apply(target: Project): Unit = with(target) {
|
||||
plugins {
|
||||
alias(libs.plugins.android.kmp.library)
|
||||
alias(libs.plugins.android.library)
|
||||
alias(libs.plugins.kotlin.multiplatform)
|
||||
}
|
||||
|
||||
configureKotlin()
|
||||
configureTest()
|
||||
configureAndroid()
|
||||
|
||||
kotlin {
|
||||
@OptIn(ExperimentalKotlinGradlePluginApi::class)
|
||||
applyDefaultHierarchyTemplate()
|
||||
|
||||
android {
|
||||
minSdk = mihonx.versions.android.sdk.min.get().toInt()
|
||||
compileSdk = mihonx.versions.android.sdk.compile.get().toInt()
|
||||
enableCoreLibraryDesugaring = true
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
coreLibraryDesugaring(libs.android.desugar)
|
||||
androidTarget()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -46,7 +34,3 @@ class PluginKotlinMultiplatform : Plugin<Project> {
|
||||
private fun Project.kotlin(block: KotlinMultiplatformExtension.() -> Unit) {
|
||||
extensions.configure(block)
|
||||
}
|
||||
|
||||
private fun KotlinMultiplatformExtension.android(block: KotlinMultiplatformAndroidLibraryTarget.() -> Unit) {
|
||||
targets.withType<KotlinMultiplatformAndroidLibraryTarget>().configureEach(block)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package mihon.gradle.configurations
|
||||
|
||||
import com.android.build.api.dsl.ApplicationDefaultConfig
|
||||
import mihon.gradle.extensions.android
|
||||
import mihon.gradle.extensions.coreLibraryDesugaring
|
||||
import mihon.gradle.extensions.libs
|
||||
import mihon.gradle.extensions.mihonx
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.kotlin.dsl.dependencies
|
||||
|
||||
fun Project.configureAndroid() {
|
||||
android {
|
||||
defaultConfig {
|
||||
minSdk = mihonx.versions.android.sdk.min.get().toInt()
|
||||
if (this is ApplicationDefaultConfig) {
|
||||
targetSdk = mihonx.versions.android.sdk.target.get().toInt()
|
||||
}
|
||||
|
||||
ndkVersion = mihonx.versions.android.ndk.get()
|
||||
}
|
||||
|
||||
compileSdk = mihonx.versions.android.sdk.compile.get().toInt()
|
||||
|
||||
compileOptions {
|
||||
isCoreLibraryDesugaringEnabled = true
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
coreLibraryDesugaring(libs.android.desugar)
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package mihon.gradle.extensions
|
||||
|
||||
import com.android.build.api.dsl.CommonExtension
|
||||
import com.android.build.gradle.BaseExtension
|
||||
import org.gradle.accessors.dm.LibrariesForLibs
|
||||
import org.gradle.accessors.dm.LibrariesForMihonx
|
||||
import org.gradle.api.Project
|
||||
@@ -18,8 +19,10 @@ internal fun Project.plugins(block: PluginManager.() -> Unit) {
|
||||
pluginManager.apply(block)
|
||||
}
|
||||
|
||||
internal fun Project.android(block: CommonExtension.() -> Unit) {
|
||||
extensions.configure(block)
|
||||
internal fun Project.android(block: CommonExtension<*, *, *, *, *, *>.() -> Unit) {
|
||||
extensions.configure<BaseExtension> {
|
||||
if (this is CommonExtension<*, *, *, *, *, *>) apply(block)
|
||||
}
|
||||
}
|
||||
|
||||
fun Project.configureTest() {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[versions]
|
||||
aboutLibraries = "14.0.0-b03"
|
||||
aboutLibraries = "13.2.1"
|
||||
android-desugar = "2.1.5"
|
||||
android-gradle = "9.1.0"
|
||||
android-gradle = "8.13.2"
|
||||
androidx-activity-compose = "1.13.0"
|
||||
androidx-annotation = "1.9.1"
|
||||
androidx-appCompat = "1.7.1"
|
||||
@@ -83,7 +83,7 @@ androidx-benchmark-macroJunit4 = { module = "androidx.benchmark:benchmark-macro-
|
||||
androidx-biometric = { module = "androidx.biometric:biometric-ktx", version.ref = "androidx-biometric" }
|
||||
androidx-compose-animation = { module = "androidx.compose.animation:animation" }
|
||||
androidx-compose-animationGraphics = { module = "androidx.compose.animation:animation-graphics" }
|
||||
androidx-compose-bom = { module = "androidx.compose:compose-bom-alpha", version.ref = "androidx-compose-bom" }
|
||||
androidx-compose-bom = { module = "androidx.compose:compose-bom-beta", version.ref = "androidx-compose-bom" }
|
||||
androidx-compose-foundation = { module = "androidx.compose.foundation:foundation" }
|
||||
androidx-compose-material3 = { module = "androidx.compose.material3:material3" }
|
||||
androidx-compose-materialIcons = { module = "androidx.compose.material:material-icons-extended" }
|
||||
@@ -186,11 +186,11 @@ xmlutil-serialization = { module = "io.github.pdvrieze.xmlutil:serialization", v
|
||||
[plugins]
|
||||
aboutLibraries = { id = "com.mikepenz.aboutlibraries.plugin.android", version.ref = "aboutLibraries" }
|
||||
android-application = { id = "com.android.application", version.ref = "android-gradle" }
|
||||
android-test = { id = "com.android.test", version.ref = "android-gradle" }
|
||||
android-kmp-library = { id = "com.android.kotlin.multiplatform.library", version.ref = "android-gradle" }
|
||||
android-library = { id = "com.android.library", version.ref = "android-gradle" }
|
||||
android-test = { id = "com.android.test", version.ref = "android-gradle" }
|
||||
firebase-crashlytics = { id = "com.google.firebase.crashlytics", version.ref = "firebase-crashlytics" }
|
||||
google-services = { id = "com.google.gms.google-services", version.ref = "google-services" }
|
||||
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin-gradle" }
|
||||
kotlin-compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin-gradle" }
|
||||
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin-gradle" }
|
||||
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin-gradle" }
|
||||
|
||||
@@ -11,9 +11,6 @@ plugins {
|
||||
kotlin {
|
||||
android {
|
||||
namespace = "tachiyomi.i18n"
|
||||
|
||||
// TODO(antsy): Remove when https://youtrack.jetbrains.com/issue/KT-83319 is resolved
|
||||
withHostTest { }
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalKotlinGradlePluginApi::class)
|
||||
|
||||
@@ -8,15 +8,12 @@ plugins {
|
||||
}
|
||||
|
||||
kotlin {
|
||||
@Suppress("UnstableApiUsage")
|
||||
android {
|
||||
namespace = "eu.kanade.tachiyomi.source"
|
||||
optimization {
|
||||
consumerKeepRules.file("consumer-proguard.pro")
|
||||
}
|
||||
|
||||
// TODO(antsy): Remove when https://youtrack.jetbrains.com/issue/KT-83319 is resolved
|
||||
withHostTest { }
|
||||
defaultConfig {
|
||||
consumerProguardFile("consumer-proguard.pro")
|
||||
}
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalKotlinGradlePluginApi::class)
|
||||
|
||||
@@ -8,9 +8,6 @@ plugins {
|
||||
kotlin {
|
||||
android {
|
||||
namespace = "tachiyomi.source.local"
|
||||
|
||||
// TODO(antsy): Remove when https://youtrack.jetbrains.com/issue/KT-83319 is resolved
|
||||
withHostTest { }
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalKotlinGradlePluginApi::class)
|
||||
|
||||
@@ -11,9 +11,9 @@ android {
|
||||
sourceSets {
|
||||
getByName("main") {
|
||||
if (Config.includeTelemetry) {
|
||||
kotlin.directories.add("src/firebase/kotlin")
|
||||
kotlin.srcDirs("src/firebase/kotlin")
|
||||
} else {
|
||||
kotlin.directories.add("src/noop/kotlin")
|
||||
kotlin.srcDirs("src/noop/kotlin")
|
||||
manifest.srcFile("src/noop/AndroidManifext.xml")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user