Using classes across projects

Hi
I am trying to create a common project that contains some classes for different mobile projects (stuff like different parser classes for rest services, a login ui, a settings ui.).

But I am having difficulties when using those classes from a mobile project. I tried adding the source folder in different properties in the build scripts, so that I can access those classes during development and later at runtime too. But it is not working.

Has anyone managed to do this already? Any help would be really appreciated.
Best regards
Javier

Hi Javier,

If you just drop the source code into a folder of your choosing in your
project (e.g. “MyProject/Dev/my-common-classes”), you should be able to
update the runtime src path in the targets/defaults.xml to include
them with something like:

<path id="project.runtime.project.src.path">
	<pathelement path="${project.dir.root}/src"/>
	<pathelement

path=“${project.dir.root}/my-common-classes”/>

A re-activation and a refresh of your project in Eclipse should then
have them included as source to be build against and cross-compiled.

Obviously prior to the above in the defaults.xml, you could utilise
the standard Ant <copy…/> command to copy that source from a common
folder if you have it located somewhere else on your hard-drive.

Regards,

Nick.

Hi
I was in fact trying to avoid doing that… I wanted to keep my sources
in the original project, so that all changes are done in it and all
other projects profit from those changes without having to do a
“Re-Activate Handset” or so.
Is this possible somehow?

Many thanks
Javier

Hi Javier,

Not currently. Pre-acquisition, our SDK integration was very light - we
had some developers use Eclipse, but other use NetBeans, SlickEdit, and
even just the command line. As a result, tying into to things like
Eclipse’s project references wasn’t a viable route to go down to provide
that same coverage for a fellow developer working in a different SDK. As
everything had to work from outside any SDK, all associations had be
performed within the Ant script itself, and thereby any changes were
Ant-triggered (i.e. via things like the Activation of Multi-Build).

Obviously, moving forwards we could look to amend this, but for now my
previous suggestion is probably the most viable solution.

Regards,

Nick.