Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for delegateClosureOf (0.14 sec)

  1. platforms/documentation/docs/src/snippets/kotlinDsl/interoperability-delegate-closure-of/kotlin/build.gradle.kts

    import org.akhikhl.gretty.FarmExtension
    
    plugins {
        id("org.gretty") version "4.0.3"
    }
    
    // tag::delegateClosureOf[]
    farms {
        farm("OldCoreWar", delegateClosureOf<FarmExtension> {
            // Config for the war here
        })
    }
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Mon Nov 27 17:53:42 UTC 2023
    - 257 bytes
    - Viewed (0)
  2. platforms/core-configuration/kotlin-dsl/src/main/kotlin/org/gradle/kotlin/dsl/GroovyInteroperability.kt

     * configured Closure delegate.
     *
     * @param T the expected type of the delegate argument to the closure.
     * @param action the function to be adapted.
     *
     * @see [KotlinClosure1]
     */
    fun <T> Any.delegateClosureOf(action: T.() -> Unit) =
        object : Closure<Unit>(this, this) {
            @Suppress("unused") // to be called dynamically by Groovy
            fun doCall() = uncheckedCast<T>(delegate).action()
        }
    
    
    /**
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Wed Aug 02 08:06:49 UTC 2023
    - 9.7K bytes
    - Viewed (0)
Back to top