The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

mrchuck (3) [Avatar] Offline
#1
Is it possible to create an eclipse project of the entire sample code tree? I guess I should say, is it easy to do? If so, suggestions?
mrchuck (3) [Avatar] Offline
#2
Re: Example Code in Eclipse
Perhaps each subchunk, within a chapter, is supposed to be the eclipse project? Please advise if there is a strategy for getting the entire code into Eclipse. The thing that I can't work around is the overlap of packages and classes defined by the different example units; perhaps they should have distinguishing package names??
mrchuck (3) [Avatar] Offline
#3
Re: Example Code in Eclipse
So . . . here's my best solution.

First, a couple of things you can't do:

1) I couldn't bring more than a single chapter subunit of code to the project at a time. By chapter subunit, I mean something like Chapter Two's paint-modular and paint-unmodular folders. The issue here is that you will end up with conflicting defintions of the exact same classes.

2) You have create the project in a specific way because the build.xml files in these folders depend upon their hierarchy of imported build.xml, which ascend all the way back up the full sample code folder hierachy. Basically, you can't a) import the folders, or else the build.xml isn't in it's native folder structure and the imports won't resolve AND b) create a project from the "existing build.xml"

HOWTO:

1) Create a "New Java Project"
2) Uncheck "Use default location" and select the "paint-modular" folder in the source code hierarchy.

This works for me. Note, this is on Helios. Other versions, even older versions of Helios, have a different interface for step 2)
stuart.mcculloch (29) [Avatar] Offline
#4
Re: Example Code in Eclipse
> Is it possible to create an eclipse project of the
> entire sample code tree? I guess I should say, is it
> easy to do? If so, suggestions?

Not the entire tree, because there's some duplication as we demonstrate how to gradually migrate applications to OSGi. But you can generate Eclipse/PDE project files (as per the README.txt) for the various chapters by using "ant pde" - then you can use "Import as existing project" to load selected chapters into Eclipse.