• 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
Re: Using AppleScript to access a Copy File Phase in an Xcode project
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using AppleScript to access a Copy File Phase in an Xcode project


  • Subject: Re: Using AppleScript to access a Copy File Phase in an Xcode project
  • From: Gouri jonnalagadda <email@hidden>
  • Date: Thu, 22 Sep 2005 11:15:20 -0700

Because we are not exposing the name property of the build phase, try to use the index of the build phase for now. 
So, after adding a build phase to the target,  count the number of build phases and then add the file reference to the build phase # of the target and everything should work fine.

Hope that helps,
Gouri


On Sep 21, 2005, at 4:35 PM, Dave McCaldon wrote:


Ok -- the files I'm adding are already in the project.  Basically, I'm trying to automate the creation of a framework by locating *all* .h files and copying them into the Headers directory within the framework, but taking into account the subdirectory-ness of them so that current code still works.

It seems that the Copy Files Phase instance only maintains a collection of build files, not file references.  If you look at build file, you'll see that it has a file reference.  So I'm assuming that I need to create a "build file" instance and set it's file reference.

I tried your initial suggestion of:

                                add file reference "main.m" to build phase 1 of target 1

Modified for the context of my script:

                                add file reference aFile to aCopy of aTarget

But I get this:

    'Xcode got an error: Can't make file reference (item 2 of every file reference of project "Test") into type reference.'

Thanks for you help!!!



On Sep 21, 2005, at 7:16 PM, Gouri jonnalagadda wrote:

You cannot really make a new build file (Just adding a new file to a build phase is not supported in UI also. You can only drag the files that are present in the project  or other projects into a build phase).  Build files are files that are added to a build phase to achieve certain things. These files are ideally present in the project itself and they should belong to a target. 

So, in order to add a file as a build file to a build phase of a target you need to first add the file to the project, then add it to the build phase.

The internal error part  is a known issue. It is a cocoa scripting issue and not coming from Xcode.

Gouri


 _______________________________________________
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

  • Follow-Ups:
    • Re: Using AppleScript to access a Copy File Phase in an Xcode project
      • From: Dave McCaldon <email@hidden>
References: 
 >Using AppleScript to access a Copy File Phase in an Xcode project (From: Dave McCaldon <email@hidden>)
 >Re: Using AppleScript to access a Copy File Phase in an Xcode project (From: Daniel Jalkut <email@hidden>)
 >Re: Using AppleScript to access a Copy File Phase in an Xcode project (From: Dave McCaldon <email@hidden>)
 >Re: Using AppleScript to access a Copy File Phase in an Xcode project (From: Gouri jonnalagadda <email@hidden>)
 >Re: Using AppleScript to access a Copy File Phase in an Xcode project (From: Dave McCaldon <email@hidden>)
 >Re: Using AppleScript to access a Copy File Phase in an Xcode project (From: Dave McCaldon <email@hidden>)

  • Prev by Date: Re: good xcode book?
  • Next by Date: Re: Using AppleScript to access a Copy File Phase in an Xcode project
  • Previous by thread: Re: Using AppleScript to access a Copy File Phase in an Xcode project
  • Next by thread: Re: Using AppleScript to access a Copy File Phase in an Xcode project
  • Index(es):
    • Date
    • Thread