aboutsummaryrefslogtreecommitdiff
path: root/utils/utils_benchmarks.sh
diff options
context:
space:
mode:
Diffstat (limited to 'utils/utils_benchmarks.sh')
-rw-r--r--utils/utils_benchmarks.sh54
1 files changed, 28 insertions, 26 deletions
diff --git a/utils/utils_benchmarks.sh b/utils/utils_benchmarks.sh
index bd76032c..89592400 100644
--- a/utils/utils_benchmarks.sh
+++ b/utils/utils_benchmarks.sh
@@ -15,6 +15,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+# This assumes that source utils.sh has been called by the parent script.
+source "$(get_art_dir)/test/etc/apex-bootclasspath-utils.sh"
+
if [[ ! -v JCPU_COUNT ]]; then
log E "utils_android.sh must be sourced before utils_benchmarks.sh"
abort
@@ -47,35 +50,34 @@ build_benchmarks() {
# Get the core bootclasspath which can be used to build and to run Java apps on a target.
get_target_core_bootclasspath() {
- # Get a list of bootjars names. They are space separated.
- local -r core_bootjars_names=$("$(get_art_tools_dir)"/bootjars.sh --core --target)
-
- # Get a space separated list of all bootjars names with names of apex modules they belong to.
- # They have the format: <apex module name>:<bootjar name>
- local boot_jars_names_with_apex_module=$("$(get_art_tools_dir)"/bootjars.sh --target)
-
- # Add '.jar' to core bootjars.
- # 'boot_jars_names_with_apex_module' will become like
- # 'com.android.art:apache-xml.jar platform:framework-minus-apex'.
- local name
- for name in ${core_bootjars_names}; do
- boot_jars_names_with_apex_module="${boot_jars_names_with_apex_module//${name}/${name}.jar}"
- done
+ # Using ART util; HOST="n".
+ get_apex_bootclasspath "n"
+}
- local bootclasspath=""
- for name in ${boot_jars_names_with_apex_module}; do
- if [[ "${name}" == *jar ]]; then
- # Convert the name into a file path: /apex/<module>/javalib/<jar>.
- name="/apex/${name//://javalib/}"
- bootclasspath="${bootclasspath}${name}:"
- fi
+# Constructs and exports a -bootclasspath argument line for javac invocation; is used
+# for building benchmarks in art-testing.
+export_javac_bootclasspath() {
+ # Note: the list of module jar files should be kept up-to-date with ./art setup.
+ local -r jar_list="core-oj.com.android.art.testing \
+ core-libart.com.android.art.testing \
+ okhttp.com.android.art.testing \
+ bouncycastle.com.android.art.testing \
+ apache-xml.com.android.art.testing \
+ core-icu4j \
+ conscrypt"
+ local -r jar_prefix="${ANDROID_BUILD_TOP}/out/target/common/obj/JAVA_LIBRARIES/"
+ local -r jar_suffix="_intermediates/classes.jar"
+ local bpath=""
+ local bpath_separator=""
+
+ # Fully qualify module names from jar_list and add separators between them.
+ for jar_name in ${jar_list}; do
+ bpath+="${bpath_separator}${jar_prefix}${jar_name}${jar_suffix}"
+ bpath_separator=":"
done
- # SPECjvm2008 crypto workloads depend on conscrypt.jar.
- # 'conscrypt.jar' is separated from the core boot jars into a separate module.
- local -r conscrypt_jar="/apex/com.android.conscrypt/javalib/conscrypt.jar"
-
- echo "${bootclasspath}${conscrypt_jar}"
+ log I "Bootclasspath for compiling benchmarks: ${bpath}"
+ export JAVAC_BOOTCLASSPATH="${bpath}"
}
# Get target bootclasspath options for dex2oat which are used in ART testing.