TimeBase-CE icon indicating copy to clipboard operation
TimeBase-CE copied to clipboard

Document git-lfs dependency in readme and/or check for git-lfs in `gradlew`

Open joshuaulrich opened this issue 2 years ago • 2 comments
trafficstars

You must have git-lfs installed before cloning the repo in order to build from source. Otherwise only the pointer file is cloned.

For example, without git-lfs the gradle/wrapper/gradle-wrapper.jar local file contents are below, and ./gradlew build fails with an uninformative error.

# cat gradle/wrapper/gradle-wrapper.jar
version https://git-lfs.github.com/spec/v1
oid sha256:e996d452d2645e70c01c11143ca2d3742734a28da2bf61f25c82bdc288c9e637
size 59203

# ./gradlew build
Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain
Caused by: java.lang.ClassNotFoundException: org.gradle.wrapper.GradleWrapperMain

I'm on Ubuntu and can install git-lfs with sudo apt install git-lfs. I can check that it's installed with which git-lfs. I'm not sure how to make that portable across platforms though.

joshuaulrich avatar Jun 14 '23 21:06 joshuaulrich

Greeting @joshuaulrich. that's make sense. Will add instructions. Thank you!

Also will try to incorporate downloading gradle-wrapper in gradlew, but it can be tricky for different platforms

alex-karpovich avatar Jun 15 '23 15:06 alex-karpovich

I wouldn't try downloading gradle-wrapper.jar because it may not be the only file affected by git-lfs.

Maybe you could check the file size of gradle-wrapper.jar to see if it's less than a few MB. If it's small, that means git-lfs isn't available. Then gradlew could exit with an error about git-lfs being required.

joshuaulrich avatar Jun 15 '23 15:06 joshuaulrich