Skip to content

Commit

Permalink
Always specify default SDK version
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
danielrbradley committed Dec 11, 2024
1 parent aee8bb3 commit 271061d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/codegen/java/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,17 @@ 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"

"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}

Check warning on line 25 in pkg/codegen/java/gen.go

View workflow job for this annotation

GitHub Actions / Lint pkg

var-naming: don't use ALL_CAPS in Go names; use CamelCase (revive)

func packageName(packages map[string]string, name string) string {
if pkg, ok := packages[name]; ok {
return pkg
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 271061d

Please sign in to comment.