tsvetan-stoyanov / launchpi

Launch Raspberry PI Java applications from within Eclipse
Apache License 2.0
23 stars 3 forks source link

Faster synchronization of the project classpath #17

Open frederikb opened 9 years ago

frederikb commented 9 years ago
Problem

Running projects with many (large) dependencies (JARs) using the LaunchPi launch configurations can take a while. This is especially the case if the endpoint is not available in the same network but must be accessed over the Internet.

Background

LaunchPi works by completely transferring the compiled source of the selected project and the referenced dependencies in a single TAR archive, extracting it on the target and then running it. This processed is repeated every time while discarding/deleting the previously transferred files. This archive can easily be tens of megabytes large (e.g. a Dropwizard application).

Solution

The project dependencies are comparatively stable between two runs. Instead of transferring all of them over and over again we should attempt to only transfer new or changed dependencies while deleting those which have since been dropped. The classpath synchronization process can thus be broken up into a series of steps:

  1. Create an index¹ the required dependencies
  2. Create an index of the remotely deployed dependencies
  3. Compute the difference and only transfer/delete added/changed/removed dependencies
  4. Transfer/replace all class files (unchanged from before, using the TAR archive)

¹: Using the file name, last modification time and file length

rudderfeet commented 8 years ago

I imagine this will take some engineering, but it'll really improve Java development for the Raspberry Pi. For now, it seems that even the most basic of applications require 80+ meg file transfers every time the code is launched from Eclipse to copy the same JDK libraries. On Wifi, that can take 5-10 minutes, slowing down development cycles.

whitestripes commented 8 years ago

Is there any news on the proposed improvement. I could really do with this enhancement? I am using digi's java xbee library among many other libraries and it takes quite a while to transfer the tar each and every time i make a small fix. In addition to this, the xbee lib uses rxtx native files and i have set the path to native libraries in eclipse which gets included in the java command executed. Problem is, it is the full path on my computer ie c:/blah/blah. Is there a way i can specify it as a parameter rather than from the native library path i set in eclipse?