• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Setting to copy plug-in and debug application after build
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Setting to copy plug-in and debug application after build


  • Subject: Setting to copy plug-in and debug application after build
  • From: Dan Korn <email@hidden>
  • Date: Mon, 17 Mar 2008 00:25:31 -0500

I have an Xcode 2.5 project which builds a plug-in to a third-party application. I'm trying to somehow define a path to the application so that when I hit "Build and Debug," (a) the Debug target copies the built plug-in to the appropriate plug-ins folder, and (b) the application itself is launched.

I have a Run Script step, using /bin/bash, like this:

if [ ! "$MYAPP_PLUGINS_FOLDER" ]; then echo "set MYAPP_PLUGINS_FOLDER to copy plug-in for debugging" ; exit 0 ; fi
BUILT_PLUGIN_FULLPATHNAME="${TARGET_BUILD_DIR}/${WRAPPER_NAME}"
echo Copying plug-in for debugging...
echo Source: $BUILT_PLUGIN_FULLPATHNAME
echo Destination: $MYAPP_PLUGINS_FOLDER/
cp -RL "$BUILT_PLUGIN_FULLPATHNAME" "$MYAPP_PLUGINS_FOLDER/"


This works fine, as long as I set the variable in the Project or Target settings. However, I want each member of my development team to be able to (optionally) set this variable to the location of the application specific to his or her machine, without having it saved in the project settings.

I can set Source Trees in Xcode, and access them from my script, but there doesn't seem to be a way to base the Executable Path on that. This seems to be a deficiency in Xcode compared to CodeWarrior, where we were able to use a single Source Tree setting to both specify the application to be debugged and to copy the built plug-in to its location.

The path to the executable I'm debugging is stored in my .pbxuser file; it's great that this is a per-user setting, and I could certainly use that to know where to copy the plug-in, but I can't figure out how to access that value from a script. Nor does there seem to be any way to base the Executable Path on an environment variable or Source Tree; as far as I can tell, it has to be a either a hard-coded full path or a path relative to the project.

I've tried setting a variable in my /etc/bashrc file, but the script doesn't seem to pick it up unless I launch Xcode from the Terminal. I had expected that, since I'm telling the script to run in the /bin/ bash shell, it would pick up the variable from /etc/bashrc, or from / etc/profile, regardless of how it was launched, but apparently this isn't the case. (Maybe that's a question for a different list, though.)

I could do something like create a file at a known location which either aliases or contains the path to the application, but that seems like an overly complicated hack. I think I could also do something like modify Xcode's plist file, but that seems like even more of a hack, and I worry about other team members breaking Xcode by messing around in there. However, even if I could get any of these ideas to work and set a variable for the post-build copy script, I still don't know how to base the Executable Path on any of these settings, so I'd still have two settings to deal with.

So, is there any way to set a single per-user or per-machine variable that a script can access from Xcode, to tell it both what application to debug and where to copy the plug-in, without having to invoke Xcode.app from the Terminal, modify the project, or modify Xcode itself?

Thanks,
Dan

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: Creating a Java Tool - Newbie questions
  • Next by Date: Re: Designating an iPhone for development
  • Previous by thread: Re: Xcode looking in the wrong place for frameworks
  • Next by thread: [xcode-users] Custom IB Bindings Inspector?
  • Index(es):
    • Date
    • Thread