- 
                Notifications
    You must be signed in to change notification settings 
- Fork 10
Description
@guw @lonhutt I haven't be able to create an issue on https://github.com/eclipseguru/bazel-eclipse/. Because of that I have created it here.
I have tried to import java-tutorial into Eclipse and VS Code.
jjava-tutorial has been created based on https://bazel.build/start/java.
I have found the following issues:
- Bazel Eclipse creates several error markers as
a) Folder '/home/snjeza/bazel-examples/java-tutorial/src/main/java/com/example' contains more Java files then configured in Bazel. This is a scenario which is challenging to support in IDEs! Consider re-structuring your source code into separate folder hierarchies and Bazel packages.
- src/main/java/com/example/ProjectRunner.java
The related issue - #116
- 
Bazel Eclipse creates projects named :greeter, :ProjectRunner, src.main.java.com.example.cmdline:runner 
 Eclipse/JDT can't execute a main method on Linuxu and Mac if the classpath contains : (colon)
- 
Bazel Eclipse creates duplicate links for all of the three source files in linked-srcs and linked-test-srcs 
 The related issue - .java is not on the class path of project A, only syntax errors are reported #143
- 
Bazel Eclipse copies BUILD*, MODEL*, WORKSPACE* to output folder. 
 When importing java-tutorial, Bazel Eclipse copies /src/main/java/com/example/cmdline/BUILD to./.eclipse/projects/src.main.java.com.example.cmdline_runner/eclipse-bin/com/example/cmdline/
 If the "View>Command Palette>Java: Clean Java Language Server workspace" command is called in VS Code, java-tutorial won't be imported correctly.
 BazelProjectImporter creates the .eclipse/projects/.eclipse.projects.src.main.java.com.example.cmdline_runner.eclipse-bin.com.example.cmdline_runner project based on the /.eclipse/projects/src.main.java.com.example.cmdline_runner/eclipse-bin/com/example/cmdline/BUILD file
I have created a PR that fixes these issues in the following way:
- replaces error markers with warning markers
- if a project name contains : (colon), the PR replaces it with _ (underscore)
- fixes BaseProvisioningStrategy.java
- adds excluding="**/BUILD*|**/MODULE*|**/WORKSPACE*"to source classpath containers
After applying eclipseguru/bazel-eclipse#1, java-tutorial will be able to be imported; Runner and ProjectRunner will be able to be executed in Eclipse as well as in VS Code.
Test VSIX: https://drive.google.com/file/d/1xgOnnSZxmK6c4rzZYSdVS2O9uC5FnHar/view?usp=sharing