Class ExtractAnnotations

java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
com.android.build.gradle.internal.tasks.BaseTask
com.android.build.gradle.internal.tasks.AndroidVariantTask
com.android.build.gradle.internal.tasks.NonIncrementalTask
com.android.build.gradle.tasks.ExtractAnnotations
All Implemented Interfaces:
com.android.build.gradle.internal.tasks.VariantAwareTask, Comparable<org.gradle.api.Task>, org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.TaskInternal, org.gradle.api.plugins.ExtensionAware, org.gradle.api.Task, org.gradle.util.Configurable<org.gradle.api.Task>

@CacheableTask public abstract class ExtractAnnotations extends com.android.build.gradle.internal.tasks.NonIncrementalTask
Task which extracts annotations from the source files, and writes them to one of two possible destinations:
  • A "external annotations" file (pointed to by getOutput()) which records the annotations in a zipped XML format for use by the IDE and by lint to associate the (source retention) annotations back with the compiled code
We typically only extract external annotations when building libraries; ProGuard annotations are extracted when building libraries (to record in the AAR), or when building an app module where ProGuarding is enabled.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     

    Nested classes/interfaces inherited from interface org.gradle.api.Task

    org.gradle.api.Task.Namer
  • Field Summary

    Fields inherited from class com.android.build.gradle.internal.tasks.AndroidVariantTask

    variantName

    Fields inherited from interface org.gradle.api.Task

    TASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
     
    org.gradle.api.file.FileCollection
    Boot classpath: typically android.jar
    abstract org.gradle.api.file.ConfigurableFileCollection
     
    The encoding to use when reading source files.
    boolean
     
    org.gradle.api.file.FileCollection
     
    abstract org.gradle.api.provider.Property<com.android.build.gradle.internal.services.LintClassLoaderBuildService>
     
    abstract com.android.build.gradle.internal.lint.LintTool
     
    abstract org.gradle.api.file.RegularFileProperty
    The output .zip file to write the annotations database to, if any
    org.gradle.api.file.FileTree
     
    abstract org.gradle.api.provider.Property<String>
     
    abstract org.gradle.api.file.RegularFileProperty
    The output .txt file to write the typedef recipe file to.
    void
    setBootClasspath(org.gradle.api.file.FileCollection bootClasspath)
     
    void
    setEncoding(String encoding)
     

    Methods inherited from class com.android.build.gradle.internal.tasks.NonIncrementalTask

    taskAction

    Methods inherited from class com.android.build.gradle.internal.tasks.AndroidVariantTask

    getVariantName, setVariantName

    Methods inherited from class com.android.build.gradle.internal.tasks.BaseTask

    getAnalyticsService, getProjectPath, getWorkerExecutor, recordTaskAction

    Methods inherited from class org.gradle.api.DefaultTask

    compareTo, configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOutputs, getPath, getProject, getShouldRunAfter, getState, getTaskDependencies, getTemporaryDir, getTimeout, hasProperty, mustRunAfter, onlyIf, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesService

    Methods inherited from class org.gradle.api.internal.AbstractTask

    appendParallelSafeAction, doNotTrackState, getAsDynamicObject, getConvention, getIdentityPath, getImpliesSubProjects, getLifecycleDependencies, getOnlyIf, getReasonNotToTrackState, getReasonTaskIsIncompatibleWithConfigurationCache, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isCompatibleWithConfigurationCache, isEnabled, isHasCustomActions, notCompatibleWithConfigurationCache, prependParallelSafeAction, setImpliesSubProjects

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.gradle.api.Task

    doNotTrackState, getConvention, notCompatibleWithConfigurationCache

    Methods inherited from interface com.android.build.gradle.internal.tasks.VariantAwareTask

    getAnalyticsService
  • Constructor Details

    • ExtractAnnotations

      public ExtractAnnotations()
  • Method Details

    • getLintTool

      public abstract com.android.build.gradle.internal.lint.LintTool getLintTool()
    • getSource

      @NonNull @PathSensitive(NAME_ONLY) @InputFiles @IgnoreEmptyDirectories public org.gradle.api.file.FileTree getSource()
    • getClasspath

      @CompileClasspath public abstract org.gradle.api.file.ConfigurableFileCollection getClasspath()
    • getBootClasspath

      @CompileClasspath public org.gradle.api.file.FileCollection getBootClasspath()
      Boot classpath: typically android.jar
    • setBootClasspath

      public void setBootClasspath(org.gradle.api.file.FileCollection bootClasspath)
    • getLibraries

      @CompileClasspath public org.gradle.api.file.FileCollection getLibraries()
    • getOutput

      @OutputFile public abstract org.gradle.api.file.RegularFileProperty getOutput()
      The output .zip file to write the annotations database to, if any
    • getTypedefFile

      @OutputFile public abstract org.gradle.api.file.RegularFileProperty getTypedefFile()
      The output .txt file to write the typedef recipe file to. A "recipe" file is a file which describes typedef classes, typically ones that should be deleted. It is generated by this ExtractAnnotations task and consumed by the com.android.tools.lint.typedefs.TypedefRemover.
    • getEncoding

      @NonNull @Input public String getEncoding()
      The encoding to use when reading source files. The output file will ignore this and will always be a UTF-8 encoded .xml file inside the annotations zip file.
    • setEncoding

      public void setEncoding(String encoding)
    • getStrictTypedefRetention

      @Input public abstract org.gradle.api.provider.Property<String> getStrictTypedefRetention()
    • getLintClassLoaderBuildService

      @Internal public abstract org.gradle.api.provider.Property<com.android.build.gradle.internal.services.LintClassLoaderBuildService> getLintClassLoaderBuildService()
    • doTaskAction

      protected void doTaskAction()
      Specified by:
      doTaskAction in class com.android.build.gradle.internal.tasks.NonIncrementalTask
    • getHasAndroidAnnotations

      @Input public boolean getHasAndroidAnnotations()