8300997: Add curl support to createJMHBundle.sh

Reviewed-by: erikj
This commit is contained in:
Eirik Bjorsnos 2023-01-25 14:01:03 +00:00 committed by Erik Joelsson
parent 8a47429dc0
commit 61775c85b0

View File

@ -1,6 +1,6 @@
#!/bin/bash -e #!/bin/bash -e
# #
# Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -40,10 +40,22 @@ mkdir -p $BUILD_DIR $JAR_DIR
cd $JAR_DIR cd $JAR_DIR
rm -f * rm -f *
wget https://repo.maven.apache.org/maven2/org/apache/commons/commons-math3/$COMMONS_MATH3_VERSION/commons-math3-$COMMONS_MATH3_VERSION.jar fetchJar() {
wget https://repo.maven.apache.org/maven2/net/sf/jopt-simple/jopt-simple/$JOPT_SIMPLE_VERSION/jopt-simple-$JOPT_SIMPLE_VERSION.jar url="https://repo.maven.apache.org/maven2/$1/$2/$3/$2-$3.jar"
wget https://repo.maven.apache.org/maven2/org/openjdk/jmh/jmh-core/$JMH_VERSION/jmh-core-$JMH_VERSION.jar if command -v curl > /dev/null; then
wget https://repo.maven.apache.org/maven2/org/openjdk/jmh/jmh-generator-annprocess/$JMH_VERSION/jmh-generator-annprocess-$JMH_VERSION.jar curl -O --fail $url
elif command -v wget > /dev/null; then
wget $url
else
echo "Could not find either curl or wget"
exit 1
fi
}
fetchJar org/apache/commons commons-math3 $COMMONS_MATH3_VERSION
fetchJar net/sf/jopt-simple jopt-simple $JOPT_SIMPLE_VERSION
fetchJar org/openjdk/jmh jmh-core $JMH_VERSION
fetchJar org/openjdk/jmh jmh-generator-annprocess $JMH_VERSION
tar -cvzf ../$BUNDLE_NAME * tar -cvzf ../$BUNDLE_NAME *