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

Refactor Gradle build config #10843

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

aSemy
Copy link

@aSemy aSemy commented Sep 5, 2023

Initial attempt at #10841

I thought I'd make a PR to demonstrate what #10841 would end up looking like :). Some of this can be split up into smaller PRs

This covers most of the improvements in #10841

Summary

  • use test-fixtures for sharing test utilities
  • create convention plugins for sharing build config between subprojects
  • set up dependencies catalog
  • move subproject specific configuration into each subproject's build file
  • move build properties into single extension, IntellijRustBuildProperties.kt
  • add descriptions to subprojects
  • use typesafe project accessors
  • update sharing of Kotlin source files to use Configuration-based sharing
  • create specific task, UpdateCargoOptions, for generating CargoOptions.kt (moving it out of the build script helps keep the build logic more organised, and creating a specific task makes it easier to use the Gradle API as intended)
  • The IntelliJ platform specific properties have been moved into an enum class, which helps simplify the property files

todo

  • the gradle-231.properties and gradle-232.properties files are ignored - I've got an idea of how to make this better...

Result

  • The root build.gradle.kts is smaller and more manageable
  • Convention plugins mean that build config is more easily shared
  • most (all?) cross-project configuration has been removed
  • dependencies can be defined in a single place: ./gradle/libs.versions.toml
  • projects can share test utilities more easily, without also sharing test files

Changelog

changelog: refactored Gradle build config (no functional changes)

- use test-fixtures for sharing test utilities
- create convention plugins for sharing build config between subprojects
- set up dependencies catalog
- move subproject specific configuration into each subproject's build file
- move build properties into single extension, IntellijRustBuildProperties.kt
- add descriptions to subprojects
- use typesafe project accessors
- update sharing of kotlin source files to use Configuration-based sharing
- register inputs/outputs correctly, so Gradle can do up-to-date checks
- use services in preparation for Configuration Cache compatibility
@aSemy aSemy force-pushed the experiments/refactor-gradle-build-config branch from b287f8c to 4eeb8e5 Compare September 6, 2023 14:55
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

1 participant