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

FYI: Keeping up with kotlin and gradle versions #11870

Open
SomeTroglodyte opened this issue Jun 27, 2024 · 3 comments
Open

FYI: Keeping up with kotlin and gradle versions #11870

SomeTroglodyte opened this issue Jun 27, 2024 · 3 comments
Labels
Stale Toolchain Related to IDE, compilation, or other tools - not Unciv itself

Comments

@SomeTroglodyte
Copy link
Collaborator

SomeTroglodyte commented Jun 27, 2024

Log

For kicks I just tried the following:

Tools - AGP Upgrade Assistant...
  Let it do its thing to 8.4.2
`./gradlew wrapper --gradle-version 8.8`
File - Settings - Other Settings - Kotlin Compiler
  Change Kotlin compiler version to 1.9.24
Edit buildScr/src/main/kotlin/BuildConfig.kt:
    `const val kotlinVersion = "1.9.24"`
    `const val ktorVersion = "2.3.12"`
    `const val coroutinesVersion = "1.8.1"`
Let gradle sync do its stuff
Run desktop config - works
Run on some android device - works

`rm -rf .gradle/8.2`
`rm -rf ~/.gradle/caches/8.2`
`rm -rf ~/.gradle/daemon/8.2`
`rm -rf ~/.gradle/wrapper/dists/gradle-8.2-bin`
// AGP will pull a lot of gradle 8.6 crud before we replace that
`rm -rf .gradle/8.6`
`rm -rf ~/.gradle/caches/8.6`
`rm -rf ~/.gradle/daemon/8.6`
`rm -rf ~/.gradle/wrapper/dists/gradle-8.6-bin`
(or maybe rm -rf ~/.gradle/ and endure a redownload of all dependencies to get rid of old libraries)

Alternative Approaches

Wait for kotlin 2 > 2.0.0 and gradle 9?

References

https://ktor.io/docs/releases.html#release-details
https://github.com/Kotlin/kotlinx.coroutines/releases

@SomeTroglodyte SomeTroglodyte added the Toolchain Related to IDE, compilation, or other tools - not Unciv itself label Jun 27, 2024
yairm210 added a commit that referenced this issue Jun 27, 2024
@yairm210
Copy link
Owner

Kotlin version - definitely yes

AGP version - we'll need to check
I prefer to stick to versions supported by IDEA as well as Android Studio, it has distinct advantages in e.g. performance profiling

@SomeTroglodyte
Copy link
Collaborator Author

Those versions are: AGP is exactly the one offered by Jellyfish-patch2 automatically - haven't upgraded to Koala yet, as usual not trusting it until it has a patch1. Gradle: that AGP plugin chooses 8.6 as new default - or rather needs 8.6 as minimum to install, but also has 8.8 in its offered list, so I chose that version manually - because auto won't upgrade everything, but that gradle wrapper call does include the wrapper jar itself. Why exactly I didn't choose 9 - the argument "too fresh, and might necessitate major build script updates" is already sufficient, but I think AGP didn't offer 9 yet too.

This was FYI so you know I did the experiment and it was relatively painless. I can redo it and wrap as PR - you decide when. But keep in mind all devs pulling that version will need a bit of local maintenance - the kotlin compiler version in settings (that val only determines kotlin-gradle-plugin and kotlin-reflect judging from Alt-F7), possibly a manual gradle sync, optional cache cleanup, one longer gradle sync than usual.

AGP 8.2 was november 2023, so we're not that far behind. We could even up the Compile SDK one level without changing AGP, only for the current preview we'd need more.

Also: Project structure - suggestions shows a few other libraries have newer versions: androidx.core:core-ktx, androidx.work:work-runtime-ktx and com.android.tools:desugar_jdk_libs - I did not test upgrading those, as I'm not really sure where one would see their effect, mostly the work runtime, the other two I'd expect are already tested when one can debug-run android.

For a real PR I would probably also check first whether Koala would go to a different AGP (8.5 is out, its release notes say yes Koala would use that one), then think hard on whether it would be preferable or not.

Copy link

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 15 days.

@github-actions github-actions bot added the Stale label Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Stale Toolchain Related to IDE, compilation, or other tools - not Unciv itself
Projects
None yet
Development

No branches or pull requests

2 participants