GithubHelp home page GithubHelp logo

neoforged / gradleutils Goto Github PK

View Code? Open in Web Editor NEW
1.0 7.0 5.0 284 KB

Gradle buildscript utility library for NeoForged projects

License: GNU Lesser General Public License v2.1

Groovy 85.41% Java 14.59%
hacktoberfest gradle-plugin versionning

gradleutils's People

Contributors

cpw avatar lexmanos avatar lukebemish avatar marchermans avatar matyrobbrt avatar sciwhiz12 avatar shartte avatar sizableshrimp avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

gradleutils's Issues

Changelog MD generation not multi lining entries correctly

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.

image

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.

image

Switch GradleUtils itself to manual versioning for releases

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:

  • GradleUtils would be the sole project that uses manual versioning in NeoForged. All other projects would rely in GradleUtils for their versioning and changelog generation. As GradleUtils is likely infrequently updated, the burden of maintainer-controlled versioning won't be too much of a hassle over the long term.
  • This gets rid of that awkward/cursed source copying system, simplying the project structure significantly.
  • This gives us the flexibility to collate many changes which would each break the public API as one release, rather than being staggered across multiple releases (since each commit/PR would be built and published as its own release).

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.

Fix configuration cache compatibility

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.

GradleUtils doesn't handle no available tags gracefully

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.