Skip to content

Commit

Permalink
chore: Gradle updated to v8
Browse files Browse the repository at this point in the history
  • Loading branch information
augi committed Aug 9, 2023
1 parent 178316b commit ea8f5e1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
8 changes: 3 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -87,19 +87,17 @@ nexusPublishing {

project.ext.set('gradle.publish.key', System.getenv('GRADLE_PORTAL_KEY'))
project.ext.set('gradle.publish.secret', System.getenv('GRADLE_PORTAL_SECRET'))
pluginBundle {
website = 'https://github.com/avast/gradle-docker-compose-plugin'
vcsUrl = 'https://github.com/avast/gradle-docker-compose-plugin'
tags = ['docker', 'docker-compose']
}

gradlePlugin {
website = 'https://github.com/avast/gradle-docker-compose-plugin'
vcsUrl = 'https://github.com/avast/gradle-docker-compose-plugin'
plugins {
dockerComposePlugin {
id = 'com.avast.gradle.docker-compose'
displayName = 'Gradle Docker Compose plugin'
description = 'Simplifies usage of Docker Compose for integration testing in Gradle environment.'
implementationClass = 'com.avast.gradle.dockercompose.DockerComposePlugin'
tags.set(['docker', 'docker-compose'])
}
}
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ abstract class ComposeExtension extends ComposeSettings {
s
} else if (args.length == 1 && args[0] instanceof Closure) {
ComposeSettings s = getOrCreateNested(name)
ConfigureUtil.configure(args[0] as Closure, s)
Closure closure = (Closure)args[0].clone()
closure.setResolveStrategy(Closure.DELEGATE_FIRST)
closure.setDelegate(s)
closure.call(s)
s

This comment has been minimized.

Copy link
@tkrah

tkrah Aug 9, 2023

@augi why s here? You already do closure.call(s) - shouldn't that be sufficient already?

This comment has been minimized.

Copy link
@augi

augi Aug 9, 2023

Author Member

To be honest, I don't know, I got inspiration from ClosureBackedAction class where it is used in this way.

This comment has been minimized.

Copy link
@tkrah

tkrah Aug 9, 2023

If you look at that class they also just do closure.call(s) and don't call delegate / s again, which basically just do "call" again, calling it twice in the end (if my groovy knowledge does not fail me here ;) )

This comment has been minimized.

Copy link
@augi

augi Aug 9, 2023

Author Member

The original code is here: https://github.com/gradle/gradle/blob/master/subprojects/model-core/src/main/java/org/gradle/util/ClosureBackedAction.java#L83

There is the if, and for my testing, the getMaximumNumberOfParameters returns 1.

This comment has been minimized.

Copy link
@tkrah

tkrah Aug 9, 2023

Sure, but your closure has delegate first strategy set and your delegate is s - so doing closure.call(s) should already call s - right? Why call it again in line 55 with s?

This comment has been minimized.

Copy link
@augi

augi Aug 9, 2023

Author Member

I'm not an expert in this, so I prefer to follow the code from Gradle folks.

It really looks like a duplication when DELEGATE_FIRST is used, so you could try to prepare a PR for the original code there 🙏

This comment has been minimized.

Copy link
@tkrah

tkrah Aug 9, 2023

It does no harm calling it twice though, so I can live with that if you can too (which you do), just wondered and wanted to ask.

} else {
getOrCreateNested(name)
Expand Down

0 comments on commit ea8f5e1

Please sign in to comment.