-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: use new parallel build feature of jsii
Improve build times by using the new "build-all-at-once" feature of jsii-pacmak. Goes together with aws/jsii#849.
- Loading branch information
Showing
3 changed files
with
63 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/env node | ||
/** | ||
* Collects all packages in the repository in a way that makes it | ||
* easy to process for packaging. | ||
*/ | ||
const child_process = require('child_process'); | ||
const fs = require('fs-extra'); | ||
const path = require('path'); | ||
|
||
if (process.argv.length < 4) { | ||
process.stderr.write('Usage: list-packages <jsii file> <nonjsii file>\n'); | ||
process.exit(1); | ||
} | ||
|
||
child_process.exec('lerna ls --json', { shell: true }, (error, stdout) => { | ||
if (error) { | ||
console.error('Error: ', error); | ||
process.exit(-1); | ||
} | ||
const modules = JSON.parse(stdout.toString('utf8')); | ||
|
||
const jsiiDirectories = []; | ||
const nonJsiiNames = []; | ||
|
||
for (const module of modules) { | ||
const pkgJson = require(path.join(module.location, 'package.json')); | ||
if (pkgJson.jsii) { | ||
jsiiDirectories.push(module.location); | ||
} else { | ||
nonJsiiNames.push(pkgJson.name); | ||
} | ||
} | ||
|
||
fs.writeFileSync(process.argv[2], jsiiDirectories.join('\n')); | ||
fs.writeFileSync(process.argv[3], nonJsiiNames.join('\n')); | ||
}); |