-
-
Notifications
You must be signed in to change notification settings - Fork 287
Create jdeps output from classpath entries #1376
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
Conversation
Motivation: jdeps output is used by Intellij Bazel plugin to construct project model. Current implementation adds all entries as explicit source deps, does not do distinguish between implicit or unused deps.
simuons
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Just few minor comments.
scala/private/rule_impls.bzl
Outdated
| args.add("--Manifest", manifest) | ||
| args.add("--PrintCompileTime", print_compile_time) | ||
| args.add("--ExpectJavaOutput", expect_java_output) | ||
| if jdepsPath != None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When jdepsPath can be None? Maybe there is no need for None and null checks?
| import java.io.IOException; | ||
| import java.io.OutputStream; | ||
|
|
||
| public class JdepsWriter { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think according whole ceremony this class should be final with private constructor. But I'm fine with the way it is now.
| } | ||
|
|
||
| try (OutputStream outputStream = new BufferedOutputStream(new FileOutputStream(jdpesPath))) { | ||
| outputStream.write(builder.build().toByteArray()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think builder.build().writeTo(outputStream) should me more effective as it doesn't construct intermediary byte array.
This reverts commit 3dd5d81.
Intellij needs full jars to be able to attach sources, and providing ijars with jdeps is degrading experience when someone already uses full jars
Intellij needs full jars to be able to attach sources, and providing ijars with jdeps is degrading experience when someone already uses full jars
Intellij needs full jars to be able to attach sources, and providing ijars with jdeps is degrading experience when someone already uses full jars
Description
jdeps files can be used by Intellij Bazel plugin to build project model without requiring special support for Scala rules.
This implementation is very simple: treats all classpath entries as explicit deps, and is written by ScalacWorker. I decided not to put it on dependency analyzer as it requires users to have it enabled, which can be undesired performance hit. Writing actual unused deps information from the analyzer can be implemented later.
Motivation
Improving Scala support in Intellij Bazel plugin. This should help advance support for external source attachment. Though more work is required on the plugin side: