neoforged / GradleUtils

Gradle buildscript utility library for NeoForged projects
GNU Lesser General Public License v2.1
1 stars 5 forks source link

Fix configuration cache incompatibilities #7

Closed sciwhiz12 closed 10 months ago

sciwhiz12 commented 10 months ago

This PR fixes most incompatibilities with the configuration cache, both in the buildscript of this repository and the GradleUtils plugin, thereby resolving #5.

The main point here is moving any invocation of Git during the configuration phase to a ValueSource, which Gradle runs outside of the confines of the configuration cache (and therefore the code within can do almost anything, like run processes).

This PR doesn't address invocations of Git during task execution, such as done in both of GradleUtils's tasks, as those fall outside of the confines of the configuration cache.

[!IMPORTANT] This PR doesn't fix the uses of Project in the ExtractTeamCityProjectConfigurationTask, mostly because some of the specifics of that task require access to the Project (such as accessing Project extensions). Uses of that task should be limited to when the configuration cache is disabled.