Skip to content

Commit

Permalink
feat(jsii-pacmak): parsing arguments in non-strict mode (#4068)
Browse files Browse the repository at this point in the history
Some targets support extra target-specific arguments so users can customize the behavior of the build tools. For example, the Java target allows users to customize the `mvn` CLI behaviour with `--mvn-*` parameters. However the `jsi-pacmak` CLI is blocking this feature because it is using strict mode when parsing arguments. This change lifts that gate.

This address [#3465](#3465)

---

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
  • Loading branch information
huyphan committed Apr 26, 2023
1 parent 2cb15f8 commit 3d49d6f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 1 addition & 2 deletions packages/jsii-pacmak/bin/jsii-pacmak.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,7 @@ import { VERSION_DESC } from '../lib/version';
desc: 'Whether jsii assemblies should be validated. This can be expensive and is skipped by default.',
default: false,
})
.version(VERSION_DESC)
.strict().argv;
.version(VERSION_DESC).argv;

configureLogging({ level: argv.verbose !== undefined ? argv.verbose : 0 });

Expand Down
7 changes: 6 additions & 1 deletion packages/jsii-pacmak/test/build-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,9 @@ ${pacmak} ${OPTS} -v --no-parallel $packagedirs
# Test custom pack command
clean_dists
echo "Testing yarn custom pack command."
${pacmak} ${OPTS} -v --pack-command='yarn pack -f custom.tgz -s && echo custom.tgz' ${PWD}/../../@scope/jsii-calc-base-of-base
${pacmak} ${OPTS} -v --pack-command='yarn pack -f custom.tgz -s && echo custom.tgz' ${PWD}/../../@scope/jsii-calc-base-of-base

# Test custom mvn settings command
clean_dists
echo "Testing custom mvn parameters."
${pacmak} ${OPTS} -v --mvn-builder=singlethreaded --mvn-threads=4 $packagedirs

0 comments on commit 3d49d6f

Please sign in to comment.