HELLO·Android
系统源代码
IT资讯
技术文章
我的收藏
注册
登录
-
我收藏的文章
创建代码块
我的代码块
我的账号
Oreo
|
8.0.0_r4
下载
查看原文件
收藏
根目录
art
test
952-invoke-custom
generator
build-test.sh
#!/bin/bash # # Copyright (C) 2017 The Android Open Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Set up prog to be the path of this script, including following symlinks, # and set up progdir to be the fully-qualified pathname of its directory. prog="$0" args="$@" while [ -h "${prog}" ]; do newProg=`/bin/ls -ld "${prog}"` newProg=`expr "${newProg}" : ".* -> \(.*\)$"` if expr "x${newProg}" : 'x/' >/dev/null; then prog="${newProg}" else progdir=`dirname "${prog}"` prog="${progdir}/${newProg}" fi done oldwd=`pwd` progdir=`dirname "${prog}"` cd "${progdir}" progdir=`pwd` prog="${progdir}"/`basename "${prog}"` test_dir="test-$$" if [ -z "$TMPDIR" ]; then tmp_dir="/tmp/$USER/${test_dir}" else tmp_dir="${TMPDIR}/${test_dir}" fi if [ "x$ANDROID_BUILD_TOP" = "x" ]; then echo Build environment is not set-up. exit -1 fi # This only works internally for now (sorry folks!) jack_annotations_lib=/google/data/rw/teams/android-runtime/jack/jack-test-annotations-lib.jack if [ ! -f $jack_annotations_lib ]; then echo Try 'prodaccess' to access android-runtime directory. exit -1 fi # Compile test into a base64 string that can be instantiated via # reflection on hosts without the jack-test-annotations-lib.jack file. mkdir $tmp_dir for input_file in $progdir/*.java; do i=${input_file##*/Test} i=${i%%.java} src_file=$progdir/Test$i.java jack_file=./src.jack dex_file=./classes.dex base_64_file=$tmp_dir/TestData$i.base64 output_file=$progdir/../src/TestData$i.java # Compile source file to jack file. jack -g -cp $ANDROID_BUILD_TOP/out/host/linux-x86/../common/obj/JAVA_LIBRARIES/core-libart-hostdex_intermediates/classes.jack:$ANDROID_BUILD_TOP/out/host/linux-x86/../common/obj/JAVA_LIBRARIES/core-oj-hostdex_intermediates/classes.jack:$jack_annotations_lib -D sched.runner=multi-threaded -D sched.runner.thread.kind=fixed -D sched.runner.thread.fixed.count=4 -D jack.java.source.version=1.7 -D jack.android.min-api-level=o-b2 --output-jack $jack_file $src_file # Compile jack file to classes.dex. jack -g -cp $ANDROID_BUILD_TOP/out/host/linux-x86/../common/obj/JAVA_LIBRARIES/core-libart-hostdex_intermediates/classes.jack:$ANDROID_BUILD_TOP/out/host/linux-x86/../common/obj/JAVA_LIBRARIES/core-oj-hostdex_intermediates/classes.jack -D sched.runner=multi-threaded -D sched.runner.thread.kind=fixed -D sched.runner.thread.fixed.count=4 -D jack.java.source.version=1.7 -D jack.android.min-api-level=o-b2 --import $jack_file --output-dex . # Pack the classes.dex file into a base64 string. base64 -w 72 $dex_file > $base_64_file # Emit a managed source file containing the base64 string. The test can be # run by loading this string as a dex file and invoking it via reflection. cat > $output_file <
> $output_file cat >> $output_file <
×
已收藏
收藏成功,您可以在我收藏的代码页面中查看,其地址为:
https://www.androidos.net.cn/my/collect/code
。
登录后可以享受更多权益
您还没有登录,登录后您可以:
收藏Android系统代码
收藏喜欢的文章
多个平台共享账号
去登录
首次使用?从这里
注册