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

Kotlin 2.0.20 breaks patcher in fork #254

Open
scrayos opened this issue Aug 23, 2024 · 0 comments
Open

Kotlin 2.0.20 breaks patcher in fork #254

scrayos opened this issue Aug 23, 2024 · 0 comments

Comments

@scrayos
Copy link

scrayos commented Aug 23, 2024

I've added the kotlin(jvm) gradle plugin through api and server patches in my fork of Paper. This worked fine for every version I included so far, but did break now that I've bumped Kotlin to version 2.0.20 (from 2.0.0). This is the error message when I execute ./gradlew generateDevelopmentBundle:

> Configure project :
paperweight-patcher v1.7.2 (running on 'Linux')

> Configure project :paper
paperweight-core v1.7.1 (running on 'Linux')

> Task :generateDevelopmentBundle
Using 'diff (GNU diffutils) 3.10'.

> Task :generateDevelopmentBundle FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':generateDevelopmentBundle'.
> Collection contains no element matching the predicate.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 1m 28s
24 actionable tasks: 16 executed, 5 from cache, 3 up-to-date

When I executed this with --stacktrace it was printing this stacktrace:

Caused by: java.util.NoSuchElementException: Collection contains no element matching the predicate.
        at io.papermc.paperweight.tasks.GenerateDevBundle.determineLibraries(GenerateDevBundle.kt:403)
        at io.papermc.paperweight.tasks.GenerateDevBundle.createBuildDataConfig(GenerateDevBundle.kt:279)
        at io.papermc.paperweight.tasks.GenerateDevBundle.createBundleConfig(GenerateDevBundle.kt:265)
        at io.papermc.paperweight.tasks.GenerateDevBundle.run(GenerateDevBundle.kt:145)

These seem to be the lines in question:

            val version = listOfNotNull(
                dependency.versionConstraint.strictVersion,
                dependency.versionConstraint.requiredVersion,
                dependency.versionConstraint.preferredVersion,
                dependency.version
            ).first { it.isNotBlank() }

So it's probably something about the injected dependencies of Kotlin. I'm using paperweight.patcher version 1.7.2 and use upstream commit PaperMC/Paper@2fdb2e9 (latest).

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

No branches or pull requests

1 participant