nixpkgs/pkgs/build-support/setup-hooks/set-java-classpath.sh
John Ericson 046f091e0d treewide: Don't use envHook anymore
This commits needs a MAJOR audit as I oftentimes just guessed which of
`$hostOffset`, `$targetOffset`, or a fixed offset should be used.
2017-12-30 22:04:22 -05:00

14 lines
321 B
Bash

# This setup hook adds every JAR in the share/java subdirectories of
# the build inputs to $CLASSPATH.
export CLASSPATH
addPkgToClassPath () {
local jar
for jar in $1/share/java/*.jar; do
export CLASSPATH=''${CLASSPATH}''${CLASSPATH:+:}''${jar}
done
}
addEnvHooks "$targetOffset" addPkgToClassPath