os-xtoo icon indicating copy to clipboard operation
os-xtoo copied to clipboard

[gradle] Fix gradle cli

Open wltjr opened this issue 6 years ago • 4 comments

Gradle's main method is in gradle-launcher, now packaged. The launcher is crude and needs work. Or need to adapt the existing launcher. Likely need to create a base directory structure for gradle and other things.

# gradle
java.lang.NullPointerException
        at org.gradle.api.internal.classpath.DefaultModuleRegistry.getExternalModule(DefaultModuleRegistry.java:78)
        at org.gradle.api.internal.DefaultClassPathProvider.findClassPath(DefaultClassPathProvider.java:45)
        at org.gradle.api.internal.DefaultClassPathRegistry.getClassPath(DefaultClassPathRegistry.java:34)
        at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:48)
        at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:37)
        at org.gradle.launcher.GradleMain.main(GradleMain.java:23)


wltjr avatar Apr 16 '18 23:04 wltjr

Likely need to create a gradle meta package that pulls in all others. Move the cli gradle script from gradle-launcher to the gradle meta package. That package should be similar to an unpacked binary gradle tarball/zip file.

wltjr avatar Apr 19 '18 16:04 wltjr

Gradle cli is now in dev-util/gradle. The cli does not function due to issues with symlinked jars and jars residing outside of gradle base directory. Gradle expects jars to be in a single directory and lookup finds the path to the actual jars location, not the symlinked location. Working on a solution in dev-java/gradle-core-api and maybe dev-java/gradle-launcher.

wltjr avatar Jun 27 '18 23:06 wltjr

Better output, seems to point to main issue

$ gradle --debug
14:53:38.881 [DEBUG] [org.gradle.internal.nativeintegration.services.NativeServices] Native-platform is not available.
14:53:38.976 [INFO] [org.gradle.internal.nativeintegration.services.NativeServices] Initialized native services in: /home/wlt/.gradle/native

FAILURE: Build failed with an exception.

* What went wrong:
java.lang.ExceptionInInitializerError (no error message)

wltjr avatar Jul 21 '19 18:07 wltjr

Need the following, requires modifications to jansi and native-platform packages.

~/.gradle/native/29/linux-amd64/libnative-platform.so
~/.gradle/native/jansi/1.17.1/linux64/libjansi.so

Both .so files need be in the jars, not system installed, can experiment with system installed.

# unzip -l /tmp/gradle-5.5.1/lib/jansi-1.17.1.jar | grep \\.so
    98380  04-16-2018 08:16   META-INF/native/freebsd32/libjansi.so
   104088  04-16-2018 08:16   META-INF/native/freebsd64/libjansi.so
    98876  04-16-2018 08:16   META-INF/native/linux32/libjansi.so
   109048  04-16-2018 08:16   META-INF/native/linux64/libjansi.so

# unzip -l /tmp/gradle-5.5.1/lib/native-platform-linux-amd64-0.17.jar | grep \\.so
    34293  02-12-2019 18:00   net/rubygrapefruit/platform/linux-amd64/libnative-platform.so

wltjr avatar Jul 21 '19 21:07 wltjr