neoforged / gradleutils Goto Github PK
View Code? Open in Web Editor NEWGradle buildscript utility library for NeoForged projects
License: GNU Lesser General Public License v2.1
Gradle buildscript utility library for NeoForged projects
License: GNU Lesser General Public License v2.1
Currently, GradleUtils uses an awkward system to self-version itself. It holds source files in buildSrc
, which is referenced by the buildscript for version calculation and changelog generation; the buildscript then copies over these source files to the root project source folder, ignored by git
to avoid being committed.
I propose GradleUtils should itself use manual/maintainer-controlled versioning, instead of relying on this awkward system of copying source files from subproject to root project.
There are multiple reasons as to why this should be done:
This would mean that changelogs wouldn't be auto-generated anymore (unless its automated via another way), but I find that acceptable due to two reasons: few if not none reads the changelog for GradleUtils, and changelogs would still be part of the GitHub release information.
Personally, I find this the only good option to proceed with GradleUtils for future development.
An alternative would be to use a previously-published version of GradleUtils in this project, pinned to an exact version.
The configuration cache is a feature which improves build performance by caching the results of the configuration phase, for reuse in future builds. To accomplish its goals, the configuration cache imposes certain limitations on what can be done during the configuration phase, so it can keep track of all the state of the configuration phase.
One of these limitations is a prohibition on running external processes. Running external processes should be done either as a task action (i.e. deferring to the execution phase), or through configuration-cache-compatible APIs such as ProviderFactory#exec
or inside a ValueSource
with an injected ExecOperations
service.
Unfortunately, GradleUtils currently runs afoul of this limitation, because of JGit. JGit executes the git
command (using Java's ProcessBuilder
) to gather information about the system-wide git config.
After some investigation, it seems not possible to specifically replace the code in JGit which executes those commands to use the Gradle APIs mentioned above. Therefore, we have to wrap invocations to JGit -- specifically, those which construct a new Repository
directly or indirectly -- inside of a ValueSource
.
I have been using GradleUtils for a while now to generate me plain text and markdown changelog files, this all works great until it comes across a commit which has multiple lines/bullet points to it, the plain text formats fine but markdown renders all lines as 1 continous line, making it hard to distinguish between them all.
As you can see by the provided image, the plain text on the left, splits both lines up correctly,
but the markdown render is just removing the empty whitespace between the 2 lines making it hard to see the 2 different points.
A potential fix I would suggest would be changing markdown from aligning the multi lines, to being a indented dash ( -
) as markdown would then render these as each there own sub bullet points.
See https://discord.com/channels/313125603924639766/1136320550168436798/1161044932186865684. Several NeoForged projects, including Access transformers, include the build time as a timestamp in the built manifest. This isn't great. A better solution would be to include the timestamp and hash of the current commit - and having a method in the gradleutils extension for that is probably a good idea
Caused by: java.lang.NullPointerException: Cannot invoke "java.util.List.size()" because "self" is null
at net.neoforged.gradleutils.VersionCalculator.findTag(VersionCalculator.groovy:85)
at net.neoforged.gradleutils.VersionCalculator.calculate(VersionCalculator.groovy:35)
at net.neoforged.gradleutils.VersionCalculator.calculate(VersionCalculator.groovy)
at net.neoforged.gradleutils.VersionCalculatorValueSource.obtain(VersionCalculatorValueSource.groovy:35)
at net.neoforged.gradleutils.VersionCalculatorValueSource.obtain(VersionCalculatorValueSource.groovy)
at org.gradle.internal.Try.ofFailable(Try.java:41)
at org.gradle.api.internal.provider.DefaultValueSourceProviderFactory$LazilyObtainedValue.obtain(DefaultValueSourceProviderFactory.java:301)
at org.gradle.api.internal.provider.DefaultValueSourceProviderFactory$ValueSourceProvider.calculateOwnValue(DefaultValueSourceProviderFactory.java:256)
at org.gradle.api.internal.provider.AbstractMinimalProvider.calculateOwnPresentValue(AbstractMinimalProvider.java:80)
at org.gradle.api.internal.provider.AbstractMinimalProvider.get(AbstractMinimalProvider.java:100)
at net.neoforged.gradleutils.GradleUtilsExtension$1.toString(GradleUtilsExtension.groovy:80)
at net.neoforged.gradleutils.GradleUtilsExtension$1$toString.call(Unknown Source)
at build_1rpfzhdnjltyux4db49sft535.run(P:\data\github\NeoGradle\build.gradle:8)
at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:91)
... 175 more
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.