Handle the "jvm_version" manifest attribute

This commit is contained in:
Bernd Ahlers
2025-06-16 20:08:26 +02:00
parent a46a548326
commit f40367439e
3 changed files with 7 additions and 1 deletions

View File

@@ -13,6 +13,7 @@ import (
const DownloadedManifestPrefix = "downloaded-manifest"
type Manifest struct {
JVMVersion int `json:"jvm_version,omitzero"`
Modules []ManifestModule `json:"modules"`
Includes []string `json:"includes,omitempty"`
DefaultApply ManifestApply `json:"default_apply,omitempty"`

View File

@@ -20,6 +20,7 @@ type Project struct {
Server Module
Modules []Module
AssemblyPlatforms []string
JVMVersion int
}
type Apply struct {
@@ -276,6 +277,7 @@ func New(config config.Config, manifestFiles []string, options ...projectOption)
Server: server,
Modules: projectModules,
AssemblyPlatforms: readManifest.AssemblyPlatforms,
JVMVersion: readManifest.JVMVersion,
}
return project

View File

@@ -18,6 +18,7 @@ type TemplateInventory struct {
Dependencies []p.Module
Assemblies map[string][]Assembly
AssemblyPlatforms []string
JVMVersion int
}
type Assembly struct {
@@ -75,12 +76,14 @@ func WriteXmlFile(config config.Config, project p.Project, templateFile string,
Dependencies: p.MavenDependencies(project),
Assemblies: mavenAssemblies(project),
AssemblyPlatforms: project.AssemblyPlatforms,
JVMVersion: project.JVMVersion,
}
var buf bytes.Buffer
if err := tmpl.Execute(&buf, &inventory); err != nil {
logger.Fatal("Unable to execute template: %v", err)
logger.Error("Unable to execute template: %v", err)
logger.Fatal("Please make sure you are running the latest version. Use the `self-update` command to update the CLI.")
}
if err := os.WriteFile(outputFile, buf.Bytes(), 0644); err != nil {