Skip to content

Commit

Permalink
Merge branch 'master' into 2912-dokka-v2
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-dingemans authored Dec 29, 2024
2 parents 3309ab8 + e2c50f0 commit 6df05c0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 17 deletions.
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 gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ dokka = "org.jetbrains.dokka:dokka-gradle-plugin:2.0.0"
ec4j = "org.ec4j.core:ec4j-core:1.1.0"
logging = "io.github.oshai:kotlin-logging-jvm:7.0.3"
slf4j = "org.slf4j:slf4j-simple:2.0.16"
poko = "dev.drewhamilton.poko:poko-gradle-plugin:0.18.1"
poko = "dev.drewhamilton.poko:poko-gradle-plugin:0.18.2"
# Use logback-classic as the logger for kotlin-logging / slf4j as it allow changing the log level at runtime.
# TODO: Update "renovate.json" once logback-classic is updated to 1.4 (once java8 support for ktlint is dropped)
logback = "ch.qos.logback:logback-classic:1.3.14"
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

0 comments on commit 6df05c0

Please sign in to comment.