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

Upgrade to Gradle 8.0 #755

Merged
merged 6 commits into from Feb 16, 2023
Merged

Upgrade to Gradle 8.0 #755

merged 6 commits into from Feb 16, 2023

Conversation

lukellmann
Copy link
Member

@lukellmann lukellmann commented Feb 13, 2023

The changes in gradle-wrapper.jar, gradle-wrapper.properties and gradlew are the result of running this command twice:

./gradlew wrapper --gradle-version 8.0 --gradle-distribution-sha256-sum f30b29580fe11719087d698da23f3b0f0d04031d8995f7dd8275a31f7674dc01

While touching the build files, the following was also done:

Running the dokkaHtmlMultiModule task is not possible with Dokka 1.7.20 and Gradle 8.0 due to Kotlin/dokka#2796. This will prevent us from publishing Dokka docs until a fix is released. - Using dev build instead.

The changes in gradle-wrapper.jar, gradle-wrapper.properties and gradlew
are the result of running this command twice:
./gradlew wrapper --gradle-version 8.0 --gradle-distribution-sha256-sum
f30b29580fe11719087d698da23f3b0f0d04031d8995f7dd8275a31f7674dc01

While touching the build files, the following was also done:

 * use Java toolchains, see
   https://kotlinlang.org/docs/gradle-configure-project.html#gradle-java-toolchains-support

 * use the new compilerOptions DSL introduced in Kotlin 1.8.0, see
   https://kotlinlang.org/docs/whatsnew18.html#exposing-kotlin-compiler-options-as-gradle-lazy-properties

Running the dokkaHtmlMultiModule task is not possible with Dokka 1.7.20
and Gradle 8.0 due to Kotlin/dokka#2796. This
will prevent us from publishing Dokka docs until a fix is released.
withType<TaskType> { ... } creates tasks eagerly and should be replaced
by withType<TaskType>().configureEach { ... }, see
https://docs.gradle.org/current/userguide/task_configuration_avoidance.html#sec:old_vs_new_configuration_api_overview

For some strange reason this approach fails with a
ConcurrentModificationException when used for
withType<KotlinCompile>().configureEach { ... } but only inside of
kord-module.gradle.kts.
@lukellmann
Copy link
Member Author

lukellmann commented Feb 15, 2023

Do you have any idea why the build fails with a ConcurrentModificationException when this line is replaced with withType<KotlinCompile>().configureEach {?
It doesn't fail here...

We need to move that step down in order, because Gradle will fail with a ConcurrentModificationException during task dependency calculation otherwise
@lukellmann
Copy link
Member Author

Do you have any idea why the build fails with a ConcurrentModificationException when this line is replaced with withType<KotlinCompile>().configureEach {?
It doesn't fail here...

I talked with @DRSchlaubi and it doesn't seem to be easily fixable.
I suggest to just leave it this way and maybe come back to it later.

However, before merging this I suggest to wait for the next Dokka release so we are able to publish docs.

@DRSchlaubi
Copy link
Member

Do you have any idea why the build fails with a ConcurrentModificationException when this line is replaced with withType<KotlinCompile>().configureEach {?
It doesn't fail here...

I talked with @DRSchlaubi and it doesn't seem to be easily fixable. I suggest to just leave it this way and maybe come back to it later.

However, before merging this I suggest to wait for the next Dokka release so we are able to publish docs.

Are there nightly builds, as Kotlin/dokka#2796 has been fixed for a while?

@DRSchlaubi DRSchlaubi added the on hold Something is preventing this issue from being resolved label Feb 16, 2023
@lukellmann
Copy link
Member Author

Do you have any idea why the build fails with a ConcurrentModificationException when this line is replaced with withType<KotlinCompile>().configureEach {?
It doesn't fail here...

I talked with @DRSchlaubi and it doesn't seem to be easily fixable. I suggest to just leave it this way and maybe come back to it later.

However, before merging this I suggest to wait for the next Dokka release so we are able to publish docs.

Are there nightly builds, as Kotlin/dokka#2796 has been fixed for a while?

idk, would have to dig around in their build setup to be sure

@DRSchlaubi
Copy link
Member

Do you have any idea why the build fails with a ConcurrentModificationException when this line is replaced with withType<KotlinCompile>().configureEach {?
It doesn't fail here...

I talked with @DRSchlaubi and it doesn't seem to be easily fixable. I suggest to just leave it this way and maybe come back to it later.
However, before merging this I suggest to wait for the next Dokka release so we are able to publish docs.

Are there nightly builds, as Kotlin/dokka#2796 has been fixed for a while?

idk, would have to dig around in their build setup to be sure

haven't found anything in the documentation

@lukellmann
Copy link
Member Author

Ok, there are some dev builds: Kotlin/dokka#1425

I suggest we update to one of those, dokka is only used internally, so this won't affect users.

@DRSchlaubi
Copy link
Member

Yeah sounds good to me

@DRSchlaubi DRSchlaubi removed the on hold Something is preventing this issue from being resolved label Feb 16, 2023
@lukellmann lukellmann merged commit 142a950 into 0.8.x Feb 16, 2023
@lukellmann lukellmann deleted the gradle-8 branch February 16, 2023 14:13
lukellmann added a commit that referenced this pull request Mar 7, 2023
* Gradle 8.0 -> 8.0.2
* Kotlin 1.8.0 -> 1.8.10
* KSP 1.8.0-1.0.8 -> 1.8.10-1.0.9
* Ktor 2.2.1 -> 2.2.4
* kotlinx.serialization 1.4.1 -> 1.5.0
* Dokka 1.8.0-dev-194 -> 1.8.10
* AtomicFU 0.19.0 -> 0.20.0
* Binary compatibility validator 0.12.1 -> 0.13.0
* JUnit 5 5.9.1 -> 5.9.2
* MockK 1.13.2 -> 1.13.4

The wrapper task is no longer configured to use the all distribution
type. This results in smaller downloads (e.g. in CI) while still being
able to inspect sources in IntelliJ (they are downloaded automatically).

Nothing is serializable since Kotlin 1.8.0 and kotlinx.serialization
1.5.0-RC which means dev.kord.common.entity.DiscordNull and
dev.kord.gateway.NullDecoder are now obsolete.

Kotlin/dokka#2796 was fixed with Dokka 1.8.10,
which means the dev build used since #755 is no longer needed and the
corresponding maven repository was removed from the build files.
@lukellmann lukellmann mentioned this pull request Mar 7, 2023
lukellmann added a commit that referenced this pull request Mar 8, 2023
* Gradle 8.0 -> 8.0.2
* Kotlin 1.8.0 -> 1.8.10
* KSP 1.8.0-1.0.8 -> 1.8.10-1.0.9
* Ktor 2.2.1 -> 2.2.4
* kotlinx.serialization 1.4.1 -> 1.5.0
* Dokka 1.8.0-dev-194 -> 1.8.10
* AtomicFU 0.19.0 -> 0.20.0
* Binary compatibility validator 0.12.1 -> 0.13.0
* JUnit 5 5.9.1 -> 5.9.2
* MockK 1.13.2 -> 1.13.4

The wrapper task is no longer configured to use the all distribution
type. This results in smaller downloads (e.g. in CI) while still being
able to inspect sources in IntelliJ (they are downloaded automatically).

Nothing is serializable since Kotlin 1.8.0 and kotlinx.serialization
1.5.0-RC which means dev.kord.common.entity.DiscordNull and
dev.kord.gateway.NullDecoder are now obsolete.

Kotlin/dokka#2796 was fixed with Dokka 1.8.10,
which means the dev build used since #755 is no longer needed and the
corresponding maven repository was removed from the build files.
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.

None yet

2 participants