Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for KotlinClosure1 (0.22 sec)

  1. platforms/core-configuration/kotlin-dsl/src/test/kotlin/org/gradle/kotlin/dsl/GroovyInteroperabilityTest.kt

        }
    
        @Test
        fun `can adapt unary function using KotlinClosure1`() {
    
            fun closure(function: String.() -> String) = KotlinClosure1(function)
    
            assertEquals(
                "GROOVY",
                closure { uppercase(Locale.US) }.call("groovy")
            )
        }
    
        @Test
        fun `can adapt unary null receiving function using KotlinClosure1`() {
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Wed Aug 02 08:06:49 UTC 2023
    - 10.1K bytes
    - Viewed (0)
  2. platforms/documentation/docs/src/snippets/kotlinDsl/interoperability-kotlinClosure/kotlin/build.gradle.kts

    // tag::kotlinClosure[]
    somePlugin {
    
        // Adapt parameter-less function
        takingParameterLessClosure(KotlinClosure0({
            "result"
        }))
    
        // Adapt unary function
        takingUnaryClosure(KotlinClosure1<String, String>({
            "result from single parameter $this"
        }))
    
        // Adapt binary function
        takingBinaryClosure(KotlinClosure2<String, String, String>({ a, b ->
            "result from parameters $a and $b"
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Mon Nov 27 17:53:42 UTC 2023
    - 1K bytes
    - Viewed (0)
  3. platforms/core-configuration/kotlin-dsl/src/main/kotlin/org/gradle/kotlin/dsl/GroovyInteroperability.kt

     *
     * @param T the expected type of the single argument to the closure.
     * @param action the function to be adapted.
     *
     * @see [KotlinClosure1]
     */
    fun <T> Any.closureOf(action: T.() -> Unit): Closure<Any?> =
        KotlinClosure1(action, this, this)
    
    
    /**
     * Adapts a Kotlin function to a Groovy [Closure] that operates on the
     * configured Closure delegate.
     *
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Wed Aug 02 08:06:49 UTC 2023
    - 9.7K bytes
    - Viewed (0)
  4. testing/architecture-test/src/changes/archunit-store/public-api-mutable-properties.txt

    Method <org.gradle.kotlin.dsl.KotlinClosure0.getFunction()> does not have raw return type assignable to org.gradle.api.provider.Provider in (GroovyInteroperability.kt:0)
    Method <org.gradle.kotlin.dsl.KotlinClosure1.getFunction()> does not have raw return type assignable to org.gradle.api.provider.Provider in (GroovyInteroperability.kt:0)
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Fri Jun 07 22:42:49 UTC 2024
    - 160.5K bytes
    - Viewed (0)
Back to top