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

Add option rules for kotlinc and javac. #383

Merged
merged 4 commits into from
Nov 10, 2020

Conversation

restingbull
Copy link
Collaborator

No description provided.

@restingbull restingbull force-pushed the restingbull/lang_opts branch from 3f63e22 to af780b8 Compare November 9, 2020 16:32
Copy link
Contributor

@jongerrish jongerrish left a comment

Choose a reason for hiding this comment

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

Perfect, just what we need!

@@ -106,28 +106,30 @@ message JvmCompilationTask {
}

message Inputs {
// The full classpath
// The full classpath
Copy link
Collaborator

@cgruber cgruber Nov 10, 2020

Choose a reason for hiding this comment

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

Weird formatting. Why did the comments indent, but the decl didn't?

Copy link
Collaborator

@cgruber cgruber left a comment

Choose a reason for hiding this comment

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

This looks fine and straightforward. It's pretty limited, with no arbitrary flags passable, which I assume is the intended design philosophy. I think this is the right start. We can carefully add more options where reasonable.

There's areas of work and design around use-cases where people want per-target options (very typically annotation processing options), but this is fine to start, and doesn't preclude any further work that I can see.

@restingbull
Copy link
Collaborator Author

This looks fine and straightforward. It's pretty limited, with no arbitrary flags passable, which I assume is the intended design philosophy. I think this is the right start. We can carefully add more options where reasonable.
And you can also enforce options linked to level using https://docs.bazel.build/versions/master/be/common-definitions.html#common.exec_compatible_with. For example, most -X options should be version limited.

There's areas of work and design around use-cases where people want per-target options (very typically annotation processing options), but this is fine to start, and doesn't preclude any further work that I can see.

Annotation processing is a slippery slope. While java happily allows arbitrary flags whenever, it's not a maintainable approach outside of a mono-repo. I suspect we'd be better off wrapping annotation processor arguments with the plugin rather that attaching them per library. Discovery on that (when removing the processor, for example) is painful.

@restingbull restingbull merged commit 54c5ec8 into bazelbuild:master Nov 10, 2020
jongerrish added a commit to jongerrish/rules_kotlin that referenced this pull request Nov 11, 2020
restingbull pushed a commit that referenced this pull request Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants