Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Is it possible to do conditional compilation?
Is it possible to do conditional compilation? [message #75317] Sun, 13 July 2003 22:13 Go to next message
Eclipse UserFriend
Originally posted by: dave.igeekinc.com

I've got a project that runs on Mac OS X, Windows and Linux. Some of the
code that I need to do
things "right" on the Mac has to implement interfaces that only exist on
Mac OS X. I'd like to be
able to exclude those classes on the non-Mac platform. Is this possible?

Thanks!
Dave Smith
Re: Is it possible to do conditional compilation? [message #75380 is a reply to message #75317] Mon, 14 July 2003 03:54 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: daniel.megert.gmx.net

Dave Smith wrote:

>I've got a project that runs on Mac OS X, Windows and Linux. Some of the
>code that I need to do
>things "right" on the Mac has to implement interfaces that only exist on
>Mac OS X. I'd like to be
>able to exclude those classes on the non-Mac platform. Is this possible?
>
The simple answer is no.
You can separate the Mac code into a separate project (or fragment if
you write an Eclipse plug-in) which you don't load or close on non-Mac
platforms. If this is not an option you could put the Mac code into a
separate source folder and then manually exclude that folder from the
Java build path on non-Mac platforms.

HTH
Dani
Re: Is it possible to do conditional compilation? [message #75893 is a reply to message #75380] Tue, 15 July 2003 02:43 Go to previous messageGo to next message
Eclipse UserFriend
Daniel Megert wrote:
> Dave Smith wrote:
>
>> I've got a project that runs on Mac OS X, Windows and Linux. Some
>> of the code that I need to do
>> things "right" on the Mac has to implement interfaces that only
>> exist on Mac OS X. I'd like to be
>> able to exclude those classes on the non-Mac platform. Is this
>> possible?
>>
> The simple answer is no.
> You can separate the Mac code into a separate project (or fragment if
> you write an Eclipse plug-in) which you don't load or close on non-Mac
> platforms. If this is not an option you could put the Mac code into a
> separate source folder and then manually exclude that folder from the
> Java build path on non-Mac platforms.

Alternatively you can provide your own stubs of those classes for the
non-Mac platforms.

Regards, Ilja
Re: Is it possible to do conditional compilation? [message #76301 is a reply to message #75893] Tue, 15 July 2003 14:59 Go to previous messageGo to next message
Eclipse UserFriend
Ilja Preuß wrote:
> Alternatively you can provide your own stubs of those classes for the
> non-Mac platforms.

Or you can use the Reflection API to see if the classes are present on
the system at run time. If you can make this work it will let you ship
a single set of Java binaries for your application.

-- Laura
Re: Is it possible to do conditional compilation? [message #186354 is a reply to message #75317] Fri, 19 November 2004 09:30 Go to previous message
Eclipse UserFriend
Dave Smith wrote:
> I've got a project that runs on Mac OS X, Windows and Linux. Some of the
> code that I need to do
> things "right" on the Mac has to implement interfaces that only exist on
> Mac OS X. I'd like to be
> able to exclude those classes on the non-Mac platform. Is this possible?
>
> Thanks!
> Dave Smith
>

I've had the same problem. MRJAdapter solved it for me:
http://www.roydesign.net/mrjadapter/

Hope this helps,

Axel

--
Axel Rauschmayer
axel@rauschma.de
http://rauschma.de
Previous Topic:Provide java type code completion in a non-java editor ?
Next Topic:Using non standard source locations
Goto Forum:
  


Current Time: Tue Sep 23 09:32:11 EDT 2025

Powered by FUDForum. Page generated in 0.04478 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top