Closed christophsturm closed 4 years ago
A test project would be great.
here you are: https://github.com/christophsturm/mpp-test
./gradlew dependencyUpdates --info
I tried the following to capture the metadata but wasn't successful.
The kotlin plugin likes to refer to tasks by name to enhance them, which is brittle and not the "Gradle way". Instead they should do it by a matching condition and configure them during the init phase, so that copying captures the full definition. That may be at play here since we copy to rewrite the dependency versions, but they have a lot of code and it is complex, so I can't reverse engineer the cause at this time.
Can you get their developers to help us?
The variant guide indicates that us copying the attributes should work, but not in this case. Running :outgoingVariants
shows platform.type: js
but we do copy both configuration & dependency attributes, so this appears to be set. The exact magic to be MPP compatible escapes me...
I posted the link to this ticket on the kotlin slack and asked for help, but did not get a reaction. where in the plugin sourcecode would i need to start looking if i want to have a look myself?
hah, I got it!
Looking at the Kotlin plugin's code for commonMainMetadataElements
shows a dynamically added configuration that adds legacy metadata. By querying if it exists and extending it in the copy, your project resolves without any failures. This appears to be a legacy compatibility shim that we have to special case.
I'm doing some extra testing but so far it looks good.
Verified this also fixes @Vampire's setup-wsdl project where he had this problem, too.
I'll cut a release for 0.34, though it may take an hour or two for the jcenter => portal sync.
pretty cool!
I see the similar issue..
------------------------------------------------------------
: Project Dependency Updates (report to plain text file)
------------------------------------------------------------
The following dependencies are using the latest milestone version:
- com.github.ben-manes.versions:com.github.ben-manes.versions.gradle.plugin:0.46.0
- org.pitest:pitest-command-line:1.9.11
- org.pitest:pitest-junit5-plugin:1.1.2
- se.patrikerdes.use-latest-versions:se.patrikerdes.use-latest-versions.gradle.plugin:0.2.18
Failed to determine the latest version for the following dependencies (use --info for details):
- com.adarshr.test-logger:com.adarshr.test-logger.gradle.plugin
- com.approvaltests:approvaltests
- com.approvaltests:approvaltests-util
- com.fasterxml.jackson:jackson-bom
- com.fasterxml.jackson.core:jackson-databind
- com.groupcdg:pitest-annotations
- com.pholser:junit-quickcheck-core
- com.pholser:junit-quickcheck-generators
- de.sormuras.mainrunner:de.sormuras.mainrunner.api
- de.sormuras.mainrunner:de.sormuras.mainrunner.engine
- info.solidsoft.pitest:info.solidsoft.pitest.gradle.plugin
- io.cucumber:cucumber-bom
- io.cucumber:cucumber-java
- io.cucumber:cucumber-junit-platform-engine
- io.freefair.aspectj.post-compile-weaving:io.freefair.aspectj.post-compile-weaving.gradle.plugin
- junit:junit
- net.jqwik:jqwik
- org.aspectj:aspectjrt
- org.aspectj:aspectjweaver
- org.junit:junit-bom
- org.junit.jupiter:junit-jupiter
- org.junit.jupiter:junit-jupiter-engine
- org.junit.jupiter:junit-jupiter-params
- org.junit.platform:junit-platform-suite
- org.junit.support:testng-engine
- org.junit.vintage:junit-vintage-engine
- org.pitest:pitest
- org.testng:testng
Gradle release-candidate updates:
- Gradle: [8.1 -> 8.1.1]
May be it is unable to resolve for these kinds of bom dependencies
_dependencies { implementation(platform("org.junit:junit-bom:$jjVersion"))
implementation("org.junit.jupiter:junit-jupiter")
implementation("org.junit.jupiter:junit-jupiter-params")
implementation("org.junit.platform:junit-platform-suite")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
implementation("org.pitest:pitest:1.12.0")
implementation("com.groupcdg:pitest-annotations:1.0.7")
implementation("com.approvaltests:approvaltests:18.6.0")
implementation("com.approvaltests:approvaltests-util:18.6.0")
implementation("org.aspectj:aspectjrt:$ajcVersion")
implementation("org.aspectj:aspectjweaver:$ajcVersion")
implementation("net.jqwik:jqwik:1.7.3")
implementation("de.sormuras.mainrunner:de.sormuras.mainrunner.api:2.1.4")
implementation("de.sormuras.mainrunner:de.sormuras.mainrunner.engine:2.1.4")
implementation("junit:junit:4.13.2")
testRuntimeOnly("org.junit.vintage:junit-vintage-engine")
implementation("org.testng:testng:7.7.0")
testRuntimeOnly("org.junit.support:testng-engine:1.0.4")
implementation(platform("io.cucumber:cucumber-bom:7.11.2"))
implementation("io.cucumber:cucumber-java")
implementation("io.cucumber:cucumber-junit-platform-engine")
implementation(platform("com.fasterxml.jackson:jackson-bom:2.14.2"))
implementation("com.fasterxml.jackson.core:jackson-databind:2.14.2")
implementation("com.pholser:junit-quickcheck-core:1.0")
implementation("com.pholser:junit-quickcheck-generators:1.0")
}_
My plugins are
plugins {
id("java")
id("idea")
id("info.solidsoft.pitest") version ("1.9.11")
id("com.adarshr.test-logger") version "3.2.0"
id("io.freefair.aspectj.post-compile-weaving") version "8.0.1"
id("se.patrikerdes.use-latest-versions") version "0.2.18"
id("com.github.ben-manes.versions") version "0.46.0"
}
@nagkumar What is the exception with --info
? It is usually a configuration issue, but it can be a little painful to debug Gradle builds...
Thank You I ran it gain now.. everything works fine now.. looks like it is random, I shall further note this and let you know the info log when it happens again..
this is probably related to the two closed issues with the same exception, but its still occuring so I'm opening a new issue for it:
this probably happens with all kotlin mpp projects that use ktor-client-js or the kotlin react wrappers (https://github.com/JetBrains/kotlin-wrappers)
the exception is from one of my non open source projects but i can create a test project if needed.