Prototype for project isolation - #256
Conversation
| import org.jetbrains.kotlin.gradle.dsl.* | ||
| import org.jetbrains.kotlin.gradle.plugin.* | ||
| import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget | ||
| import org.jetbrains.kotlin.gradle.plugin.mpp.pm20.util.libsDirectory |
There was a problem hiding this comment.
It looks like an unintended change
| @Test | ||
| fun `apiCheck should work for Apple-targets`() { | ||
| Assume.assumeTrue(HostManager().isEnabled(KonanTarget.MACOS_ARM64)) | ||
| // Assume.assumeTrue(HostManager().isEnabled(KonanTarget.MACOS_ARM64)) |
There was a problem hiding this comment.
Still need to do something with that.
| if (KotlinVersion.CURRENT.major > 2) { | ||
| dependencySet.add(project.dependencies.create("org.jetbrains.kotlin:kotlin-metadata-jvm:${KotlinVersion.CURRENT}")) | ||
| } else { | ||
| // use older 0.6.2 kotlinx metadata version for Kotlin < 2.0 |
There was a problem hiding this comment.
Not sure if we need it: kotlin-metadata-jvm should work fine with older Kotlin versions
| it.isCanBeDeclared = true | ||
| it.isVisible = false | ||
| it.defaultDependencies { | ||
| it.add(project.dependencies.create("org.jetbrains.kotlinx:kotlinx-metadata-jvm:0.6.2")) |
There was a problem hiding this comment.
It should be kotlin-metadata-jvm after merging with master
| inferAbi(parameters.target.get(), supportedTargetDumps, image).saveTo(parameters.outputAbiFile.asFile.get()) | ||
|
|
||
| // TODO: | ||
| /* |
There was a problem hiding this comment.
Need to enable logging back
| dependencySet.add(project.dependencies.create("org.ow2.asm:asm:9.6")) | ||
| dependencySet.add(project.dependencies.create("org.ow2.asm:asm-tree:9.6")) | ||
|
|
||
| if (KotlinVersion.CURRENT.major >= 2) { |
There was a problem hiding this comment.
As discussed in person, I would suggest instead of KotlinVersion.CURRENT using something like
val metadataDependencyVersion = project.objects.property(String::class.java).convention("2.0.0")
project.plugins.withType(KotlinBasePlugin::class.java) {
metadataDependencyVersion.set(project.getKotlinPluginVersion())
}
to be more safe against future versions of Kotlin.
KotlinVersion.CURRENT returns version of the stdlib in current runtime which depends on version of Gradle rather than KGP
There was a problem hiding this comment.
Unfortunately, we can't use getKotlinPluginVersion because BCV plugin and KGP may be placed in different classloaders.
I implemented workaround.
| it.isVisible = false | ||
|
|
||
| it.defaultDependencies { dependencySet -> | ||
| dependencySet.add(project.dependencies.create("org.jetbrains.kotlin:kotlin-compiler-embeddable:${KotlinVersion.CURRENT}")) |
There was a problem hiding this comment.
Here too, and here it is even more critical as it configures an incorrect compiler version. For example, on Gradle 7.6, it will configure 1.7.10
|
In general LGTM, thanks! |
|
|
||
| project.dependencies.add(dependencyConfiguration.name, "org.ow2.asm:asm:9.6") | ||
| project.dependencies.add(dependencyConfiguration.name, "org.ow2.asm:asm-tree:9.6") | ||
| project.dependencies.addProvider(dependencyConfiguration.name, metadataDependencyVersion.map { version -> "org.jetbrains.kotlin:kotlin-metadata-jvm:$version" }) |
There was a problem hiding this comment.
This method is available since Gradle 7.0, but the README states
Binary compatibility validator plugin requires Gradle 6.0 or newer.
But I guess that's fine for now. We in KGP going to drop support for Gradle 6 soon . anyway. So, I propose to update README to reflect the actual compatibility
No description provided.