Skip to content

Commit

Permalink
Gradle 8.8-rc-1
Browse files Browse the repository at this point in the history
  • Loading branch information
rpalcolea committed Apr 26, 2024
1 parent be577ff commit 479add0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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

/**
* <p>Configures {@code target} with {@code configureClosure}, via the {@link Configurable} interface if necessary.</p>
Expand Down Expand Up @@ -36,14 +39,15 @@ class ConfigureUtil {
return target
}

@CompileDynamic
private static <T> void configureTarget(Closure configureClosure, T target, ConfigureDelegate closureDelegate) {
if (!(configureClosure instanceof GeneratedClosure)) {
new ClosureBackedAction<T>(configureClosure, Closure.DELEGATE_FIRST, false).execute(target)
new ClosureBackedAction<T>(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<T>(withNewOwner, Closure.OWNER_ONLY, false).execute(target)
new ClosureBackedAction<T>(withNewOwner, OWNER_ONLY, false).execute(target)
}
}

0 comments on commit 479add0

Please sign in to comment.