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

Deprecations in 1.5.0 #2913

Merged
merged 3 commits into from
Dec 27, 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
15 changes: 0 additions & 15 deletions build-logic/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
`kotlin-dsl`
}
Expand All @@ -20,18 +17,6 @@ kotlin {
)
}

// TODO: Remove setting `options.release` and `compilerOptions.jvmTarget` after upgrade to Kotlin Gradle Plugin 1.9
// build-logic is an internal project and given we know how the "actual" project is built - it's fine to target current java here as well.
// @see https://github.com/pinterest/ktlint/pull/2120#discussion_r1260229055 for more details
val buildLogicTargetJavaVersion = JavaVersion.VERSION_17
tasks.withType<JavaCompile>().configureEach {
options.release = buildLogicTargetJavaVersion.majorVersion.toInt()
}
tasks.withType<KotlinCompile>().configureEach {
// Convert Java version (e.g. "1.8" or "11") to Kotlin JvmTarget ("8" resp. "11")
compilerOptions.jvmTarget = JvmTarget.fromTarget(buildLogicTargetJavaVersion.toString())
}

dependencies {
val kotlinPlugin =
if (hasProperty("kotlinDev")) {
Expand Down
2 changes: 1 addition & 1 deletion build-logic/src/main/kotlin/ktlint-dokka.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ java {

tasks.dokkaJavadoc {
notCompatibleWithConfigurationCache("https://github.com/Kotlin/dokka/issues/1217")
outputDirectory = buildDir.resolve("javadoc")
outputDirectory = layout.buildDirectory.dir("javadoc")
}

tasks.named<Jar>("javadocJar") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import org.jetbrains.kotlin.com.intellij.pom.PomTransaction
import org.jetbrains.kotlin.com.intellij.pom.impl.PomTransactionBase
import org.jetbrains.kotlin.com.intellij.pom.tree.TreeAspect
import org.jetbrains.kotlin.com.intellij.psi.PsiFileFactory
import org.jetbrains.kotlin.config.CommonConfigurationKeys
import org.jetbrains.kotlin.config.CompilerConfiguration
import sun.reflect.ReflectionFactory
import java.nio.file.Files
Expand All @@ -40,7 +41,7 @@ internal fun initPsiFileFactory(ktLintRuleEngine: KtLintRuleEngine): PsiFileFact
DiagnosticLogger.setFactory(LoggerFactory::class.java)

val compilerConfiguration = CompilerConfiguration()
compilerConfiguration.put(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY, MessageCollector.NONE)
compilerConfiguration.put(CommonConfigurationKeys.MESSAGE_COLLECTOR_KEY, MessageCollector.NONE)
// Special workaround on JDK 1.8 when KtLint is used from shipped CLI
// to prevent Kotlin compiler initialization error
if (ktLintRuleEngine.isInvokedFromCli && System.getProperty("java.specification.version") == "1.8") {
Expand Down
Loading