Skip to content

Commit

Permalink
chore(ubergen): make rosetta fixtures submodule aware (aws#17438)
Browse files Browse the repository at this point in the history
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*
  • Loading branch information
kaizencc authored and TikiTDO committed Feb 21, 2022
1 parent 063d690 commit 7f5c1d4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tools/@aws-cdk/ubergen/bin/ubergen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,9 @@ async function combineRosettaFixtures(libraries: readonly LibraryReference[]) {

for (const library of libraries) {
const packageRosettaDir = path.join(library.root, 'rosetta');
const uberRosettaTargetDir = library.shortName === 'core' ? uberRosettaDir : path.join(uberRosettaDir, library.shortName.replace(/-/g, '_'));
if (await fs.pathExists(packageRosettaDir)) {
await fs.copy(packageRosettaDir, uberRosettaDir, {
await fs.copy(packageRosettaDir, uberRosettaTargetDir, {
overwrite: true,
recursive: true,
});
Expand Down

0 comments on commit 7f5c1d4

Please sign in to comment.