Class GroovycSupport

java.lang.Object
org.openclover.ant.groovy.GroovycSupport
All Implemented Interfaces:
EventListener, org.apache.tools.ant.BuildListener

public class GroovycSupport extends Object implements org.apache.tools.ant.BuildListener
  • Method Details

    • ensureAddedTo

      public static void ensureAddedTo(@NotNull org.apache.tools.ant.Project project)
    • buildStarted

      public void buildStarted(@NotNull org.apache.tools.ant.BuildEvent buildEvent)
      Specified by:
      buildStarted in interface org.apache.tools.ant.BuildListener
    • buildFinished

      public void buildFinished(@NotNull org.apache.tools.ant.BuildEvent buildEvent)
      Specified by:
      buildFinished in interface org.apache.tools.ant.BuildListener
    • targetStarted

      public void targetStarted(@NotNull org.apache.tools.ant.BuildEvent buildEvent)
      Specified by:
      targetStarted in interface org.apache.tools.ant.BuildListener
    • targetFinished

      public void targetFinished(@NotNull org.apache.tools.ant.BuildEvent buildEvent)
      Specified by:
      targetFinished in interface org.apache.tools.ant.BuildListener
    • messageLogged

      public void messageLogged(@NotNull org.apache.tools.ant.BuildEvent buildEvent)
      Specified by:
      messageLogged in interface org.apache.tools.ant.BuildListener
    • taskFinished

      public void taskFinished(@NotNull org.apache.tools.ant.BuildEvent buildEvent)
      Specified by:
      taskFinished in interface org.apache.tools.ant.BuildListener
    • taskStarted

      public void taskStarted(@NotNull org.apache.tools.ant.BuildEvent buildEvent)
      Specified by:
      taskStarted in interface org.apache.tools.ant.BuildListener
    • prepareForGroovyInstrumentation

      public void prepareForGroovyInstrumentation(@NotNull org.apache.tools.ant.Task groovyc, @NotNull org.apache.tools.ant.Project project, @NotNull AntInstrumentationConfig config) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, org.openclover.runtime.api.CloverException, IOException
      Extract grover.jar so that groovyc compiler will pick Clover's AST transformer. Also instrument Java files and redirect source folders if we have a joint Groovy-Java compilation.
      Throws:
      NoSuchMethodException
      IllegalAccessException
      InvocationTargetException
      org.openclover.runtime.api.CloverException
      IOException
    • extractGroverJar

      @Nullable public static File extractGroverJar(@Nullable File groverJar, boolean deleteOnExit)
      Extracts the grover.jar file from a resource embedded in the Clover JAR file.
      Parameters:
      groverJar - target location for extracted grover.jar file or null for default location
      deleteOnExit - whether file should be deleted on JVM termination
      Returns:
      File location of extracted grover.jar of null if failed
    • newConfigDir

      public static File newConfigDir(org.openclover.core.cfg.instr.InstrumentationConfig config, File parent) throws IOException
      Throws:
      IOException
    • initGroovycTaskNames

      protected void initGroovycTaskNames(@NotNull org.apache.tools.ant.Project project)
    • isGroovyc

      protected boolean isGroovyc(@NotNull org.apache.tools.ant.Task task)