Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ant and external jars relative to an environment variable



Robert La Ferla wrote:

On Aug 18, 2006, at 1:26 PM, Rob Lockstone <email@hidden> wrote:

Now that that's out of the way, in your Target(s), do you have the
necessary environment variables defined? This would be in the Build
Settings section of your target, e.g.:

MYPROJECT /Users/you/path/to/my/project/stuff

The environment variable is set in the shell. It works fine from the shell. I could indeed set it in the target but why do I have to? Does XCode fork a certain type of shell? sh? bash? csh? Maybe I'm not setting it in that particular shell? (I don't use bash as my default.)

The XCode build tools are not invoked via a shell, I believe it is a direct fork/exec from the XCode process, so the build tool directly inherits the environment from XCode. Mac bundled executables (like XCode) do not inherit any shell environment -- they inherit the environment from the OS X GUI system (Window Server pehaps?). On other Unixes GUI apps inherit a shell environment because X11 is typically started by a shell script. That ain't so in OS-X. If you want to set global environment values to be inherited by all GUI apps, there is a tech note on that:


http://developer.apple.com/qa/qa2001/qa1067.html

I can think of three ways of getting this info passed:
  - setting the environment variables in XCode
  - setting the environment variables globally as per QA 1067
  - changing XCode project to use a shell script build phase to
    invoke ant, and inherit the environment from the shell

The first is easiest.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.