|
1 | 1 | package au.com.dius.pact.provider.gradle
|
2 | 2 |
|
| 3 | +import groovy.transform.CompileStatic |
| 4 | +import org.gradle.api.Action |
3 | 5 | import org.gradle.api.NamedDomainObjectContainer
|
4 |
| -import org.gradle.util.ConfigureUtil |
5 | 6 |
|
6 | 7 | /**
|
7 | 8 | * Extension object for pact plugin
|
8 | 9 | */
|
| 10 | +@CompileStatic |
9 | 11 | class PactPluginExtension {
|
10 | 12 |
|
11 | 13 | final NamedDomainObjectContainer<GradleProviderInfo> serviceProviders
|
12 | 14 |
|
13 | 15 | PactPublish publish
|
| 16 | + |
14 | 17 | VerificationReports reports
|
15 | 18 |
|
16 |
| - PactPluginExtension(serviceProviders) { |
17 |
| - this.serviceProviders = serviceProviders |
| 19 | + PactPluginExtension(NamedDomainObjectContainer<GradleProviderInfo> serviceProviders) { |
| 20 | + this.serviceProviders = serviceProviders |
18 | 21 | }
|
19 | 22 |
|
20 | 23 | @SuppressWarnings('ConfusingMethodName')
|
21 |
| - def serviceProviders(Closure closure) { |
22 |
| - serviceProviders.configure(closure) |
| 24 | + void serviceProviders(Action<? extends NamedDomainObjectContainer<GradleProviderInfo>> configureAction) { |
| 25 | + configureAction.execute(serviceProviders) |
23 | 26 | }
|
24 | 27 |
|
25 | 28 | @SuppressWarnings('ConfusingMethodName')
|
26 |
| - def publish(Closure closure) { |
| 29 | + void publish(Action<? extends PactPublish> configureAction) { |
27 | 30 | publish = new PactPublish()
|
28 |
| - ConfigureUtil.configure(closure, publish) |
| 31 | + configureAction.execute(publish) |
29 | 32 | }
|
30 | 33 |
|
31 |
| - @SuppressWarnings('ConfusingMethodName') |
32 |
| - def reports(Closure closure) { |
33 |
| - reports = new VerificationReports() |
34 |
| - ConfigureUtil.configure(closure, reports) |
35 |
| - } |
| 34 | + @SuppressWarnings('ConfusingMethodName') |
| 35 | + void reports(Action<? extends VerificationReports> configureAction) { |
| 36 | + reports = new VerificationReports() |
| 37 | + configureAction.execute(reports) |
| 38 | + } |
36 | 39 | }
|
0 commit comments