Skip to content

Commit 1d30d82

Browse files
authored
chore(ubergen): make rosetta fixtures submodule aware (#17438)
Currently ubergen bundles all fixtures into the same `rosetta` folder. This means that all fixtures in files called `default.ts-fixture` replace each other as they are found and vie to be the last `default.ts-fixture` standing in the `rosetta` folder. This causes unintended compiliation failures for `yarn rosetta:extract --compile` in projects that rely on ubergen, since they will be copied into the wrong `default.ts-fixture`. The solution here in jsii is to find fixtures based on submodules: aws/jsii#3131. This PR updates ubergen to construct the necessary subfolders in `rosetta` so that the expected submodule fixtures can be found. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 1afc56c commit 1d30d82

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tools/@aws-cdk/ubergen/bin/ubergen.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,9 @@ async function combineRosettaFixtures(libraries: readonly LibraryReference[]) {
254254

255255
for (const library of libraries) {
256256
const packageRosettaDir = path.join(library.root, 'rosetta');
257+
const uberRosettaTargetDir = library.shortName === 'core' ? uberRosettaDir : path.join(uberRosettaDir, library.shortName.replace(/-/g, '_'));
257258
if (await fs.pathExists(packageRosettaDir)) {
258-
await fs.copy(packageRosettaDir, uberRosettaDir, {
259+
await fs.copy(packageRosettaDir, uberRosettaTargetDir, {
259260
overwrite: true,
260261
recursive: true,
261262
});

0 commit comments

Comments
 (0)