As a BEF user
I would like to manually configure certain aspects of an imported Bazel Java project
Such that my IDE experience is tailored to my development needs
Such that I can right click on the Bazel Eclipse project in the Project Explorer and choose "Properties -> Bazel" and have UI for this configuration
Targets:
Currently when we import, we keep the import process simple and activate all Bazel Java targets in the BUILD file. This can be seen in the file:
[Eclipse workspace dir]/[project name]/.settings/com.salesforce.bazel.eclipse.core.prefs
You will see an entry like this that was written by the BEF import machinery:
bazel.target0=//projects/libs/apple/apple-api:*
Because the wildcard target is set, whenever Eclipse issues build directive to this Eclipse project, we run a bazel build of all targets:
bazel build //projects/libs/apple/apple-api:*
However, the BEF builder is better than that. If you instead replace the prefs line with these:
bazel.target0=//projects/libs/apple/apple-api:apple-api-lib
bazel.target1=//projects/libs/apple/apple-api:apple-main
it will instead run a project build like this:
bazel build //projects/libs/apple/apple-api:apple-api-lib //projects/libs/apple/apple-api:apple-main
I still think the wildcard target is a reasonable result of the import process. But we should provide UI to let the user scope that down. Imagine if there was a third target in that package that was not typical and was time consuming to build.
See also #73 which could be thought of as the simple solution this, and this Issue will work on the longer term solution.
Bazel Tags
Another element to think about when designing this feature is tag configuration in some way. We don't yet use tags in any significant capacity at Salesforce, but we plan to in the future. If others in the public community has input on what would be good to support wrt tags, we would love to hear it!
Complications
This UI will get trickier as soon as we start allowing multiple BUILD files in a single Eclipse project, see this issue: #24