Extended Eclipse Plugin to support referenced projects and not to upload external libraries

A place to discus the development of leJOS for the EV3. Please do not use this section to post questions about how to use leJOS or to report problems etc.
aschulze
New User
Posts: 18
Joined: Wed Aug 17, 2016 1:22 pm

Extended Eclipse Plugin to support referenced projects and not to upload external libraries

Postby aschulze » Tue Sep 27, 2016 7:46 pm

Hi,
I've patched the LeJOS 0.9.1 Eclipse RCP Plugin to add the following functionality:
a) Include referenced Java projects in the generated JAR file
In Eclipse it it possible to reference other projects in the workspace in the build path (e.g. for framework development, code structuring etc.).
My patch adds these project resources (classes etc.) to the generated JAR file (instead of creating a different JAR file for the referenced project and add it as library in the Manifest classpath).
b) Disable upload of referenced external libraries
External libraries, which are referenced in the build path, are automatically uploaded to the brick (if not SSH/SCP is used) since 0.9.1.
This can be a pain if the libraries are huge and are uploaded every time.
My patch adds an Eclipse preference with which you can disable the upload of the library - therefore, you would normally upload the library only once and then disable the upload functionality for external libraries for the further development of a project.

If you think that this functionality would be helpful for others as well - please let me know how to contribute the code.

Thanks

Alex

Aswin
leJOS Team Member
Posts: 312
Joined: Tue Apr 26, 2011 9:18 pm
Location: Netherlands
Contact:

Re: Extended Eclipse Plugin to support referenced projects and not to upload external libraries

Postby Aswin » Thu Sep 29, 2016 9:50 pm

Hi Alex,

This does sound like a good add-on. But it would be good to change the logic for conditional download of external libraries. I think a user selectable setting is not fool proof. Could it made that it checked for the existence of the library (and being the right version) and only download if needed?

Also, are you committed to support this?
My NXT blog: http://nxttime.wordpress.com/

User avatar
gloomyandy
leJOS Team Member
Posts: 6048
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Extended Eclipse Plugin to support referenced projects and not to upload external libraries

Postby gloomyandy » Fri Sep 30, 2016 8:07 pm

I'm not sure that it would be possible to check for a "version" of the library being on the EV3 (unfortunately). I agree that forcing a download each time is a pain. I'd prefer to see the option of a "leJOS library project" type that basically is the same as a normal leJOS project but which simply downloads the jar file to the library folder. That way you can control when the library gets downloaded.
leJOS news https://lejosnews.wordpress.com/

aschulze
New User
Posts: 18
Joined: Wed Aug 17, 2016 1:22 pm

Re: Extended Eclipse Plugin to support referenced projects and not to upload external libraries

Postby aschulze » Wed Oct 05, 2016 6:35 am

Determining the version of a library is a bit complicated unless you have a built-in mechanism like OSGi.
There is no unique naming of the JARs - and all other methods require reading the JARs content.
That's why I don't understand Andy's approach of using a LeJOS Library Project - how would you recognize in this scenario if the library is already on the brick in the correct version?

As a different approach I could think about calculating a hash value for each uploaded JAR and upload it to the brick as separate file.
Before uploading the JAR a second time, the (small) hash value is downloaded from the brick, compared to the calculated one and only uploads the JAR if the value has changed.
Depending on the hash algorithm it might be enough to store the hash value as file name - therefore no need to download the hash value but only comparing filenames.

User avatar
gloomyandy
leJOS Team Member
Posts: 6048
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Extended Eclipse Plugin to support referenced projects and not to upload external libraries

Postby gloomyandy » Wed Oct 05, 2016 7:05 am

I'm not suggesting any automated mechanism. What I'm suggesting is that a project can have the option you have already added to turn off the auto download of referenced projects but that we also add a library project that will simply download the library to the correct place. That way when changes are made and the lib rebuilt it will be updated on the brick, giving users an easy way to control when a library is updated and downloaded.
leJOS news https://lejosnews.wordpress.com/

aschulze
New User
Posts: 18
Joined: Wed Aug 17, 2016 1:22 pm

Re: Extended Eclipse Plugin to support referenced projects and not to upload external libraries

Postby aschulze » Wed Oct 05, 2016 7:22 am

Thanks for the clarification - I will think about it and come back...


Return to “leJOS EV3 Development”

Who is online

Users browsing this forum: No registered users and 1 guest