Class CompatibilityProjectExtension

java.lang.Object
groovy.lang.GroovyObjectSupport
groovy.lang.Closure<@Nullable Void>
org.gradle.plugin.compatibility.internal.groovy.CompatibilityProjectExtension
All Implemented Interfaces:
groovy.lang.GroovyCallable<Void>, groovy.lang.GroovyObject, Serializable, Cloneable, Runnable, Callable<Void>

public abstract class CompatibilityProjectExtension extends groovy.lang.Closure<@Nullable Void>
An extension that provides Project.compatibility(PluginDeclaration, Closure) for Gradle before 8.14. The doCall(PluginDeclaration, Closure) is effectively the public API.
See Also:
  • Field Summary

    Fields inherited from class groovy.lang.Closure

    DELEGATE_FIRST, DELEGATE_ONLY, DONE, IDENTITY, maximumNumberOfParameters, OWNER_FIRST, OWNER_ONLY, parameterTypes, SKIP, TO_SELF
  • Constructor Summary

    Constructors
    Constructor
    Description
    CompatibilityProjectExtension(org.gradle.api.Project owner)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable Void
    doCall(groovy.lang.Closure<?> ignored)
    A helper that provides a nicer error message when the build logic uses modern syntax on the old Gradle version.
    @Nullable Void
    doCall(org.gradle.plugin.devel.PluginDeclaration declaration, groovy.lang.Closure<?> configuration)
    Configure the provided declaration, maybe lazily.
    org.gradle.api.Project
     
    static void
    install(org.gradle.api.Project project)
    Register the necessary extensions so the compatibility syntax works.

    Methods inherited from class groovy.lang.Closure

    andThen, andThenSelf, andThenSelf, asWritable, call, call, call, clone, compose, composeSelf, composeSelf, curry, curry, dehydrate, getDelegate, getDirective, getMaximumNumberOfParameters, getParameterTypes, getProperty, getResolveStrategy, getThisObject, isCase, leftShift, leftShift, memoize, memoizeAtLeast, memoizeAtMost, memoizeBetween, ncurry, ncurry, rcurry, rcurry, rehydrate, rightShift, run, setDelegate, setDirective, setProperty, setResolveStrategy, throwRuntimeException, trampoline, trampoline

    Methods inherited from class groovy.lang.GroovyObjectSupport

    getMetaClass, setMetaClass

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface groovy.lang.GroovyObject

    invokeMethod
  • Constructor Details

    • CompatibilityProjectExtension

      @Inject public CompatibilityProjectExtension(org.gradle.api.Project owner)
  • Method Details

    • getOwner

      public org.gradle.api.Project getOwner()
      Overrides:
      getOwner in class groovy.lang.Closure<@Nullable Void>
    • doCall

      public @Nullable Void doCall(groovy.lang.Closure<?> ignored)
      A helper that provides a nicer error message when the build logic uses modern syntax on the old Gradle version.
      Parameters:
      ignored - configuration closure
      Returns:
      nothing
      Throws:
      UnsupportedOperationException - always
    • doCall

      public @Nullable Void doCall(org.gradle.plugin.devel.PluginDeclaration declaration, groovy.lang.Closure<?> configuration)
      Configure the provided declaration, maybe lazily.

      This method is part of the public API.

      Parameters:
      declaration - the declaration to configure
      configuration - the configuration closure
      Returns:
      null
    • install

      public static void install(org.gradle.api.Project project)
      Register the necessary extensions so the compatibility syntax works. This method should be only used internally.
      Parameters:
      project - the project to which the plugin is applied