Skip to content

Commit 7697571

Browse files
fix(go): shorten file names for sub-packages (#3927)
CDKTF is running into build issues one some providers due to file names being too long for golang to handle: https://github.com/cdktf/cdktf-provider-googlebeta/actions/runs/4002506018/jobs/6869839656#step:8:11 This is my slightly naive try to get rid of a few characters (especially with long package names) --- By submitting this pull request, I confirm that my contribution is made under the terms of the [Apache 2.0 license]. [Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.0
1 parent d0e4267 commit 7697571

File tree

4 files changed

+20733
-20750
lines changed

4 files changed

+20733
-20750
lines changed

packages/@jsii/java-runtime/pom.xml.t.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ process.stdout.write(`<?xml version="1.0" encoding="UTF-8"?>
6464
<javax-annotations.version>[1.3.2,1.4.0)</javax-annotations.version>
6565
<jetbrains-annotations.version>[13.0.0,24.0-a0)</jetbrains-annotations.version>
6666
<junit.version>[5.8.0,5.10-a0)</junit.version>
67-
<mockito.version>[3.12.4,4.0-a0)</mockito.version>
67+
<mockito.version>[4.11.0,5.0-a0)</mockito.version>
6868
</properties>
6969
7070
<dependencies>

packages/jsii-pacmak/lib/targets/go/package.ts

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ export abstract class Package {
203203
if (this.types.length > 0) {
204204
const { code } = context;
205205

206-
const initFile = join(this.directory, `${this.packageName}.go`);
206+
const initFile = join(this.directory, `main.go`);
207207
code.openFile(initFile);
208208
code.line(`package ${this.packageName}`);
209209
code.line();
@@ -238,10 +238,7 @@ export abstract class Package {
238238

239239
private emitTypes(context: EmitContext) {
240240
for (const type of this.types) {
241-
const filePath = join(
242-
this.directory,
243-
`${this.packageName}_${type.name}.go`,
244-
);
241+
const filePath = join(this.directory, `${type.name}.go`);
245242
context.code.openFile(filePath);
246243

247244
this.emitHeader(context.code);
@@ -266,23 +263,9 @@ export abstract class Package {
266263
return;
267264
}
268265

269-
emit.call(
270-
this,
271-
join(
272-
this.directory,
273-
`${this.packageName}_${type.name}__runtime_type_checks.go`,
274-
),
275-
false,
276-
);
266+
emit.call(this, join(this.directory, `${type.name}__checks.go`), false);
277267

278-
emit.call(
279-
this,
280-
join(
281-
this.directory,
282-
`${this.packageName}_${type.name}__no_runtime_type_checking.go`,
283-
),
284-
true,
285-
);
268+
emit.call(this, join(this.directory, `${type.name}__no_checks.go`), true);
286269

287270
function emit(this: Package, filePath: string, forNoOp: boolean) {
288271
code.openFile(filePath);

0 commit comments

Comments
 (0)