summaryrefslogtreecommitdiff
path: root/test/952-invoke-custom
diff options
context:
space:
mode:
Diffstat (limited to 'test/952-invoke-custom')
-rw-r--r--test/952-invoke-custom/build.py21
-rwxr-xr-xtest/952-invoke-custom/generate-sources (renamed from test/952-invoke-custom/build)3
-rwxr-xr-xtest/952-invoke-custom/javac_post.sh (renamed from test/952-invoke-custom/javac_wrapper.sh)19
-rw-r--r--test/952-invoke-custom/util-src/transformer/IndyTransformer.java2
4 files changed, 23 insertions, 22 deletions
diff --git a/test/952-invoke-custom/build.py b/test/952-invoke-custom/build.py
new file mode 100644
index 0000000000..166d3a8e23
--- /dev/null
+++ b/test/952-invoke-custom/build.py
@@ -0,0 +1,21 @@
+#
+# Copyright (C) 2022 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.
+
+
+def build(ctx):
+ ctx.bash("./generate-sources")
+ ctx.default_build(use_desugar=False,
+ api_level=28,
+ javac_classpath=[ctx.test_dir / "transformer.jar"])
diff --git a/test/952-invoke-custom/build b/test/952-invoke-custom/generate-sources
index e835517c62..4244f8ce8f 100755
--- a/test/952-invoke-custom/build
+++ b/test/952-invoke-custom/generate-sources
@@ -24,6 +24,3 @@ mkdir classes
${JAVAC:-javac} ${JAVAC_ARGS} -cp "${ASM_JAR}" -d classes $(find util-src -name '*.java')
${SOONG_ZIP} --jar -o transformer.jar -C classes -D classes
rm -rf classes
-
-# Use API level 28 for invoke-custom bytecode support.
-USE_DESUGAR=false ./default-build "$@" --api-level 28
diff --git a/test/952-invoke-custom/javac_wrapper.sh b/test/952-invoke-custom/javac_post.sh
index 86590308dd..be5d8cfda3 100755
--- a/test/952-invoke-custom/javac_wrapper.sh
+++ b/test/952-invoke-custom/javac_post.sh
@@ -16,24 +16,7 @@
set -e # Stop on error - the caller script may not have this set.
-# Update arguments to add transformer and ASM to the compiler classpath.
-classpath="./transformer.jar:$ASM_JAR"
-args=(-cp $classpath)
-while [ $# -ne 0 ] ; do
- case $1 in
- -cp|-classpath|--class-path)
- shift
- shift
- ;;
- *)
- args+=("$1")
- shift
- ;;
- esac
-done
-
-# Compile.
-$JAVAC "${args[@]}"
+export ASM_JAR="${ANDROID_BUILD_TOP}/prebuilts/misc/common/asm/asm-9.2.jar"
# Move original classes to intermediate location.
mv classes intermediate-classes
diff --git a/test/952-invoke-custom/util-src/transformer/IndyTransformer.java b/test/952-invoke-custom/util-src/transformer/IndyTransformer.java
index 6401c548de..ee04ff2de0 100644
--- a/test/952-invoke-custom/util-src/transformer/IndyTransformer.java
+++ b/test/952-invoke-custom/util-src/transformer/IndyTransformer.java
@@ -189,7 +189,7 @@ public class IndyTransformer {
ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES);
try (InputStream is = Files.newInputStream(inputClassPath)) {
ClassReader cr = new ClassReader(is);
- cr.accept(new BootstrapBuilder(Opcodes.ASM7, cw, callsiteMap), 0);
+ cr.accept(new BootstrapBuilder(Opcodes.ASM9, cw, callsiteMap), 0);
}
try (OutputStream os = Files.newOutputStream(outputClassPath)) {
os.write(cw.toByteArray());