Debugging and testing libraries

Hi, Maybe it is silly question. How are you debugging your libraries? Did you create a new Java project and from there import your library? And if is true, exactly how you do it? Could you give me some clues? Kind regards, Thanks in advance Carlosdelab

Comments

  • In Eclipse, I have one project for the library and another project for Processing sketches. I test the library using sketches I make in the Processing sketches project.

    The test project imports libraries so the sketches can run. It needs to import the Processing core.jar file. It also needs to import the library jar file, and maybe other Processing libraries.

    When I build my library, the output is put in the Processing's library directory inside the sketchbook location. In my Eclipse workspace, I have a project that is actually a soft link to Processing's library directory. I can easily add jar files to the test project from this library project.

    With this setup, when I build the library I must also refresh the library project because Eclipse won't automatically know that the jar file changed. That's a bit inconvenient, but this way I have all the Processing jars in one place and can easily switch between working in Eclipse and working in the Processing IDE without version problems.

    There are other ways to do what you want to do, some simpler, but this is how I do it.

    Bottom line, you do need to import the library jar file somehow, and you should have a second project for making test sketches.

  • I have a similar setup to @subject117 in Eclipse. Two projects, the library project and my testing project. Both projects have any Processing jars it needs on the build path e.g. core.jar

    There is one big difference. I do not add the library.jar file to the testing project build path. Instead I add the library project itself. It means that I can test the library without having to build the library.jar file every time I make library code changes. This will save you lots of time and effort.

  • thanks guys, I like both strategies. very useful kind regards.

Sign In or Register to comment.