From 479add0dfdf2140e3be05922a6fd0f58239a9820 Mon Sep 17 00:00:00 2001 From: Roberto Perez Alcolea Date: Fri, 26 Apr 2024 09:49:17 -0700 Subject: [PATCH] Gradle 8.8-rc-1 --- gradle/wrapper/gradle-wrapper.properties | 2 +- .../nebula/plugin/release/util/ConfigureUtil.groovy | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index b82aa23..5208d7e 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-rc-1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/src/main/groovy/nebula/plugin/release/util/ConfigureUtil.groovy b/src/main/groovy/nebula/plugin/release/util/ConfigureUtil.groovy index cff5be9..59465c0 100644 --- a/src/main/groovy/nebula/plugin/release/util/ConfigureUtil.groovy +++ b/src/main/groovy/nebula/plugin/release/util/ConfigureUtil.groovy @@ -1,5 +1,6 @@ package nebula.plugin.release.util +import groovy.transform.CompileDynamic import org.codehaus.groovy.runtime.GeneratedClosure import org.gradle.internal.metaobject.ConfigureDelegate import org.gradle.util.Configurable @@ -8,6 +9,8 @@ import org.gradle.util.internal.ClosureBackedAction import javax.annotation.Nullable class ConfigureUtil { + public static final int DELEGATE_FIRST = 1 + public static final int OWNER_ONLY = 2 /** *

Configures {@code target} with {@code configureClosure}, via the {@link Configurable} interface if necessary.

@@ -36,14 +39,15 @@ class ConfigureUtil { return target } + @CompileDynamic private static void configureTarget(Closure configureClosure, T target, ConfigureDelegate closureDelegate) { if (!(configureClosure instanceof GeneratedClosure)) { - new ClosureBackedAction(configureClosure, Closure.DELEGATE_FIRST, false).execute(target) + new ClosureBackedAction(configureClosure, DELEGATE_FIRST, false).execute(target) return; } // Hackery to make closure execution faster, by short-circuiting the expensive property and method lookup on Closure Closure withNewOwner = configureClosure.rehydrate(target, closureDelegate, configureClosure.getThisObject()) - new ClosureBackedAction(withNewOwner, Closure.OWNER_ONLY, false).execute(target) + new ClosureBackedAction(withNewOwner, OWNER_ONLY, false).execute(target) } }