Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update project/library JVM target to 11 #323

Merged
merged 1 commit into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@ android {
versionName = Configuration.versionName
multiDexEnabled = true
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
}

dependencies {
Expand Down
2 changes: 1 addition & 1 deletion benchmark-landscapist-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ android {
compileSdk = Configuration.compileSdk
defaultConfig {
applicationId = "com.skydoves.benchmark.landscapist.app"
minSdk = 23
minSdk = 24
targetSdk = Configuration.targetSdk
versionCode = Configuration.versionCode
versionName = Configuration.versionName
Expand Down
4 changes: 2 additions & 2 deletions benchmark-landscapist/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ android {
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

targetProjectPath = ":benchmark-landscapist-app"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ import com.skydoves.landscapist.configureKotlinAndroid
import com.skydoves.landscapist.kotlinOptions
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.artifacts.VersionCatalogsExtension
import org.gradle.api.tasks.compile.JavaCompile
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.dependencies
import org.gradle.kotlin.dsl.getByType

class AndroidLibraryComposeConventionPlugin : Plugin<Project> {
override fun apply(target: Project) {
Expand All @@ -41,6 +44,12 @@ class AndroidLibraryComposeConventionPlugin : Plugin<Project> {
}
}

val libs = extensions.getByType<VersionCatalogsExtension>().named("libs")
tasks.withType(JavaCompile::class.java).configureEach {
this.targetCompatibility = libs.findVersion("jvmTarget").get().toString()
this.sourceCompatibility = libs.findVersion("jvmTarget").get().toString()
}

dependencies {
add("baselineProfile", project(":benchmark-landscapist"))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import org.gradle.api.JavaVersion
import org.gradle.api.Project
import org.gradle.api.artifacts.VersionCatalogsExtension
import org.gradle.api.plugins.ExtensionAware
import org.gradle.api.tasks.compile.JavaCompile
import org.gradle.kotlin.dsl.dependencies
import org.gradle.kotlin.dsl.getByType
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptions
Expand All @@ -38,8 +39,8 @@ internal fun Project.configureKotlinAndroid(
commonExtension.apply {

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

kotlinOptions {
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[versions]
kotlin = "1.9.0"
dokka = "1.8.20"
jvmTarget = "17"
jvmTarget = "11"
nexusPlugin = "1.3.0"
kotlinxCoroutines = "1.7.2"
kotlinBinaryCompatibility = "0.13.2"
Expand Down
Loading