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

jberthold-da
Copy link
Contributor

@jberthold-da jberthold-da 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.

@jberthold-da jberthold-da added component/scala-ecosystem Scala development experience discussion Things to be discussed and decided labels May 17, 2019
@@ -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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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
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 Compare June 3, 2019 22:58
@jberthold-da jberthold-da force-pushed the EXPERIMENT-rootfilter-on-codegen branch from 61c7062 to f896bce Compare June 3, 2019 23:18
@jberthold-da
Copy link
Contributor Author

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 removed the discussion Things to be discussed and decided label Jun 12, 2019
@jberthold-da jberthold-da merged commit b0b3e29 into master Jun 12, 2019
@jberthold-da jberthold-da deleted the EXPERIMENT-rootfilter-on-codegen branch June 12, 2019 01:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/scala-ecosystem Scala development experience
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants