Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

language-support/scala: add support for specifying dependency roots explicitly #1210

Merged
merged 8 commits into from Jun 12, 2019

Conversation

Projects
None yet
3 participants
@jberthold-da
Copy link
Member

commented May 17, 2019

By default, code-gen will use all templates in the given package as roots, and generate code for all types used. This patch adds the ability to specify roots explicitly via a set of regex.es to match the (fully qualified) template names.

The feature is driven by flag --root REGEX (repeatable) from the Main runner. Example:

bazel run language-support/scala/codegen:codegen-main -- \
    -o $PWD/output/dir \
    --root  'The\.Interesting\.Bits\..*' \
    --root 'Also\..*\.Interesting\..*'  \
    $PWD/my.dar=some.prefix

Pull Request Checklist

NOTE: CI is not automatically run on non-members pull-requests for security
reasons. The reviewer will have to comment with /AzurePipelines run to
trigger the build.

@@ -57,6 +58,11 @@ object Conf {
.action((l, c) => c.copy(verbosity = l))
.text("Verbosity between 0 (only show errors) and 4 (show all messages) -- defaults to 0")

opt[String]('r', "root")(Read.stringRead)

This comment has been minimized.

Copy link
@leo-da

leo-da May 17, 2019

Contributor

this change is also going to affect java codegen... and the SDK doc, that does not mention root.

This comment has been minimized.

Copy link
@jberthold-da

jberthold-da Jun 3, 2019

Author Member

@leo-da We can remove the option from the driver if you prefer but I do think it is useful to have in all codegen.

This comment has been minimized.

Copy link
@leo-da

leo-da Jun 4, 2019

Contributor

@jberthold-da that is fine, I was just pointing the things that we will need to address when this PR lands in master.

This comment has been minimized.

Copy link
@jberthold-da

jberthold-da Jun 7, 2019

Author Member

@leo-da so should I take the option out of the CLI/config, or just declare it as unsupported for java?
I do think it is a very useful option.

@leo-da leo-da added this to the Maintenance milestone May 21, 2019

language-support/scala: add support for specifying roots explicitly
By default, code-gen will use all templates in the given package as roots, and
generate code for all types used. This patch adds the ability to specify roots
explicitly via a set of regex.es to match the (fully qualified) template names.

This is an experiment, tests and UI need to be adjusted later.

@jberthold-da jberthold-da force-pushed the EXPERIMENT-rootfilter-on-codegen branch from 179dd62 to 61c7062 Jun 3, 2019

@jberthold-da jberthold-da force-pushed the EXPERIMENT-rootfilter-on-codegen branch from 61c7062 to f896bce Jun 3, 2019

@jberthold-da

This comment has been minimized.

Copy link
Member Author

commented Jun 7, 2019

Bumping this for @S11001001 and @leo-da .
I moved the filter as suggested - much prettier! Qu. is whether to take it out of the config or implement a stub for Java codegen. Please revisit

@jberthold-da jberthold-da requested a review from bethaitman as a code owner Jun 11, 2019

@jberthold-da jberthold-da merged commit b0b3e29 into master Jun 12, 2019

7 checks passed

Summary 2 potential rules
Details
digital-asset.daml Build #20190611.80 succeeded
Details
digital-asset.daml (Linux) Linux succeeded
Details
digital-asset.daml (Windows) Windows succeeded
Details
digital-asset.daml (macOS) macOS succeeded
Details
digital-asset.daml (perf) perf succeeded
Details
license/cla Contributor License Agreement is signed.
Details

@jberthold-da jberthold-da deleted the EXPERIMENT-rootfilter-on-codegen branch Jun 12, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.