random crashes when updating xcode source files using applescript
random crashes when updating xcode source files using applescript
- Subject: random crashes when updating xcode source files using applescript
- From: Tobias Ford <email@hidden>
- Date: Tue, 1 May 2007 17:04:46 -0500
This is part of a script that traverses a defined disk heirarchy and
adds the files to the project. It's working great about 40% of the
time. All of the other times, it's crashing randomly. This is my
first applescript so I'm probably doing all kinds of wrong. My guess
is that I'm sending so many make new file references and add to
target messages, that xCode is being overwhelmed. Can anyone help
with suggestions or workarounds?
Thanks.
on addSourceFiles(theFilePathToLibrary, thePlatformGroupName)
set theFilePathToDirectory to theFilePathToLibrary & "/src/" &
thePlatformGroupName
set theGroupList to ListFolderContents(theFilePathToDirectory, "")
if (length of theGroupList > 0) then
--create the platform specific group name
tell application "Xcode"
activate
tell root group of front project
set theSourceGroup to make new group with properties {path
type:"project relative", name:thePlatformGroupName}
end tell
end tell
repeat with theGroupName in theGroupList
set theGroupPathToDirectory to theFilePathToDirectory & "/" &
theGroupName
set theSourceFileList to ListFolderContents
(theGroupPathToDirectory, "*.cpp *.h")
-- add the directory based sub group
tell application "Xcode"
activate
tell theSourceGroup
try
set theChildGroup to make new group with properties {path
type:"project relative", name:theGroupName}
repeat with theSourceFileName in theSourceFileList
set theSourceFilePath to theGroupPathToDirectory & "/" &
theSourceFileName
tell theChildGroup
try
set sourceFile to make new file reference with properties
{path type:"project relative", full path:theSourceFilePath,
name:theSourceFileName}
add sourceFile to first target of front project
end try
end tell
end repeat
end try
end tell
end tell
end repeat
end if
end addSourceFiles
-------------------
Tobias Ford...
tobias1482 'at' mac.com
tford 'at' spacetimestudios.com
-------------------
Sr Programmer @ space time studios for a generic space game mmo
_______________________________________________
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