Skip to content

Commit

Permalink
Treat toolchain as input only for JVM tasks.
Browse files Browse the repository at this point in the history
Kotlin compiler for non-JVM tasks does not care about current JDK
version and should always produce same output disregard on
which JDK it is running on.

^KT-45611 In Progress
  • Loading branch information
Tapchicoma authored and Space committed Jun 11, 2021
1 parent a5e1ec9 commit 7d180b8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ abstract class KotlinCompileCommon @Inject constructor(
@get:Internal
internal val expectActualLinker = objects.property(Boolean::class.java)

@get:Internal
override val kotlinJavaToolchainProvider: Provider<KotlinJavaToolchainProvider>
get() = super.kotlinJavaToolchainProvider

override fun callCompilerAsync(args: K2MetadataCompilerArguments, sourceRoots: SourceRoots, changedFiles: ChangedFiles) {
val messageCollector = GradlePrintingMessageCollector(logger, args.allWarningsAsErrors)
val outputItemCollector = OutputItemsCollectorImpl()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ abstract class AbstractKotlinCompile<T : CommonCompilerArguments> : AbstractKotl

private val kotlinLogger by lazy { GradleKotlinLogger(logger) }

final override val kotlinJavaToolchainProvider: Provider<KotlinJavaToolchainProvider> =
override val kotlinJavaToolchainProvider: Provider<KotlinJavaToolchainProvider> =
objects.propertyWithNewInstance()

@get:Internal
Expand Down Expand Up @@ -716,6 +716,10 @@ abstract class Kotlin2JsCompile @Inject constructor(
@get:Internal
internal val absolutePathProvider = project.projectDir.absolutePath

@get:Internal
override val kotlinJavaToolchainProvider: Provider<KotlinJavaToolchainProvider>
get() = super.kotlinJavaToolchainProvider

override fun callCompilerAsync(args: K2JSCompilerArguments, sourceRoots: SourceRoots, changedFiles: ChangedFiles) {
sourceRoots as SourceRoots.KotlinOnly

Expand Down

0 comments on commit 7d180b8

Please sign in to comment.