From d203f5de885081c9f9ba4e1eacc2ce618df856ba Mon Sep 17 00:00:00 2001 From: Till Krullmann Date: Thu, 24 Sep 2020 09:59:53 +0200 Subject: [PATCH] HelmDownloadClient: use ObjectFactory to construct nested object, to enable Groovy syntax for setting properties fixes #73 --- .../gradle/plugins/helm/dsl/HelmDownloadClient.kt | 5 +++-- .../unbrokendome/gradle/plugins/helm/dsl/HelmExtension.kt | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/org/unbrokendome/gradle/plugins/helm/dsl/HelmDownloadClient.kt b/src/main/kotlin/org/unbrokendome/gradle/plugins/helm/dsl/HelmDownloadClient.kt index c989e1ea..d5873494 100644 --- a/src/main/kotlin/org/unbrokendome/gradle/plugins/helm/dsl/HelmDownloadClient.kt +++ b/src/main/kotlin/org/unbrokendome/gradle/plugins/helm/dsl/HelmDownloadClient.kt @@ -12,6 +12,7 @@ import org.unbrokendome.gradle.plugins.helm.util.GRADLE_VERSION_6_2 import org.unbrokendome.gradle.plugins.helm.util.booleanProviderFromProjectProperty import org.unbrokendome.gradle.plugins.helm.util.property import org.unbrokendome.gradle.plugins.helm.util.providerFromProjectProperty +import javax.inject.Inject /** @@ -72,8 +73,8 @@ internal interface HelmDownloadClientInternal : HelmDownloadClient { } -internal class DefaultHelmDownloadClient -constructor( +internal open class DefaultHelmDownloadClient +@Inject constructor( private val project: Project ) : HelmDownloadClient, HelmDownloadClientInternal { diff --git a/src/main/kotlin/org/unbrokendome/gradle/plugins/helm/dsl/HelmExtension.kt b/src/main/kotlin/org/unbrokendome/gradle/plugins/helm/dsl/HelmExtension.kt index e3fbef89..7f03b806 100644 --- a/src/main/kotlin/org/unbrokendome/gradle/plugins/helm/dsl/HelmExtension.kt +++ b/src/main/kotlin/org/unbrokendome/gradle/plugins/helm/dsl/HelmExtension.kt @@ -72,7 +72,7 @@ private open class DefaultHelmExtension ConfigurableHelmServerOptions by HelmServerOptionsHolder(objects).applyConventions(project) { final override val downloadClient: HelmDownloadClient = - DefaultHelmDownloadClient(project) + objects.newInstance(DefaultHelmDownloadClient::class.java, project) final override val executable: Property =