Skip to content

Commit f0ef3b4

Browse files
fix: java importing crd fails (#257)
Fixes #234 Replace `/` with `.` Tested locally with the CRD example I'm writing for Java. Signed-off-by: campionfellin <campionfellin@gmail.com> *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 37ad98b commit f0ef3b4

File tree

1 file changed

+3
-2
lines changed
  • packages/cdk8s-cli/lib/import

1 file changed

+3
-2
lines changed

packages/cdk8s-cli/lib/import/base.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export abstract class ImportBase {
4444

4545
for (const name of this.moduleNames) {
4646
// output the name of the imported resource
47-
console.error(name);
47+
console.log(name);
4848

4949
const fileName = moduleNamePrefix ? `${moduleNamePrefix}-${name}.ts` : `${name}.ts`;
5050
code.openFile(fileName);
@@ -87,9 +87,10 @@ export abstract class ImportBase {
8787

8888
// java!
8989
if (options.targetLanguage === Language.JAVA) {
90+
const javaName = name.replace(/\//g, '.')
9091
opts.java = {
9192
outdir: '.',
92-
package: `imports.${moduleNamePrefix ? moduleNamePrefix + '.' + name : name}`
93+
package: `imports.${moduleNamePrefix ? moduleNamePrefix + '.' + javaName : javaName}`
9394
};
9495
}
9596

0 commit comments

Comments
 (0)