Any advice for people who have used Eclipse with processing (especially for Library development) greatly appreciated.
I’m curious about best practices – specifically, how you connect core.jar to Eclipse, and how/if that should be checked in to version control (e.g. github) when developing a Processing Library.
The issue: I’m an inexperienced Eclipse user, but I’m a bit put off that when I follow the Processing Library template instructions, Eclipse writes an absolute local path into my .classpath file, including my username (not portable). I’m trying to decide whether to 1) exclude the .classpath from the new library repository, or 2) leave it in but unconfigured, or 3) configure it into a relative path with something more portable like a path variable (like WORKING_DIR)… or something else?
I looked over the Basics and Guidelines again, then read the Processing Library Template documentation, and it says:
Locate and add Processing’s
core.jar
to your build path. It is recommended that a copy ofcore.jar
is located in your Eclipse workspace in alibs
folder.
and later
If you created a
libs
folder as described above, put the libraries you need to add to your classpath in there. In the “Properties” of your Java project, navigate to Java Build Path → Libraries, and click “Add External JARs…”. Select the.jar
files from thelibs
folder that are required for compiling your project. Adjust thebuild.xml
file accordingly. Thelibs
folder is recommended but not a requirement, nevertheless you need to specify where your.jar
files are located in your system in order to add them to the classpath.
If you follow the instructions and copy core.jar into yourworkspace/libs
, then select it as Add External JAR
, then Eclipse does something like this in the .classpath:
path=“/home/jgracia/admin/eclipse-libs/core.jar”
Examples
Here are some example I have found of what established libraries are doing.
- The grafica library follows the Template instructions and checks in the .classpath – so it contains
path="/home/jgracia/admin/eclipse-libs/core.jar"
- The Picking Library originally had one of these local paths that you get by following the Template instructions –
path="/home/nico/workspace/libs/processing2/core.jar"
– but then stripped it back out.
- PeasyCam has a generic .classpath – not sure how / if Processing is included in the working project outside build.xml / build.properties.
-
Timing Utils just doesn’t include any of it – .classpath, .project, etc., and they aren’t included in a .gitignore. Perhaps the library project wasn’t developed in Eclipse at all. Timing-Utilities/timing_utils at master · Lord-of-the-Galaxy/Timing-Utilities · GitHub
-
Drop is the same way – no Eclipse project files or ant build files GitHub - transfluxus/drop: port of sojamo's drop library to Processing 3
-
MostPixelsEver points to a root (?) directory called
/processing-core/
– so does Box2D
Alternative
I didn’t find any existing library examples of what I would first think to do, which is:
- myProject > Properties > Resources > Linked Resources > Path Variables > New > WORKSPACE_LOC
- myProject > Properties > Java Build Path > Add Variables > WORKSPACE_LOC > Extend > libs/core.jar
This creates a config line like this:
<classpathentry kind="var" path="WORKSPACE_LOC/libs/core.jar"/>
Suggestions?