Skip to content

Commit

Permalink
Add Java packages overrides to schema
Browse files Browse the repository at this point in the history
  • Loading branch information
pawelprazak committed Jul 15, 2022
1 parent 486277e commit 3b1863e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## HEAD (Unreleased)

- Memory usage for most programs is greatly reduced [#1689](https://github.com/pulumi/pulumi-azure-native/pull/1689)
- All Java packages changed to be more intuitive, unfortunately this is a breaking change for Java version [1829](https://github.com/pulumi/pulumi-azure-native/pull/1829)

## 1.67.0 (2022-07-12)

Expand Down
11 changes: 10 additions & 1 deletion provider/pkg/gen/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ func PulumiSchema(providerMap openapi.AzureProviders) (*pschema.PackageSpec, *re
csharpNamespaces := map[string]string{
"azure-native": "AzureNative",
}
javaPackages := map[string]string{
"azure-native": "azurenative",
}
pythonModuleNames := map[string]string{}
golangImportAliases := map[string]string{}

Expand All @@ -210,12 +213,14 @@ func PulumiSchema(providerMap openapi.AzureProviders) (*pschema.PackageSpec, *re
examples: exampleMap,
}

// Populate C#, Python and Go module mapping.
// Populate C#, Java, Python and Go module mapping.
module := gen.providerToModule(providerName)
csharpNamespaces[strings.ToLower(providerName)] = providerName
javaPackages[module] = strings.ToLower(providerName)
if version != "" {
csVersion := strings.Title(csharpVersionReplacer.Replace(version))
csharpNamespaces[module] = fmt.Sprintf("%s.%s", providerName, csVersion)
javaPackages[module] = fmt.Sprintf("%s.%s", strings.ToLower(providerName), version)
}
pythonModuleNames[module] = module
golangImportAliases[filepath.Join(goBasePath, module)] = strings.ToLower(providerName)
Expand Down Expand Up @@ -293,6 +298,10 @@ version using infrastructure as code, which Pulumi then uses to drive the ARM AP
"namespaces": csharpNamespaces,
})

pkg.Language["java"] = rawMessage(map[string]interface{}{
"packages": javaPackages,
})

return &pkg, &metadata, exampleMap, nil
}

Expand Down

0 comments on commit 3b1863e

Please sign in to comment.