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

Fix deprecations in build scripts #1473

Merged
merged 2 commits into from
Sep 1, 2024
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
23 changes: 10 additions & 13 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import io.gitlab.arturbosch.detekt.Detekt
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
alias(libs.plugins.android.app)
Expand All @@ -18,6 +18,13 @@ detekt {
autoCorrect = true
}

kotlin {
compilerOptions {
jvmTarget = JvmTarget.JVM_11
optIn.add("kotlin.RequiresOptIn")
}
}

android {
namespace = "org.jellyfin.mobile"
compileSdk = 34
Expand Down Expand Up @@ -82,10 +89,6 @@ android {
viewBinding = true
compose = true
}
kotlinOptions {
@Suppress("SuspiciousCollectionReassignment")
freeCompilerArgs += listOf("-Xopt-in=kotlin.RequiresOptIn")
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
Expand Down Expand Up @@ -175,12 +178,6 @@ dependencies {
}

tasks {
withType<KotlinCompile> {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.toString()
}
}

withType<Detekt> {
jvmTarget = JavaVersion.VERSION_11.toString()

Expand All @@ -202,9 +199,9 @@ tasks {
}

register("versionTxt") {
val path = buildDir.resolve("version.txt")

doLast {
val path = layout.buildDirectory.file("version.txt").get().asFile

val versionString = "v${android.defaultConfig.versionName}=${android.defaultConfig.versionCode}"
println("Writing [$versionString] to $path")
path.writeText("$versionString\n")
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ tasks.wrapper {
}

tasks.create<Delete>("clean") {
delete(rootProject.buildDir)
delete(rootProject.layout.buildDirectory)
}