I want to get early feedback on adding support for the -C flag documented in #702 so I can iterate on the draft as we figure out what makes sense to change.
There's a few changes:
CompileAndBuildCommandOpts -> CompileCommandOpts and BuildCommandOpts including splitting out the handling of the compile and build` subcommands.
BuildCommandOpts introduces a few extra types to try and get the repeated -C flags to play nicely with clap. There's a lot of copying triple slash comments around, none of it is picked up by clap so not sure if there's something better we can do. I looked at implementing ValueEnum as well but it looks like that's intended only for enums with entirely unit variants. There's also a manual step to translate the Vec<CodegenOption> to CodegenOptionGroup since clap out-of-the-box only allows specifying the -C flag multiple times if the type associated with the option is a Vec.
Changes to javy-runner to default to using the build command and support the arguments build supports unless a method has been invoked on the builder to use compile instead. I'm open to a different API.
Adding run_with_compile_and_build to most tests to check that the build and compile commands function correctly. This could make more sense as a macro, I thought I'd start with a function because IMO it's easier to follow what the code is doing.
Why am I making this change?
702
Checklist
[x] I've updated the relevant CHANGELOG files if necessary. Changes to javy-cli and javy-core do not require updating CHANGELOG files.
Description of the change
I want to get early feedback on adding support for the
-C
flag documented in #702 so I can iterate on the draft as we figure out what makes sense to change.There's a few changes:
CompileAndBuildCommandOpts
->CompileCommandOpts
andBuildCommandOpts
including splitting out the handling of thecompile
and build` subcommands.BuildCommandOpts
introduces a few extra types to try and get the repeated-C
flags to play nicely withclap
. There's a lot of copying triple slash comments around, none of it is picked up byclap
so not sure if there's something better we can do. I looked at implementingValueEnum
as well but it looks like that's intended only for enums with entirely unit variants. There's also a manual step to translate theVec<CodegenOption>
toCodegenOptionGroup
sinceclap
out-of-the-box only allows specifying the-C
flag multiple times if the type associated with the option is aVec
.javy-runner
to default to using thebuild
command and support the argumentsbuild
supports unless a method has been invoked on the builder to usecompile
instead. I'm open to a different API.run_with_compile_and_build
to most tests to check that the build and compile commands function correctly. This could make more sense as a macro, I thought I'd start with a function because IMO it's easier to follow what the code is doing.Why am I making this change?
702
Checklist
javy-cli
andjavy-core
do not require updating CHANGELOG files.