diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index 5ecddce9258..dfd3ce3ed2d 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -1,3 +1,5 @@ ### Improvements +- Codegen: pluginDownloadURL is now supported through the automatically generated build.gradle + ### Bug Fixes diff --git a/pkg/codegen/java/build.gradle.template b/pkg/codegen/java/build.gradle.template index fa1e2fa8b53..1f746c5208c 100644 --- a/pkg/codegen/java/build.gradle.template +++ b/pkg/codegen/java/build.gradle.template @@ -77,6 +77,9 @@ def genPulumiResources = tasks.register('genPulumiResources') { def info = new Object() info.metaClass.resource = true info.metaClass.name = "{{ .ArtifactID }}" + {{- if .PluginDownloadURL }} + info.metaClass.server = "{{ .PluginDownloadURL }}" + {{- end }} info.metaClass.version = resolvedVersion def infoJson = new groovy.json.JsonBuilder(info).toPrettyString() new File(outDir, "plugin.json").text = infoJson @@ -192,4 +195,4 @@ if (signingKey) { useInMemoryPgpKeys(signingKey, signingPassword) sign publishing.publications.mainPublication } -} \ No newline at end of file +} diff --git a/pkg/codegen/java/templates_gradle.go b/pkg/codegen/java/templates_gradle.go index 01d3c96b983..24b42bc3704 100644 --- a/pkg/codegen/java/templates_gradle.go +++ b/pkg/codegen/java/templates_gradle.go @@ -83,6 +83,7 @@ type gradleTemplateContext struct { GradleNexusPublishPluginEnabled bool GradleNexusPublishPluginVersion string GradleTestJUnitPlatformEnabled bool + PluginDownloadURL string } func newGradleTemplateContext( @@ -95,6 +96,7 @@ func newGradleTemplateContext( ProjectURL: pkg.Repository, ProjectGitURL: formatGitURL(pkg.Repository), GradleTestJUnitPlatformEnabled: packageInfo.GradleTest == "JUnitPlatform", + PluginDownloadURL: pkg.PluginDownloadURL, } if packageInfo.GradleNexusPublishPluginVersion != "" {