[2/2] ant-native: only use classpath tools if no JDK
Submitted by Kyle Russell on Feb. 5, 2019, 3:53 p.m.
|
Patch ID: 158539
Details
Commit Message
@@ -53,7 +53,7 @@ do_compile() {
fastjar cf ${JARFILENAME} -C build .
oe_makeclasspath cp -s ecj-bootstrap jsch bsf xalan2 xercesImpl resolver gnumail gnujaf bcel regexp log4j1.2 antlr oro junit jdepend commons-net commons-logging
- cp=${STAGING_DATADIR_JAVA_NATIVE}/ant.jar:${STAGING_DATADIR}/classpath/tools.zip:$cp
+ sed -i -e"s|@ANT_JAR@|${STAGING_DATADIR_JAVA_NATIVE}/ant.jar|" ${WORKDIR}/ant
sed -i -e"s|@JAR_FILE@|$cp|" ${WORKDIR}/ant
}
@@ -1,6 +1,15 @@
#!/bin/sh
export CLASSPATH
+
+CLASSPATH=$CLASSPATH:@ANT_JAR@
+
+if [ -f "$JAVA_HOME/lib/tools.jar" ] ; then
+ CLASSPATH="$CLASSPATH:$JAVA_HOME/lib/tools.jar"
+else
+ CLASSPATH="$CLASSPATH:${STAGING_DATADIR}/classpath/tools.zip"
+fi
+
CLASSPATH=$CLASSPATH:@JAR_FILE@
if [ ! $JAVA ];then
If ant gets invoked with a $JAVA_HOME that points to a JDK (for example, from an 'inherit java-native'), use the tools.jar from the JDK instead of the classpath-initial tools. Once a native JDK has been bootstrapped, other Java recipes should be able to use a more featureful set of classes if needed. Signed-off-by: Kyle Russell <bkylerussell@gmail.com> --- recipes-core/ant/ant-native_1.8.1.bb | 2 +- recipes-core/ant/files/ant | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-)