Class InstrumentTask

  • All Implemented Interfaces:
    java.lang.Cloneable

    public final class InstrumentTask
    extends org.apache.tools.ant.Task
    ANT task to run coroutine instrumentation.

    Sample usage in build script:

        <taskdef name="InstrumentTask" classname="com.offbynull.coroutines.antplugin.InstrumentTask">
            <classpath>
                <pathelement location="ant-plugin-{version}-shaded.jar"/>
            </classpath>
        </taskdef>
        
        <target name="-post-compile">
            <InstrumentTask classpath="somelib.jar;somefolder;someotherlib.jar" sourceDirectory="build" targetDirectory="build"/>
        </target>
     
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean autoSerializable  
      private java.lang.String classpath  
      private boolean debugMode  
      private java.lang.String markerType  
      private java.io.File sourceDirectory  
      private java.io.File targetDirectory  
      • Fields inherited from class org.apache.tools.ant.Task

        target, taskName, taskType, wrapper
      • Fields inherited from class org.apache.tools.ant.ProjectComponent

        description, location, project
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void execute()  
      void setAutoSerializable​(boolean autoSerializable)
      Sets the auto-serializable flag.
      void setClasspath​(java.lang.String classpath)
      Sets the classpath -- required by instrumenter when instrumenting class files.
      void setDebugMode​(boolean debugMode)
      Sets the debug mode.
      void setMarkerType​(java.lang.String markerType)
      Sets the marker type.
      void setSourceDirectory​(java.io.File sourceDirectory)
      Sets the directory to read class files from.
      void setTargetDirectory​(java.io.File targetDirectory)
      Sets the directory to write instrumented class files to.
      • Methods inherited from class org.apache.tools.ant.Task

        bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
      • Methods inherited from class org.apache.tools.ant.ProjectComponent

        clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • markerType

        private java.lang.String markerType
      • debugMode

        private boolean debugMode
      • autoSerializable

        private boolean autoSerializable
      • classpath

        private java.lang.String classpath
      • sourceDirectory

        private java.io.File sourceDirectory
      • targetDirectory

        private java.io.File targetDirectory
    • Constructor Detail

      • InstrumentTask

        public InstrumentTask()
        Constructs a InstrumentTask object.
    • Method Detail

      • setMarkerType

        public void setMarkerType​(java.lang.String markerType)
        Sets the marker type. Defaults to NONE.
        Parameters:
        markerType - debug marker type (must be a value from DebugGenerators.MarkerType)
      • setDebugMode

        public void setDebugMode​(boolean debugMode)
        Sets the debug mode. Defaults to false.
        Parameters:
        debugMode - debug mode
      • setAutoSerializable

        public void setAutoSerializable​(boolean autoSerializable)
        Sets the auto-serializable flag. Defaults to true.
        Parameters:
        autoSerializable - auto-serializable
      • setClasspath

        public void setClasspath​(java.lang.String classpath)
        Sets the classpath -- required by instrumenter when instrumenting class files.
        Parameters:
        classpath - semicolon delimited classpath
      • setSourceDirectory

        public void setSourceDirectory​(java.io.File sourceDirectory)
        Sets the directory to read class files from.
        Parameters:
        sourceDirectory - source directory
      • setTargetDirectory

        public void setTargetDirectory​(java.io.File targetDirectory)
        Sets the directory to write instrumented class files to.
        Parameters:
        targetDirectory - target directory
      • execute

        public void execute()
                     throws org.apache.tools.ant.BuildException
        Overrides:
        execute in class org.apache.tools.ant.Task
        Throws:
        org.apache.tools.ant.BuildException