Class JarInstrumentor

java.lang.Object
org.robolectric.preinstrumented.JarInstrumentor

public class JarInstrumentor extends Object
Runs Robolectric invokedynamic instrumentation on an android-all jar.
  • Constructor Details

    • JarInstrumentor

      public JarInstrumentor()
  • Method Details

    • main

      public static void main(String[] args) throws IOException, ClassNotFoundException
      Throws:
      IOException
      ClassNotFoundException
    • exit

      protected void exit(int status)
      Calls System.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