Package org.robolectric.preinstrumented
Class JarInstrumentor
java.lang.Object
org.robolectric.preinstrumented.JarInstrumentor
Runs Robolectric invokedynamic instrumentation on an android-all jar.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
exit
(int status) CallsSystem.exit(int)
.protected void
instrumentJar
(File sourceJarFile, File destJarFile, File destNativesFile, boolean throwOnNatives) Performs the JAR instrumentation.static void
-
Constructor Details
-
JarInstrumentor
public JarInstrumentor()
-
-
Method Details
-
main
- Throws:
IOException
ClassNotFoundException
-
exit
protected void exit(int status) CallsSystem.exit(int)
. Overridden during tests to avoid exiting during tests. -
instrumentJar
protected void instrumentJar(File sourceJarFile, File destJarFile, File destNativesFile, boolean throwOnNatives) throws IOException, ClassNotFoundException Performs the JAR instrumentation.- Parameters:
sourceJarFile
- The source JAR to process.destJarFile
- The destination JAR with the instrumented method calls.destNativesFile
- Optional file to write native calls signature. Null to disable.throwOnNatives
- Whether native calls should be instrumented as throwing a dedicated exception (true) or no-op (false).- Throws:
IOException
ClassNotFoundException
-