gradle-android-git-version icon indicating copy to clipboard operation
gradle-android-git-version copied to clipboard

androidGitVersion triggering an exception on a new fork without any tag yet

Open anr2me opened this issue 11 months ago • 1 comments

Tested on a new fork (master branch only and doesn't have any tag yet) of ppsspp repository with ./gradlew androidGitVersion from this PR running the manual_generate_apk.yml https://github.com/ANR2MERefork/ppsspp/actions/runs/8396532920/job/22998104389

Using default execution profile

FAILURE: Build failed with an exception.

* Where:
Build file '/home/runner/work/ppsspp/ppsspp/android/build.gradle' line: 53

* What went wrong:
A problem occurred evaluating project ':android'.
> Not enough room for 39779 in BUILD width=4

* Try:
> Run with --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org./

Where the mentioned build.gradle line 53 is

if (androidGitVersion.name() != "unknown" && androidGitVersion.code() >= 14000000) {

Is there anyway to prevent gradle from crashing? so we can fallback to a default version/naming just like how we handle "unknown", or may be to truncate the code's part to fit the format's part's width so it doesn't crashed (not sure where it get the version code without any tag existed, seems to be a truncated commit hash)

PS: This error only occurred on a new fork

anr2me avatar Mar 22 '24 22:03 anr2me