Path: blob/master/test/jdk/java/lang/instrument/MakeJAR2.sh
41149 views
#!/bin/sh12#3# Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved.4# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.5#6# This code is free software; you can redistribute it and/or modify it7# under the terms of the GNU General Public License version 2 only, as8# published by the Free Software Foundation.9#10# This code is distributed in the hope that it will be useful, but WITHOUT11# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13# version 2 for more details (a copy is included in the LICENSE file that14# accompanied this code).15#16# You should have received a copy of the GNU General Public License version17# 2 along with this work; if not, write to the Free Software Foundation,18# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19#20# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21# or visit www.oracle.com if you need additional information or have any22# questions.23#242526AGENT="$1"27APP="$2"2829if [ "${TESTSRC}" = "" ]30then31echo "TESTSRC not set. Test cannot execute. Failed."32exit 133fi34echo "TESTSRC=${TESTSRC}"3536if [ "${TESTJAVA}" = "" ]37then38echo "TESTJAVA not set. Test cannot execute. Failed."39exit 140fi41echo "TESTJAVA=${TESTJAVA}"4243if [ "${COMPILEJAVA}" = "" ]44then45COMPILEJAVA="${TESTJAVA}"46fi47echo "COMPILEJAVA=${COMPILEJAVA}"4849if [ "${TESTCLASSES}" = "" ]50then51echo "TESTCLASSES not set. Test cannot execute. Failed."52exit 153fi5455OS=`uname -s`56case "$OS" in57Linux )58PATHSEP=":"59;;6061Windows* | CYGWIN*)62PATHSEP=";"63;;6465# catch all other OSs66* )67echo "Unrecognized system! $OS"68fail "Unrecognized system! $OS"69;;70esac7172JAVAC="${COMPILEJAVA}/bin/javac -g"73JAR="${COMPILEJAVA}/bin/jar"7475cp ${TESTSRC}/${AGENT}.java .76cp ${TESTSRC}/${APP}.java .77rm -rf asmlib78mkdir asmlib79cp ${TESTSRC}/asmlib/*.java asmlib80rm -rf bootpath81mkdir -p bootpath/bootreporter82cp ${TESTSRC}/bootreporter/*.java bootpath/bootreporter8384cd bootpath85${JAVAC} ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} bootreporter/*.java86cd ..8788${JAVAC} ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \89--add-exports java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED ${AGENT}.java asmlib/*.java90${JAVAC} ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -classpath .${PATHSEP}bootpath ${APP}.java9192echo "Manifest-Version: 1.0" > ${AGENT}.mf93echo Premain-Class: ${AGENT} >> ${AGENT}.mf94echo Boot-Class-Path: bootpath >> ${AGENT}.mf95shift 296while [ $# != 0 ] ; do97echo $1 >> ${AGENT}.mf98shift99done100101${JAR} ${TESTTOOLVMOPTS} cvfm ${AGENT}.jar ${AGENT}.mf ${AGENT}*.class asmlib/*.class102103# rm -rf ${AGENT}.java asmlib ${AGENT}.mf ${AGENT}*.class104105106