mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2026-11-30 10:24:33 -06:00
Add R8 for Android (#6591)
R8 is a whole-program optimizer that converts Java byte code to optimized dex code. It can be run with the same general steps (and JAR) as the existing D8 compiler. This change adds R8Compiler and the R8 keep-annotation library it relies on, makes this lib + Android API stubs default libraries for Android Java/Kotlin, and includes a small update to allow older versions of dex2oat (33.10) to run. https://r8.googlesource.com/r8
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
// For more information on using R8 and keep annotations, please refer to
|
||||
// - https://r8.googlesource.com/r8
|
||||
// - https://r8.googlesource.com/r8/+/refs/heads/main/doc/keepanno-guide.md
|
||||
|
||||
import com.android.tools.r8.keepanno.annotations.KeepItemKind;
|
||||
import com.android.tools.r8.keepanno.annotations.UsedByReflection;
|
||||
|
||||
class R8Example {
|
||||
@UsedByReflection(kind = KeepItemKind.CLASS_AND_MEMBERS)
|
||||
public static void main(String[] args) throws Exception {
|
||||
// code...
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user