Class CheckAccessModifierTask

java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
org.jenkinsci.gradle.plugins.jpi2.accmod.CheckAccessModifierTask
All Implemented Interfaces:
Comparable<org.gradle.api.Task>, org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.TaskInternal, org.gradle.api.Named, org.gradle.api.plugins.ExtensionAware, org.gradle.api.Task, org.gradle.util.Configurable<org.gradle.api.Task>

@CacheableTask public abstract class CheckAccessModifierTask extends org.gradle.api.DefaultTask
Submits parallel CheckAccess work items — one per compilation output directory — to enforce @Restricted API access rules from kohsuke.accmod.
  • Nested Class Summary

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

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

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Standard name under which this task is registered.
    static final String
    Property prefix used to pass access-modifier settings, e.g.

    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
    CheckAccessModifierTask(org.gradle.workers.WorkerExecutor workerExecutor)
    Gradle injects the WorkerExecutor; remaining properties are created eagerly so the plugin can wire them before task execution.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Submits one CheckAccess work item per compilation directory using classpath-isolated workers.
    org.gradle.api.file.ConfigurableFileCollection
     
    org.gradle.api.provider.MapProperty<String,Object>
     
    org.gradle.api.file.ConfigurableFileCollection
     
    org.gradle.api.file.ConfigurableFileCollection
     
    org.gradle.api.provider.Property<Boolean>
     
    org.gradle.api.file.DirectoryProperty
     

    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

    acceptServiceReferences, appendParallelSafeAction, doNotTrackState, doNotTrackStateIf, getAsDynamicObject, getIdentityPath, getImpliesSubProjects, getLifecycleDependencies, getOnlyIf, getReasonNotToTrackState, getReasonsNotToTrackState, getReasonTaskIsIncompatibleWithConfigurationCache, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isCompatibleWithConfigurationCache, isEnabled, isHasCustomActions, notCompatibleWithConfigurationCache, prependParallelSafeAction, restoreOnlyIf, restoreTaskActions, 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, notCompatibleWithConfigurationCache
  • Field Details

    • NAME

      public static final String NAME
      Standard name under which this task is registered.
      See Also:
    • PREFIX

      public static final String PREFIX
      Property prefix used to pass access-modifier settings, e.g. checkAccessModifier.someKey.
      See Also:
  • Constructor Details

    • CheckAccessModifierTask

      @Inject public CheckAccessModifierTask(org.gradle.workers.WorkerExecutor workerExecutor)
      Gradle injects the WorkerExecutor; remaining properties are created eagerly so the plugin can wire them before task execution.
      Parameters:
      workerExecutor - Gradle-provided executor for submitting classpath-isolated work
  • Method Details

    • getAccessModifierClasspath

      @Classpath public org.gradle.api.file.ConfigurableFileCollection getAccessModifierClasspath()
      Returns:
      classpath containing the kohsuke-accmod checker and its dependencies
    • getAccessModifierProperties

      @Input public org.gradle.api.provider.MapProperty<String,Object> getAccessModifierProperties()
      Returns:
      additional properties forwarded to the checker (e.g. project-property overrides)
    • getCompileClasspath

      @CompileClasspath public org.gradle.api.file.ConfigurableFileCollection getCompileClasspath()
      Returns:
      full compile classpath so the checker can resolve type hierarchies
    • getCompilationDirs

      @InputFiles @Classpath public org.gradle.api.file.ConfigurableFileCollection getCompilationDirs()
      Returns:
      directories of compiled .class files to scan for @Restricted violations
    • getIgnoreFailures

      @Input public org.gradle.api.provider.Property<Boolean> getIgnoreFailures()
      Returns:
      true when violations are logged as warnings rather than failing the build
    • getOutputDirectory

      @OutputDirectory public org.gradle.api.file.DirectoryProperty getOutputDirectory()
      Returns:
      directory where per-compilation-directory violation reports are written
    • check

      public void check()
      Submits one CheckAccess work item per compilation directory using classpath-isolated workers.