Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
0254c2f
Updated to the latest Kotlin dev version
nikpachoo Aug 4, 2025
845cc9e
KT-80320 Removed -Wextra and -Xuse-fir-experimental-checkers CLI opti…
dkrasnoff Aug 21, 2025
4d44bfe
Updated kotlin version to the latest dev
dkrasnoff Aug 21, 2025
5d3d2bc
Updated kotlin version to the latest dev
berezinant Sep 2, 2025
41e3fb9
chore: update Kotlin to 2.3.0-dev-6977
nikpachoo Sep 9, 2025
30df5f9
fix: update test output
nikpachoo Sep 9, 2025
919824b
KTL-3738: Updated kotlin dev version
dkrasnoff Sep 30, 2025
376770e
KTL-3738: Fixed compilation after js compiler updates in kotlin repo
dkrasnoff Sep 30, 2025
0744de2
KTL-1220: Removed indexation module and kotlin idea dependencies
dkrasnoff Aug 7, 2025
7b0f76d
KTL-1220: Removed dev repositories
dkrasnoff Aug 7, 2025
7f11d22
Added running build with dev repository for kotlin-community/* branches
dkrasnoff Aug 7, 2025
67d19bb
KTL-1220: Ignored tests connected to completion.
dkrasnoff Aug 8, 2025
a0f022e
KTL-1220: Removed idea dependencies from dependabot ignore list
dkrasnoff Aug 8, 2025
4f2f724
KTL-1220: Removed jdk7 and jdk8 stdlib dependencies
dkrasnoff Aug 13, 2025
6a5cba7
Returned dev repository back for running kotlin-community branch
dkrasnoff Oct 7, 2025
d796c91
KTL-3739 Changed -XXLanguage:+ExplicitBackingFields to -Xexplicit-bac…
dkrasnoff Oct 7, 2025
00a1ccb
Remove unnecessary version fields
dkrasnoff Aug 29, 2025
f2ff86a
KTL-724 Added compiler arguments support
dkrasnoff Aug 29, 2025
e1b4e20
KTL-724 Removed unnecessary js and wasm arguments from the whitelist
dkrasnoff Oct 14, 2025
ec4cf75
KTL-2973 Deprecated old compilation endpoint.
dkrasnoff Oct 16, 2025
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
3 changes: 0 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,8 @@ updates:
- dependency-name: "org.jetbrains.kotlin:kotlin-compiler"
- dependency-name: "org.jetbrains.kotlin:kotlin-reflect"
- dependency-name: "org.jetbrains.kotlin:kotlin-stdlib-js"
- dependency-name: "org.jetbrains.kotlin:kotlin-compiler-for-ide"
- dependency-name: "org.jetbrains.kotlin:kotlin-stdlib"
- dependency-name: "org.jetbrains.kotlin:kotlin-script-runtime"
- dependency-name: "org.jetbrains.kotlin:ide"
- dependency-name: "org.jetbrains.kotlin:idea"
- dependency-name: "org.jetbrains.kotlin:kotlin-test"
- dependency-name: "org.jetbrains.kotlin:core"
- dependency-name: "org.jetbrains.kotlin:common"
Expand Down
4 changes: 0 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ COPY --from=build /kotlin-compiler-server/${KOTLIN_LIB_WASM} /kotlin-compiler-se
COPY --from=build /kotlin-compiler-server/${KOTLIN_LIB_COMPOSE_WASM} /kotlin-compiler-server/${KOTLIN_LIB_COMPOSE_WASM}
COPY --from=build /kotlin-compiler-server/${KOTLIN_COMPOSE_WASM_COMPILER_PLUGINS} /kotlin-compiler-server/${KOTLIN_COMPOSE_WASM_COMPILER_PLUGINS}
COPY --from=build /kotlin-compiler-server/executor.policy /kotlin-compiler-server/
COPY --from=build /kotlin-compiler-server/indexes.json /kotlin-compiler-server/
COPY --from=build /kotlin-compiler-server/indexesJs.json /kotlin-compiler-server/
COPY --from=build /kotlin-compiler-server/indexesWasm.json /kotlin-compiler-server/
COPY --from=build /kotlin-compiler-server/indexesComposeWasm.json /kotlin-compiler-server/

ENV PORT=8080

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ pluginManagement {
repositories {
gradlePluginPortal()
mavenCentral()
mavenLocal()

val additionalRepositoryProperty = providers.gradleProperty("kotlin_repo_url")
if (additionalRepositoryProperty.isPresent) {
Expand All @@ -11,9 +10,8 @@ pluginManagement {
}
logger.info("A custom Kotlin repository ${additionalRepositoryProperty.get()} was added")
}

maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap")
maven("https://redirector.kotlinlang.org/maven/dev")
mavenLocal()
}
}

Expand All @@ -22,7 +20,6 @@ dependencyResolutionManagement {
repositories {
mavenCentral()
gradlePluginPortal()
mavenLocal()

val additionalRepositoryProperty = providers.gradleProperty("kotlin_repo_url")
if (additionalRepositoryProperty.isPresent) {
Expand All @@ -31,18 +28,8 @@ dependencyResolutionManagement {
}
logger.info("A custom Kotlin repository ${additionalRepositoryProperty.get()} was added")
}

maven("https://repo.spring.io/snapshot")
maven("https://repo.spring.io/milestone")
maven("https://redirector.kotlinlang.org/maven/kotlin-ide")
maven("https://redirector.kotlinlang.org/maven/dev")
maven("https://cache-redirector.jetbrains.com/jetbrains.bintray.com/intellij-third-party-dependencies")
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/kotlin-ide-plugin-dependencies")
maven("https://www.myget.org/F/rd-snapshots/maven/")
maven("https://redirector.kotlinlang.org/maven/kotlin-ide")
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap")
maven("https://maven.pkg.jetbrains.space/kotlin/p/wasm/experimental")
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
mavenLocal()
}

versionCatalogs {
Expand Down
50 changes: 26 additions & 24 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ version = "${libs.versions.kotlin.get()}-SNAPSHOT"
val propertyFile = "application.properties"

plugins {
alias(libs.plugins.spring.dependency.management)
alias(libs.plugins.spring.boot)
alias(libs.plugins.spring.dependency.management)
alias(libs.plugins.kotlin.plugin.spring)
id("base-kotlin-jvm-conventions")
}
Expand All @@ -25,9 +25,6 @@ allprojects {
dependencies {
dependencies {
implementation(libs.jackson.module.kotlin)
implementation(libs.kotlin.idea) {
isTransitive = false
}
}
}
}
Expand All @@ -39,24 +36,24 @@ val resourceDependency: Configuration by configurations.creating {
}

dependencies {
annotationProcessor("org.springframework:spring-context-indexer")
implementation("com.google.code.gson:gson")
annotationProcessor(libs.spring.context.indexer)
implementation("org.springframework.boot:spring-boot-starter-web")
implementation(libs.springdoc)
implementation("org.springframework.boot:spring-boot-starter-validation")
implementation(libs.aws.springboot.container)
implementation(libs.springdoc)
implementation(libs.gson)
implementation(libs.kotlinx.serialization.json)
implementation(libs.kotlin.compiler.arguments.description)
implementation(libs.kotlin.tooling.core)
implementation(libs.junit)
implementation(libs.logback.logstash.encoder)
implementation(libs.intellij.trove4j)
implementation(libs.kotlin.reflect)
implementation(libs.bundles.kotlin.stdlib)
implementation(libs.kotlin.stdlib)
implementation(libs.kotlin.compiler)
implementation(libs.kotlin.script.runtime)
implementation(libs.kotlin.compiler.ide) {
isTransitive = false
}
implementation(libs.kotlin.core)
implementation(project(":executors", configuration = "default"))
implementation(project(":common", configuration = "default"))
implementation(project(":dependencies"))

testImplementation(libs.kotlin.test)
testImplementation("org.springframework.boot:spring-boot-starter-test") {
Expand All @@ -77,12 +74,10 @@ fun buildPropertyFile() {

fun generateProperties(prefix: String = "") = """
# this file is autogenerated by build.gradle.kts
server.error.include-message=always
server.error.include-binding-errors=always
kotlin.version=${kotlinVersion}
policy.file=${prefix + policy}
indexes.file=${prefix + indexes}
indexesJs.file=${prefix + indexesJs}
indexesWasm.file=${prefix + indexesWasm}
indexesComposeWasm.file=${prefix + indexesComposeWasm}
libraries.folder.jvm=${prefix + libJVM}
libraries.folder.js=${prefix + libJS}
libraries.folder.wasm=${prefix + libWasm}
Expand All @@ -97,10 +92,12 @@ fun generateProperties(prefix: String = "") = """

tasks.withType<KotlinCompile> {
compilerOptions {
freeCompilerArgs.set(listOf("-Xjsr305=strict"))
freeCompilerArgs.addAll(
"-Xjsr305=strict",
)

}
dependsOn(":executors:jar")
dependsOn(":indexation:run")
buildPropertyFile()
}
println("Using Kotlin compiler ${libs.versions.kotlin.get()}")
Expand All @@ -123,15 +120,11 @@ val buildLambda by tasks.creating(Zip::class) {
}
}
from(policy)
from(indexes)
from(indexesJs)
from(indexesWasm)
from(indexesComposeWasm)
from(libJSFolder) { into(libJS) }
from(libWasmFolder) { into(libWasm) }
from(libComposeWasmFolder) { into(libComposeWasm) }
from(libJVMFolder) { into(libJVM) }
from(compilerPluginsForJVMFolder) {into(compilerPluginsForJVM)}
from(compilerPluginsForJVMFolder) { into(compilerPluginsForJVM) }
from(libComposeWasmCompilerPluginsFolder) { into(libComposeWasmCompilerPlugins) }
into("lib") {
from(configurations.compileClasspath) { exclude("tomcat-embed-*") }
Expand Down Expand Up @@ -160,4 +153,13 @@ tasks.withType<Test> {
doFirst {
this@withType.environment("kotlin.wasm.node.path", executablePath)
}

// We disable this on TeamCity, because we don't want to fail this test,
// when compiler server's test run as a K2 user project.
// But for our pull requests we still need to run this test, so we add it to our GitHub action.
if (System.getenv("TEAMCITY_VERSION") != null) {
filter {
excludeTestsMatching("com.compiler.server.CompilerArguments*")
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach
freeCompilerArgs.addAll(
"-Xreport-all-warnings",
"-Xrender-internal-diagnostic-names",
"-Xuse-fir-experimental-checkers"
"-Xuse-fir-experimental-checkers",
"-Xannotation-default-target=param-property"
)

allWarningsAsErrors.set(false)
extraWarnings.set(true)

// Adding additional cli options for testing purpose
project.providers.gradleProperty("kotlin_additional_cli_options").orNull?.let { options ->
Expand Down
2 changes: 0 additions & 2 deletions common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@ plugins {

dependencies {
implementation(libs.kotlin.compiler)
implementation(libs.kotlin.gradle.plugin.idea)
implementation(libs.kotlin.base.fe10.analysis)
}
100 changes: 5 additions & 95 deletions common/src/main/kotlin/component/KotlinEnvironment.kt
Original file line number Diff line number Diff line change
@@ -1,27 +1,6 @@
package component

import com.intellij.openapi.util.Disposer
import org.jetbrains.kotlin.cli.common.arguments.K2JVMCompilerArguments
import org.jetbrains.kotlin.cli.common.arguments.parseCommandLineArguments
import org.jetbrains.kotlin.cli.common.arguments.toLanguageVersionSettings
import org.jetbrains.kotlin.cli.common.messages.MessageCollector
import org.jetbrains.kotlin.cli.jvm.compiler.EnvironmentConfigFiles
import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment
import org.jetbrains.kotlin.cli.jvm.config.addJvmClasspathRoots
import org.jetbrains.kotlin.cli.jvm.config.configureJdkClasspathRoots
import org.jetbrains.kotlin.cli.jvm.configureAdvancedJvmOptions
import org.jetbrains.kotlin.cli.jvm.plugins.PluginCliParser
import org.jetbrains.kotlin.config.CommonConfigurationKeys
import org.jetbrains.kotlin.config.CompilerConfiguration
import org.jetbrains.kotlin.config.JVMConfigurationKeys
import org.jetbrains.kotlin.config.languageVersionSettings
import org.jetbrains.kotlin.js.config.JSConfigurationKeys
import org.jetbrains.kotlin.library.impl.isKotlinLibrary
import org.jetbrains.kotlin.serialization.js.JsModuleDescriptor
import org.jetbrains.kotlin.serialization.js.KotlinJavascriptSerializationUtil
import org.jetbrains.kotlin.serialization.js.ModuleKind
import org.jetbrains.kotlin.utils.KotlinJavascriptMetadataUtils
import org.jetbrains.kotlin.wasm.config.WasmConfigurationKeys
import java.io.File

// NOTE: if new class paths are added, please add them to `JavaExec` task's inputs in build.gradle.kts as well
Expand Down Expand Up @@ -56,18 +35,10 @@ class KotlinEnvironment(
"-Xnested-type-aliases",
"-Xreport-all-warnings",
"-Wextra",
"-XXLanguage:+ExplicitBackingFields",
"-Xexplicit-backing-fields",
)
}

val JS_METADATA_CACHE =
additionalJsClasspath.flatMap {
KotlinJavascriptMetadataUtils.loadMetadata(it.absolutePath).map { metadata ->
val parts = KotlinJavascriptSerializationUtil.readModuleAsProto(metadata.body, metadata.version)
JsModuleDescriptor(metadata.moduleName, parts.kind, parts.importedModules, parts)
}
}

val JS_LIBRARIES = additionalJsClasspath
.map { it.absolutePath }
.filter { isKotlinLibrary(File(it)) }
Expand All @@ -83,70 +54,9 @@ class KotlinEnvironment(
val composeWasmCompilerPluginOptions = composeWasmCompilerPluginsOptions
.map { "plugin:${it.id}:${it.option}=${it.value}" }

@Synchronized
fun <T> environment(f: (KotlinCoreEnvironment) -> T): T {
return f(environment)
}

private val configuration = createConfiguration()
val jsConfiguration: CompilerConfiguration = configuration.copy().apply {
put(CommonConfigurationKeys.MODULE_NAME, "playground")
put(JSConfigurationKeys.MODULE_KIND, ModuleKind.PLAIN)
put(JSConfigurationKeys.LIBRARIES, JS_LIBRARIES)
}

val wasmConfiguration: CompilerConfiguration = configuration.copy().apply {
put(CommonConfigurationKeys.MODULE_NAME, "playground")
put(JSConfigurationKeys.LIBRARIES, WASM_LIBRARIES)
put(WasmConfigurationKeys.WASM_ENABLE_ARRAY_RANGE_CHECKS, false)
put(WasmConfigurationKeys.WASM_ENABLE_ASSERTS, false)
}

val rootDisposable = Disposer.newDisposable()

val composeWasmConfiguration: CompilerConfiguration = configuration.copy().apply {
put(CommonConfigurationKeys.MODULE_NAME, "playground")
put(JSConfigurationKeys.LIBRARIES, COMPOSE_WASM_LIBRARIES)
put(WasmConfigurationKeys.WASM_ENABLE_ARRAY_RANGE_CHECKS, false)
put(WasmConfigurationKeys.WASM_ENABLE_ASSERTS, false)

PluginCliParser.loadPluginsSafe(
COMPOSE_WASM_COMPILER_PLUGINS,
composeWasmCompilerPluginOptions,
emptyList<String>(),
this,
rootDisposable
)
}

private val environment = KotlinCoreEnvironment.createForProduction(
projectDisposable = rootDisposable,
configuration = configuration.copy(),
configFiles = EnvironmentConfigFiles.JVM_CONFIG_FILES
)

private fun createConfiguration(): CompilerConfiguration {
val arguments = K2JVMCompilerArguments()
parseCommandLineArguments(additionalCompilerArguments, arguments)
return CompilerConfiguration().apply {
addJvmClasspathRoots(classpath.filter { it.exists() && it.isFile && it.extension == "jar" })
val messageCollector = MessageCollector.NONE
put(CommonConfigurationKeys.MESSAGE_COLLECTOR_KEY, messageCollector)
put(CommonConfigurationKeys.MODULE_NAME, "web-module")
put(JSConfigurationKeys.PROPERTY_LAZY_INITIALIZATION, true)

languageVersionSettings = arguments.toLanguageVersionSettings(messageCollector)

// it uses languageVersionSettings that was set above
configureAdvancedJvmOptions(arguments)
put(JVMConfigurationKeys.DO_NOT_CLEAR_BINDING_CONTEXT, true)

configureJdkClasspathRoots()
val jdkHome = get(JVMConfigurationKeys.JDK_HOME)
if (jdkHome == null) {
val javaHome = File(System.getProperty("java.home"))
put(JVMConfigurationKeys.JDK_HOME, javaHome)
}
@Synchronized
fun <T> synchronize(f: () -> T): T {
return f()
}
}

}
13 changes: 10 additions & 3 deletions dependencies/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ val composeWasmCompilerPlugins: Configuration by configurations.creating {
isTransitive = false
}

val composeRuntimeVersion = "1.6.0"

val copyDependencies by tasks.creating(Copy::class) {
from(kotlinDependency)
into(libJVMFolder)
Expand Down Expand Up @@ -105,7 +103,7 @@ dependencies {
kotlinDependency(libs.hamcrest)
kotlinDependency(libs.bundles.jackson)
// Kotlin libraries
kotlinDependency(libs.bundles.kotlin.stdlib)
kotlinDependency(libs.kotlin.stdlib)
kotlinDependency(libs.kotlin.test)
kotlinDependency(libs.kotlin.test.junit)
kotlinDependency(libs.kotlinx.coroutines.core.jvm)
Expand All @@ -125,4 +123,13 @@ dependencies {
kotlinComposeWasmDependency(libs.bundles.compose)

composeWasmCompilerPlugins(libs.kotlin.compose.compiler.plugin)
}

project.tasks.jar.configure {
dependsOn(copyDependencies)
dependsOn(copyCompilerPluginDependencies)
dependsOn(copyJSDependencies)
dependsOn(copyWasmDependencies)
dependsOn(copyComposeWasmDependencies)
dependsOn(copyComposeWasmCompilerPlugins)
}
4 changes: 0 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
systemProp.policy=executor.policy
systemProp.indexes=indexes.json
systemProp.indexesJs=indexesJs.json
systemProp.indexesWasm=indexesWasm.json
systemProp.indexesComposeWasm=indexesComposeWasm.json

org.gradle.configuration-cache=true
Loading