From 271061d9e01aaafc2ab16d01ced1752528128996 Mon Sep 17 00:00:00 2001 From: Daniel Bradley Date: Wed, 11 Dec 2024 17:32:14 +0000 Subject: [PATCH] Always specify default SDK version Without the pulumi java dependency the SDK is not buildable. We can't infer this at build time because go modules don't have a 'build phase' and can't lookup their own version. --- pkg/codegen/java/gen.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/codegen/java/gen.go b/pkg/codegen/java/gen.go index 2c684b3117c..1d7650c55a7 100644 --- a/pkg/codegen/java/gen.go +++ b/pkg/codegen/java/gen.go @@ -13,6 +13,7 @@ import ( "strconv" "strings" + "github.com/blang/semver" "github.com/pulumi/pulumi/pkg/v3/codegen" "github.com/pulumi/pulumi/pkg/v3/codegen/schema" "github.com/pulumi/pulumi/sdk/v3/go/common/util/contract" @@ -20,6 +21,9 @@ import ( "github.com/pulumi/pulumi-java/pkg/codegen/java/names" ) +// This should be bumped as required at the point of release. +var DEFAULT_SDK_VERSION = semver.Version{Major: 0, Minor: 18, Patch: 0} + func packageName(packages map[string]string, name string) string { if pkg, ok := packages[name]; ok { return pkg @@ -2039,7 +2043,9 @@ func generateModuleContextMap(tool string, pkg *schema.Package) (map[string]*mod panic(fmt.Sprintf("Failed to cast `pkg.Language[\"java\"]`=%v to `PackageInfo`", raw)) } } - javaInfo = javaInfo.WithDefaultDependencies() + javaInfo = javaInfo. + WithDefaultDependencies(). + WithJavaSdkDependencyDefault(DEFAULT_SDK_VERSION) info = &javaInfo infos[def] = info }