Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test Kotlin 2.1.0-Beta2 in CI #411

Merged
merged 8 commits into from
Oct 18, 2024
Merged

Test Kotlin 2.1.0-Beta2 in CI #411

merged 8 commits into from
Oct 18, 2024

Conversation

drewhamilton
Copy link
Owner

Tests compatibility of current Poko main branch with the new Kotlin beta version.

@drewhamilton drewhamilton force-pushed the drew/test-kotlin-2.1.0 branch from 7edbc63 to 05b6e0d Compare October 15, 2024 18:25
@drewhamilton drewhamilton changed the title Test Kotlin 2.1.0-Beta1 in CI Test Kotlin 2.1.0-Beta2 in CI Oct 15, 2024
@drewhamilton
Copy link
Owner Author

java.lang.NoSuchMethodError: 'org.gradle.api.provider.Property org.jetbrains.kotlin.gradle.dsl.KotlinCommonCompilerToolOptions.getExtraWarnings()'

This is thrown with 2.1.0-Beta2. I think this means we just won't be able to make 2.1 and 2.0 compatible, much like 2.0 and 1.9. Unless there's some Gradle magic we can do?

@JakeWharton
Copy link
Collaborator

That stack trace is weird. Isn't it KGP calling into itself that is causing the exception? Are there two KGPs on the Gradle classpath or something?

@JakeWharton
Copy link
Collaborator

This code:

create("libs") {
from(files("../gradle/libs.versions.toml"))
// Compile sample project with different Kotlin version than Poko, if provided:
val kotlinVersionOverride = System.getenv()["poko_sample_kotlin_version"]?.nullIfBlank()
kotlinVersionOverride?.let { kotlinVersion ->
version("kotlin", kotlinVersion)
}
}

Needs to also live here:

create("libs") {
from(files("../../gradle/libs.versions.toml"))
}

Otherwise the buildSrc uses the enclosing project's libs.version.toml's KGP, whereas the sample itself uses the overridden KGP. This puts two copies onto the buildscript classpath which can cause a split-brain problem with classes from both being loaded at the same time producing otherwise impossible NSMEs and NCDFEs.

@JakeWharton
Copy link
Collaborator

I can send a PR for that later, if you don't get to it first.

@drewhamilton
Copy link
Owner Author

Ouch. Good find, fixed.

@drewhamilton drewhamilton force-pushed the drew/test-kotlin-2.1.0 branch from 05288fd to 0ad5384 Compare October 17, 2024 23:19
@drewhamilton drewhamilton force-pushed the drew/test-kotlin-2.1.0 branch from 0ad5384 to f69fe92 Compare October 17, 2024 23:21
@drewhamilton drewhamilton merged commit ae956a5 into main Oct 18, 2024
8 checks passed
@drewhamilton drewhamilton deleted the drew/test-kotlin-2.1.0 branch October 18, 2024 02:50
drewhamilton added a commit that referenced this pull request Oct 18, 2024
The fix that Jake found in #411 may result in these tests passing now.
drewhamilton added a commit that referenced this pull request Oct 18, 2024
* Re-add sample tests against 2.0.0 and 2.0.10

The fix that Jake found in #411 may result in these tests passing now.

* Fix support for 2.0.0 consumers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants