lcm-proj / lcm

Lightweight Communications and Marshalling
GNU Lesser General Public License v2.1
944 stars 385 forks source link

java-notes out of date #420

Closed judfs closed 3 months ago

judfs commented 1 year ago

https://github.com/lcm-proj/lcm/blob/master/docs/content/java-notes.md

It mentions build.xml that was removed 7 years ago in cmake unification.

For what its worth: In order to get lcm-java to play nice in vscode, I downloaded eclipse just to create a project file. The plotting library was intentionally untouched and it's build file was left. It seems that file existing made vscode [redhat java plugin] unwilling to figure out the other directories?

[Separate issue? Would be nice if there was a formater.xml file for the java project. C/CPP have the clang format file. But when implemented I imagine it would be documented here.]

nosracd commented 1 year ago

https://github.com/lcm-proj/lcm/blob/master/docs/content/java-notes.md

It mentions build.xml that was removed 7 years ago in cmake unification.

That indeed is quite out of date. Do you see value in being able to build the jar without using CMake? If so would you be willing to add that support? Otherwise the easiest solution is probably just to remove that section of the docs since that support hasn't existed in several years.

For what it's worth: In order to get lcm-java to play nice in vscode, I downloaded eclipse just to create a project file. The plotting library was intentionally untouched and it's build file was left. It seems that file existing made vscode [redhat java plugin] unwilling to figure out the other directories?

[Separate issue? Would be nice if there was a formater.xml file for the java project. C/CPP have the clang format file. But when implemented I imagine it would be documented here.]

I agree that it would be nice to have a consistent Java format. Ideally there would be a tool that is both easy to run on CI and locally.

It looks like spotless is pretty popular, but all I see are instructions for integrating with build systems that LCM doesn't use.

google-java-format is also pretty popular. It would be easy to integrate with CI since there's already a GitHub action for it. It might be a bit trickier for someone to use locally, though, since it requires downloading a jar first. I suppose, though, instead of having the CI just check the formatting it could actually format the code.

judfs commented 1 year ago

I do not see value in a secondary build file, but a section along the lines of the following might be helpful:

LCM Developers

lcm.jar along with lcm-spy and lcm-logplayer-gui are built with Cmake. There is not a Ant/Maven/Gradle project. To edit the code, use your IDE of choice to create a project in the lcm-java folder. lcm-java/lcm should be the top level package (lcm.lcm.LCM is the fully qualified name for the LCM class). To get the best results from Visual Studio Code, it may be necessary to first create an Eclipse project by using Eclipse.


I also noticed that LogPlayer seems to support remote control via a socket on localhost. I haven't seen that documented. But also I'm not sure if there is a page that documents every lcm binary installed.

nosracd commented 1 year ago

Agreed, those extra docs look good to me