Skip to content

Conversation

@RenFraser
Copy link

@RenFraser RenFraser commented Feb 20, 2023

  • Addresses Unify hardcoded Gradle plugin versions behind a single definition #419.
  • Adds the platform project to the build to avoid having non-kotlin files.
  • Removed gradle.properties now that we don't need to use it anymore.
  • Tested by trying to pull in different dependency versions and seeing the configuration step fail.
  • It doesn't show it well in the GitHub diff but in the shared/build.gradle.kts and server/build.gradle.kts files, the dependency declarations have just had their versions truncated.
    • Example implementation("com.h2database:h2:1.4.200") becomes implementation("com.h2database:h2"). Note the missing :1.4.200
  • Committed gradle.properties to the test additional workspaces since it's used during testing.
    • Removed Gradle tasks that copied the gradle.properties to the test additional workspaces.
@RenFraser RenFraser marked this pull request as draft February 20, 2023 19:38
@RenFraser RenFraser force-pushed the plugin-ids branch 2 times, most recently from 7d83ade to e7744b2 Compare February 20, 2023 20:19
@RenFraser RenFraser marked this pull request as ready for review February 20, 2023 20:31
build.gradle.kts Outdated
// We could use a buildSrc script for this.
// See: https://github.com/gradle/kotlin-dsl-samples/issues/802
plugins {
kotlin("jvm") version "1.8.10"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are still hardcoding 1.8.10 here? Any way we can use the version from the platform project to avoid having this duplicate?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. It's not explicit in my initial revision but if you try to use another version that's different to what's constrained in the platform project, it'll complain stating the the lib is not found. I've refactored the plugins with their versions into a centralised place to live in settings.gradle.kts with a comment to make it obvious on how it all works. This will make it easier to see what versions we use.

id("java-platform")
}

group = "com.kotlin-language-server"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should ideally match up with the package structure or at least an actual domain. Since the packages live in org.javacs.kt (as inherited by the original language server repo), we could use that with the disadvantage of it not being very descriptive.

As an alternative, I would propose

Suggested change
group = "com.kotlin-language-server"
group = "dev.fwcd.kotlin-language-server"

Whether we would want to move the actual package structure to that too would be a topic for future debate.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thing, I've made the adjustment in my next revision!

@RenFraser
Copy link
Author

Thanks for the feedback, @fwcd and @themkat. I've pushed a squashed commit with the following changes:

  • Added the kotlin jvm plugin with appropriate version to the platform project dependency constraints.
  • Renamed the platform project group.
  • Added centralised plugin versions in the root settings.gradle.kts with supporting comment on what it does and how to add plugins.
  • Added logic to use the project property override for javaVersion if available and fallback to a default value of "11"
  • Rebased on top of the latest main branch.
@fwcd fwcd added the gradle Related to the language server's support for Gradle projects label Feb 27, 2023
@themkat
Copy link
Collaborator

themkat commented Mar 1, 2023

@RenFraser , if you rebase this branch with main, we can (probably) see that all the pipelines and Detekt are successful 🙂 Always good to check all of those going forward. (you would probably have to do it anyway because of the conflicts. Sorry for nagging, just my enthusiasm for seeing green builds with new stuff 😆 )

@RenFraser
Copy link
Author

Yeah, good idea. Let's resolve those conflicts and see all of our checks passing :) I'll rebase now

@RenFraser
Copy link
Author

Ok that looks good now @themkat :)

@themkat themkat linked an issue Mar 1, 2023 that may be closed by this pull request
@themkat
Copy link
Collaborator

themkat commented Mar 3, 2023

I say we merge this now, hopefully there isn't anything stupid we have missed this time 😆

Thank you @RenFraser ! 🙂

@themkat themkat merged commit 54c8465 into fwcd:main Mar 3, 2023
@RenFraser RenFraser deleted the plugin-ids branch March 3, 2023 23:41
@fwcd
Copy link
Owner

fwcd commented Apr 13, 2023

Hm, I think this broke the release_version.py script which relied on parsing and updating the projectVersion in gradle.properties...

@themkat
Copy link
Collaborator

themkat commented Apr 13, 2023

Hm, I think this broke the release_version.py script which relied on parsing and updating the projectVersion in gradle.properties...

Is that script even used anymore? Can't see it used in Github Actions

@fwcd
Copy link
Owner

fwcd commented Apr 13, 2023

Yeah, it's meant for interactive usage

@themkat
Copy link
Collaborator

themkat commented Apr 13, 2023

Yeah, it's meant for interactive usage

We can probably get it working again by reading server/build.gradle.kts instead of gradle.properties. The version is in that file now. Or if you want to release fast, you can probably hardcode the new version in the script while releasing... There is also the issue that distZip now adds a version to the filename (e.g, server-1.3.2.zip). The last issue is caused by setting projectVersion in the Gradle Kotlin DSL. Wish I knew more about Gradle atm....

@fwcd fwcd added build Related to the language server's own build (including Gradle updates etc.) and removed gradle Related to the language server's support for Gradle projects labels Oct 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Related to the language server's own build (including Gradle updates etc.)

3 participants