Skip to content

Commit 04a1812

Browse files
committed
Rename kotlinCompilerEmbeddable to kotlinUseEmbeddableCompiler
1 parent bfdc9a9 commit 04a1812

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

kotlinlib/src/mill/kotlinlib/KotlinModule.scala

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,21 +106,27 @@ trait KotlinModule extends JavaModule { outer =>
106106
}
107107

108108
/**
109-
* Flag to use the embeddable kotlin compiler.
109+
* Flag to enable the use the embeddable kotlin compiler.
110110
* This can be necessary to avoid classpath conflicts or ensure
111111
* compatibility to the used set of plugins.
112112
*
113+
* The difference between the standard compiler and the embedded compiler is,
114+
* that the embedded compiler comes as a dependency-free JAR.
115+
* All its dependencies are shaded and thus relocated to different package names.
116+
* This also affects the compiler API, since relocated types may surface in the API
117+
* but are not compatible to their non-relocated versions.
118+
*
113119
* See also https://discuss.kotlinlang.org/t/kotlin-compiler-embeddable-vs-kotlin-compiler/3196
114120
*/
115-
def kotlinCompilerEmbeddable: Task[Boolean] = Task { false }
121+
def kotlinUseEmbeddableCompiler: Task[Boolean] = Task { false }
116122

117123
/**
118124
* The Ivy/Coursier dependencies resembling the Kotlin compiler.
119125
*
120-
* Default is derived from [[kotlinCompilerVersion]] and [[kotlinCompilerEmbeddable]].
126+
* Default is derived from [[kotlinCompilerVersion]] and [[kotlinUseEmbeddableCompiler]].
121127
*/
122128
def kotlinCompilerIvyDeps: T[Seq[Dep]] = Task {
123-
val useEmbeddable = kotlinCompilerEmbeddable()
129+
val useEmbeddable = kotlinUseEmbeddableCompiler()
124130
val kv = kotlinCompilerVersion()
125131
val isOldKotlin = Seq("1.0.", "1.1.", "1.2.0", "1.2.1", "1.2.2", "1.2.3", "1.2.4")
126132
.exists(prefix => kv.startsWith(prefix))
@@ -428,8 +434,8 @@ trait KotlinModule extends JavaModule { outer =>
428434
outer.kotlincOptions().filterNot(_.startsWith("-Xcommon-sources")) ++
429435
Seq(s"-Xfriend-paths=${outer.compile().classes.path.toString()}")
430436
}
431-
override def kotlinCompilerEmbeddable: Task[Boolean] =
432-
Task.Anon { outer.kotlinCompilerEmbeddable() }
437+
override def kotlinUseEmbeddableCompiler: Task[Boolean] =
438+
Task.Anon { outer.kotlinUseEmbeddableCompiler() }
433439
}
434440

435441
}

kotlinlib/src/mill/kotlinlib/ksp/KspModule.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ trait KspModule extends KotlinModule { outer =>
6868
)
6969
}
7070

71-
override def kotlinCompilerEmbeddable: Task[Boolean] = Task { true }
71+
override def kotlinUseEmbeddableCompiler: Task[Boolean] = Task { true }
7272

7373
/*
7474
* The symbol processing plugin id

kotlinlib/test/src/mill/kotlinlib/HelloKotlinTests.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ object HelloKotlinTests extends TestSuite {
2222
trait KotlinVersionCross extends KotlinModule with Cross.Module2[String, Boolean] {
2323
def kotlinVersion = crossValue
2424

25-
override def kotlinCompilerEmbeddable: Task[Boolean] = Task { crossValue2 }
25+
override def kotlinUseEmbeddableCompiler: Task[Boolean] = Task { crossValue2 }
2626

2727
override def mainClass = Some("hello.HelloKt")
2828

0 commit comments

Comments
 (0)