Commit 1b0b910e authored by Andrew Grieve's avatar Andrew Grieve Committed by Commit Bot

Add R8 playground/ directory

I've several times had to recreate this structure. Thinking it makes
sense to have it checked in.

Change-Id: Id8e6ec0cfff38725c1c9da925f9bb783fb79a8f7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2137814Reviewed-by: default avatarSam Maier <smaier@chromium.org>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#756902}
parent 006f47d7
......@@ -11,6 +11,7 @@ R8 is a proguard-like optimizer that also has the ability to dex.
Local Modifications:
* Refer to commit descriptions within "patches" directory.
* Added "playground" directory for quick "how does this optimize" tests.
Update Instructions:
# Download R8:
......
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/**
* Add a snippet of code here that you want to test the optimization of.
*/
public class Playground {
public static void main(String[] args) {
System.out.println("Your test here");
}
private static native boolean doThing(long ptr, String s);
}
#!/bin/bash
# Copyright 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Usage:
# Make edits to *.java and *.pgcfg
# Then run: ./build.sh | less
rm -f *.class
javac *.java && \
java -jar ../lib/r8.jar *.class --output . --lib ../../jdk/current --no-minification --pg-conf playground.pgcfg && \
../../android_sdk/public/build-tools/29.0.2/dexdump -d classes.dex > dexdump.txt
# Copyright 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-keep class Playground {
native *** *(...);
public static void main(...);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment