From 7f44b78e9e370d350ce3907f9a1db984e7bfc201 Mon Sep 17 00:00:00 2001 From: jeppeman Date: Sun, 22 Dec 2024 00:40:38 +0900 Subject: [PATCH] Downgrade source and targetCompatibility --- README.md | 2 +- build.gradle.kts | 25 ++++++++++++++----- integration-tests/android/build.gradle.kts | 5 ---- mockposable/build.gradle.kts | 25 ++++++++++++++----- mockposable/gradle.properties | 2 +- .../mockposable-compiler/build.gradle.kts | 5 ---- .../build.gradle.kts | 5 ---- 7 files changed, 40 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index b066cc7..6a4117c 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ buildscript { } dependencies { - classpath 'com.jeppeman.mockposable:mockposable-gradle:0.11' + classpath 'com.jeppeman.mockposable:mockposable-gradle:0.12' } } diff --git a/build.gradle.kts b/build.gradle.kts index 5637109..ae3e995 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -28,12 +28,6 @@ allprojects { google() } - tasks.withType().configureEach { - kotlinOptions { - jvmTarget = JvmTarget.JVM_21.target - } - } - tasks.withType(Test::class.java).configureEach { testLogging { exceptionFormat = TestExceptionFormat.FULL @@ -50,6 +44,25 @@ allprojects { ) } } + + tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile::class) { + kotlinOptions { + jvmTarget = JvmTarget.JVM_11.target + } + } + + tasks.withType(JavaCompile::class).configureEach { + sourceCompatibility = JavaVersion.VERSION_11.toString() + targetCompatibility = JavaVersion.VERSION_11.toString() + } + + plugins.withType(com.android.build.gradle.BasePlugin::class).configureEach { + val android = extensions.getByName("android") as com.android.build.gradle.BaseExtension + android.compileOptions { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + } + } } task("clean", Delete::class) { diff --git a/integration-tests/android/build.gradle.kts b/integration-tests/android/build.gradle.kts index d575950..e6f8e99 100644 --- a/integration-tests/android/build.gradle.kts +++ b/integration-tests/android/build.gradle.kts @@ -48,11 +48,6 @@ android { packagingOptions { resources.excludes.add("META-INF/LICENSE*") } - - compileOptions { - sourceCompatibility = JavaVersion.VERSION_21 - targetCompatibility = JavaVersion.VERSION_21 - } } dependencies { diff --git a/mockposable/build.gradle.kts b/mockposable/build.gradle.kts index c688c56..aaba985 100644 --- a/mockposable/build.gradle.kts +++ b/mockposable/build.gradle.kts @@ -28,12 +28,6 @@ allprojects { google() } - tasks.withType().configureEach { - kotlinOptions { - jvmTarget = JvmTarget.JVM_21.target - } - } - tasks.withType(Test::class.java).configureEach { testLogging { exceptionFormat = TestExceptionFormat.FULL @@ -51,6 +45,25 @@ allprojects { } } + tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile::class) { + kotlinOptions { + jvmTarget = JvmTarget.JVM_11.target + } + } + + tasks.withType(JavaCompile::class).configureEach { + sourceCompatibility = JavaVersion.VERSION_11.toString() + targetCompatibility = JavaVersion.VERSION_11.toString() + } + + plugins.withType(com.android.build.gradle.BasePlugin::class).configureEach { + val android = extensions.getByName("android") as com.android.build.gradle.BaseExtension + android.compileOptions { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + } + } + tasks.whenTaskAdded { if (name == "generateMetadataFileForAarPublication") { dependsOn("androidSourcesJar") diff --git a/mockposable/gradle.properties b/mockposable/gradle.properties index 5305d1e..5e9b975 100644 --- a/mockposable/gradle.properties +++ b/mockposable/gradle.properties @@ -1,4 +1,4 @@ -VERSION_NAME=0.12-SNAPSHOT +VERSION_NAME=0.13-SNAPSHOT GROUP=com.jeppeman.mockposable POM_DESCRIPTION=A tool that enables stubbing and verification of @Composable-annotated functions diff --git a/mockposable/mockposable-compiler/build.gradle.kts b/mockposable/mockposable-compiler/build.gradle.kts index 5679673..b0831da 100644 --- a/mockposable/mockposable-compiler/build.gradle.kts +++ b/mockposable/mockposable-compiler/build.gradle.kts @@ -15,11 +15,6 @@ plugins { id("com.google.devtools.ksp") } -java { - sourceCompatibility = JavaVersion.VERSION_21 - targetCompatibility = JavaVersion.VERSION_21 -} - dependencies { compileOnly(libs.kotlin.compiler) implementation(libs.autoservice.annotations) diff --git a/mockposable/mockposable-runtime/mockposable-runtime-composeui/build.gradle.kts b/mockposable/mockposable-runtime/mockposable-runtime-composeui/build.gradle.kts index b45eb0b..1b322e5 100644 --- a/mockposable/mockposable-runtime/mockposable-runtime-composeui/build.gradle.kts +++ b/mockposable/mockposable-runtime/mockposable-runtime-composeui/build.gradle.kts @@ -22,11 +22,6 @@ android { buildFeatures { compose = true } - - compileOptions { - sourceCompatibility = JavaVersion.VERSION_21 - targetCompatibility = JavaVersion.VERSION_21 - } } dependencies {