Thanks for the help, I almost have it working now. I'm getting what is probably a regular AppleScript error, but I'm just not [yet] familiar enough with AppleScript to figure it out:
"Xcode got an error: Can't make file reference (item 2 of every file reference of project "Test") into type reference."
The line of code in question is:
add file reference aFile to aCopy
Where aCopy is a Copy Files Phase that I created like this:
tell aTarget set aCopy to make new copy files phase with properties {destination directory:wrapper, path:"Headers/" & aDir, run only when installing:false, comment:""} end tell
And aFile came from enumerating items in the project:
repeat with aFile in every file reference of aProject
I tried passing (a reference to aFile) and also making a copy of aFile with the copy command (e.g. copy aFile to aFileCopy) and then inserting that, but I get pretty much the same error, except it can't make the copied object into a reference.
Any ideas?
Thanks!
On Sep 21, 2005, at 1:03 PM, Gouri jonnalagadda wrote:
On Sep 21, 2005, at 9:07 AM, Dave McCaldon wrote:
I can actually determine what I need from the destination directory and path of the cfbp elements.
Thanks for the info on properties of, that's exactly what I've been looking for!
Now I need to find out how to insert a new cfbp element!
I am not sure if this is what you are looking for, but here are some pointers which might help you. This is only supported in Xcode 2.1 though...:
- If you are trying to copy a file from within the project into the copy files build phase of a target, then the following should work: tell application "Xcode" tell project "cocoTargetSuiteTest" add file reference "main.m" to build phase 1 of target 1 get name of every build file of build phase 1 of target 1 end tell end tell
- Presently you CANNOT add a file to a build phase unless it is present in the project.
- To add a file to a project from another location something like this should work: set test to (choose file) set testPath to POSIX file (POSIX path of test) tell application "Xcode" tell project 1 tell group "resources" make new file reference with properties {full path:POSIX path of test, name:name of (info for testPath)} end tell end tell end tell
Gouri
|