1#!/bin/bash -e
2#
3# Copyright (c) 2018, 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 it
7# under the terms of the GNU General Public License version 2 only, as
8# published by the Free Software Foundation.  Oracle designates this
9# particular file as subject to the "Classpath" exception as provided
10# by Oracle in the LICENSE file that accompanied this code.
11#
12# This code is distributed in the hope that it will be useful, but WITHOUT
13# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15# version 2 for more details (a copy is included in the LICENSE file that
16# accompanied this code).
17#
18# You should have received a copy of the GNU General Public License version
19# 2 along with this work; if not, write to the Free Software Foundation,
20# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
21#
22# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
23# or visit www.oracle.com if you need additional information or have any
24# questions.
25#
26# Create a bundle in the build directory, containing what's needed to
27# build and run JMH microbenchmarks from the OpenJDK build.
28
29JMH_VERSION=1.21
30COMMONS_MATH3_VERSION=3.2
31JOPT_SIMPLE_VERSION=4.6
32
33BUNDLE_NAME=jmh-$JMH_VERSION.tar.gz
34
35SCRIPT_DIR="$(cd "$(dirname $0)" > /dev/null && pwd)"
36BUILD_DIR="${SCRIPT_DIR}/../../build/jmh"
37JAR_DIR="$BUILD_DIR/jars"
38
39mkdir -p $BUILD_DIR $JAR_DIR
40cd $JAR_DIR
41rm -f *
42
43wget http://central.maven.org/maven2/org/apache/commons/commons-math3/$COMMONS_MATH3_VERSION/commons-math3-$COMMONS_MATH3_VERSION.jar
44wget http://central.maven.org/maven2/net/sf/jopt-simple/jopt-simple/$JOPT_SIMPLE_VERSION/jopt-simple-$JOPT_SIMPLE_VERSION.jar
45wget http://central.maven.org/maven2/org/openjdk/jmh/jmh-core/$JMH_VERSION/jmh-core-$JMH_VERSION.jar
46wget http://central.maven.org/maven2/org/openjdk/jmh/jmh-generator-annprocess/$JMH_VERSION/jmh-generator-annprocess-$JMH_VERSION.jar
47
48tar -cvzf ../$BUNDLE_NAME *
49
50echo "Created $BUILD_DIR/$BUNDLE_NAME"
51