updated AppleScript for multilib builds
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77064 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
-- script for regenerating Xcode projects from templates and bakefile file lists
|
||||||
|
-- needs an Xcode version 3 application, no later versions have the AppleScript commands needed
|
||||||
|
-- implemented properly
|
||||||
|
-- in order to avoid your Xcode version 3 getting updated with later versions
|
||||||
|
-- put it into a folder which you hide from spotlight
|
||||||
|
|
||||||
global oldDelimiters
|
global oldDelimiters
|
||||||
global variables
|
global variables
|
||||||
global variablesRef
|
global variablesRef
|
||||||
@@ -43,11 +49,11 @@ on parseLib(theElement, theVariables, theConditions)
|
|||||||
end parseLib
|
end parseLib
|
||||||
|
|
||||||
on parseNode(anElement, theVariables, theConditions)
|
on parseNode(anElement, theVariables, theConditions)
|
||||||
if class of anElement is XML element and ᅡ
|
if class of anElement is XML element and ¬
|
||||||
XML tag of anElement is "set" then
|
XML tag of anElement is "set" then
|
||||||
parseEntry(anElement, theVariables, theConditions)
|
parseEntry(anElement, theVariables, theConditions)
|
||||||
else
|
else
|
||||||
if class of anElement is XML element and ᅡ
|
if class of anElement is XML element and ¬
|
||||||
XML tag of anElement is "lib" then
|
XML tag of anElement is "lib" then
|
||||||
parseLib(anElement, theVariables, theConditions)
|
parseLib(anElement, theVariables, theConditions)
|
||||||
end if
|
end if
|
||||||
@@ -85,22 +91,22 @@ on getVar(theName)
|
|||||||
end getVar
|
end getVar
|
||||||
|
|
||||||
-- adds sources from fileList to a group named container
|
-- adds sources from fileList to a group named container
|
||||||
on addNode(theContainer, fileList)
|
on addNode(theContainer, fileList, theTargets)
|
||||||
tell application "Xcode"
|
tell application "Xcode3"
|
||||||
tell project 1
|
tell project 1
|
||||||
set theTargets to targets
|
-- set theTargets to targets
|
||||||
repeat with listItem in fileList
|
repeat with listItem in fileList
|
||||||
if (listItem starts with "$(") then
|
if (listItem starts with "$(") then
|
||||||
set AppleScript's text item delimiters to ""
|
set AppleScript's text item delimiters to ""
|
||||||
set variableName to (characters 3 through ((length of listItem) - 1) of listItem) as text
|
set variableName to (characters 3 through ((length of listItem) - 1) of listItem) as text
|
||||||
set AppleScript's text item delimiters to oldDelimiters
|
set AppleScript's text item delimiters to oldDelimiters
|
||||||
my addNode(theContainer, my getVar(variableName))
|
my addNode(theContainer, my getVar(variableName), theTargets)
|
||||||
else
|
else
|
||||||
set AppleScript's text item delimiters to "/"
|
set AppleScript's text item delimiters to "/"
|
||||||
set currPath to every text item in listItem
|
set currPath to every text item in listItem
|
||||||
set currFile to "../../" & listItem
|
set currFile to "../../" & listItem
|
||||||
set currFileName to (item -1 in currPath)
|
set currFileName to (item -1 in currPath)
|
||||||
set currGroup to (items 1 through -2 in currPath as text)
|
-- set currGroup to (items 1 through -2 in currPath as text)
|
||||||
set AppleScript's text item delimiters to oldDelimiters
|
set AppleScript's text item delimiters to oldDelimiters
|
||||||
try
|
try
|
||||||
set theGroup to group theContainer
|
set theGroup to group theContainer
|
||||||
@@ -110,18 +116,14 @@ on addNode(theContainer, fileList)
|
|||||||
end tell
|
end tell
|
||||||
end try
|
end try
|
||||||
tell group theContainer
|
tell group theContainer
|
||||||
try
|
|
||||||
set theGroup to group named currGroup
|
|
||||||
on error
|
|
||||||
make new group with properties {name:currGroup}
|
|
||||||
end try
|
|
||||||
tell group currGroup
|
|
||||||
set newFile to make new file reference with properties {name:currFileName, path:currFile, path type:project relative}
|
set newFile to make new file reference with properties {name:currFileName, path:currFile, path type:project relative}
|
||||||
repeat with theTarget in theTargets
|
repeat with theTarget in theTargets
|
||||||
add newFile to (get compile sources phase of theTarget)
|
-- silently ignore targets that don't exist in this project
|
||||||
|
try
|
||||||
|
add newFile to (get compile sources phase of target theTarget of project 1)
|
||||||
|
end try
|
||||||
end repeat
|
end repeat
|
||||||
end tell
|
end tell
|
||||||
end tell
|
|
||||||
end if
|
end if
|
||||||
end repeat
|
end repeat
|
||||||
end tell
|
end tell
|
||||||
@@ -137,7 +139,7 @@ on readFile(posixFilePath)
|
|||||||
end readFile
|
end readFile
|
||||||
|
|
||||||
on init()
|
on init()
|
||||||
tell application "Xcode"
|
tell application "Xcode3"
|
||||||
quit
|
quit
|
||||||
end tell
|
end tell
|
||||||
set variablesRef to a reference to variables
|
set variablesRef to a reference to variables
|
||||||
@@ -185,23 +187,23 @@ end instantiateProject
|
|||||||
|
|
||||||
-- adds the source files of the nodes of theProject to the xcode project
|
-- adds the source files of the nodes of theProject to the xcode project
|
||||||
on populateProject(theProject)
|
on populateProject(theProject)
|
||||||
tell application "Xcode"
|
tell application "Xcode3"
|
||||||
open projectFile
|
open projectFile
|
||||||
end tell
|
end tell
|
||||||
repeat with theNode in nodes of theProject
|
repeat with theNode in nodes of theProject
|
||||||
-- reopen xcode for each pass, as otherwise the undomanager
|
-- reopen xcode for each pass, as otherwise the undomanager
|
||||||
-- happens to crash quite frequently
|
-- happens to crash quite frequently
|
||||||
addNode(label of theNode, entries of theNode)
|
addNode(label of theNode, entries of theNode, targets of theNode)
|
||||||
end repeat
|
end repeat
|
||||||
tell application "Xcode"
|
tell application "Xcode3"
|
||||||
quit
|
quit
|
||||||
end tell
|
end tell
|
||||||
do shell script (osxBuildFolder as text) & "fix_xcode_ids.py \"" & (POSIX path of projectFile as Unicode text) & "\""
|
do shell script (osxBuildFolder as text) & "fix_xcode_ids.py \"" & (POSIX path of projectFile as Unicode text) & "\""
|
||||||
-- reopen again to let Xcode sort identifiers
|
-- reopen again to let Xcode sort identifiers
|
||||||
tell application "Xcode"
|
tell application "Xcode3"
|
||||||
open projectFile
|
open projectFile
|
||||||
end tell
|
end tell
|
||||||
tell application "Xcode"
|
tell application "Xcode3"
|
||||||
quit
|
quit
|
||||||
end tell
|
end tell
|
||||||
end populateProject
|
end populateProject
|
||||||
@@ -215,31 +217,32 @@ end makeProject
|
|||||||
-- main
|
-- main
|
||||||
|
|
||||||
init()
|
init()
|
||||||
set theProject to {projectName:"", conditions:{}, bklfiles:{ᅡ
|
set theProject to {projectName:"", conditions:{}, bklfiles:{¬
|
||||||
"../bakefiles/files.bkl", "../bakefiles/zlib.bkl", "../bakefiles/regex.bkl", "../bakefiles/tiff.bkl", "../bakefiles/png.bkl", "../bakefiles/jpeg.bkl", "../bakefiles/scintilla.bkl", "../bakefiles/expat.bkl"}, nodes:{ᅡ
|
"../bakefiles/files.bkl", "../bakefiles/zlib.bkl", "../bakefiles/regex.bkl", "../bakefiles/tiff.bkl", "../bakefiles/png.bkl", "../bakefiles/jpeg.bkl", "../bakefiles/scintilla.bkl", "../bakefiles/expat.bkl"}, nodes:{¬
|
||||||
{label:"base", entries:{"$(BASE_SRC)"}}, ᅡ
|
{label:"base", entries:{"$(BASE_SRC)"}, targets:{"dynamic", "static", "base"}}, ¬
|
||||||
{label:"base", entries:{"$(BASE_AND_GUI_SRC)"}}, ᅡ
|
{label:"base", entries:{"$(BASE_AND_GUI_SRC)"}, targets:{"dynamic", "static", "base", "core"}}, ¬
|
||||||
{label:"core", entries:{"$(CORE_SRC)"}}, ᅡ
|
{label:"core", entries:{"$(CORE_SRC)"}, targets:{"dynamic", "static", "core"}}, ¬
|
||||||
{label:"net", entries:{"$(NET_SRC)"}}, ᅡ
|
{label:"net", entries:{"$(NET_SRC)"}, targets:{"dynamic", "static", "net"}}, ¬
|
||||||
{label:"adv", entries:{"$(ADVANCED_SRC)"}}, ᅡ
|
{label:"adv", entries:{"$(ADVANCED_SRC)"}, targets:{"dynamic", "static", "adv"}}, ¬
|
||||||
{label:"webview", entries:{"$(WEBVIEW_SRC)"}}, ᅡ
|
{label:"webview", entries:{"$(WEBVIEW_SRC)"}, targets:{"dynamic", "static", "webview"}}, ¬
|
||||||
{label:"media", entries:{"$(MEDIA_SRC)"}}, ᅡ
|
{label:"media", entries:{"$(MEDIA_SRC)"}, targets:{"dynamic", "static", "media"}}, ¬
|
||||||
{label:"html", entries:{"$(HTML_SRC)"}}, ᅡ
|
{label:"html", entries:{"$(HTML_SRC)"}, targets:{"dynamic", "static", "html"}}, ¬
|
||||||
{label:"xrc", entries:{"$(XRC_SRC)"}}, ᅡ
|
{label:"xrc", entries:{"$(XRC_SRC)"}, targets:{"dynamic", "static", "xrc"}}, ¬
|
||||||
{label:"xml", entries:{"$(XML_SRC)"}}, ᅡ
|
{label:"qa", entries:{"$(QA_SRC)"}, targets:{"dynamic", "static", "qa"}}, ¬
|
||||||
{label:"opengl", entries:{"$(OPENGL_SRC)"}}, ᅡ
|
{label:"xml", entries:{"$(XML_SRC)"}, targets:{"dynamic", "static", "xml"}}, ¬
|
||||||
{label:"aui", entries:{"$(AUI_SRC)"}}, ᅡ
|
{label:"opengl", entries:{"$(OPENGL_SRC)"}, targets:{"dynamic", "static", "gl"}}, ¬
|
||||||
{label:"ribbon", entries:{"$(RIBBON_SRC)"}}, ᅡ
|
{label:"aui", entries:{"$(AUI_SRC)"}, targets:{"dynamic", "static", "aui"}}, ¬
|
||||||
{label:"propgrid", entries:{"$(PROPGRID_SRC)"}}, ᅡ
|
{label:"ribbon", entries:{"$(RIBBON_SRC)"}, targets:{"dynamic", "static", "ribbon"}}, ¬
|
||||||
{label:"richtext", entries:{"$(RICHTEXT_SRC)"}}, ᅡ
|
{label:"propgrid", entries:{"$(PROPGRID_SRC)"}, targets:{"dynamic", "static", "propgrid"}}, ¬
|
||||||
{label:"stc", entries:{"$(STC_SRC)"}}, ᅡ
|
{label:"richtext", entries:{"$(RICHTEXT_SRC)"}, targets:{"dynamic", "static", "richttext"}}, ¬
|
||||||
{label:"libzlib", entries:{"$(wxzlib)"}}, ᅡ
|
{label:"stc", entries:{"$(STC_SRC)"}, targets:{"dynamic", "static", "stc"}}, ¬
|
||||||
{label:"libtiff", entries:{"$(wxtiff)"}}, ᅡ
|
{label:"libzlib", entries:{"$(wxzlib)"}, targets:{"dynamic", "static", "wxzlib"}}, ¬
|
||||||
{label:"libjpeg", entries:{"$(wxjpeg)"}}, ᅡ
|
{label:"libtiff", entries:{"$(wxtiff)"}, targets:{"dynamic", "static", "wxtiff"}}, ¬
|
||||||
{label:"libpng", entries:{"$(wxpng)"}}, ᅡ
|
{label:"libjpeg", entries:{"$(wxjpeg)"}, targets:{"dynamic", "static", "wxjpeg"}}, ¬
|
||||||
{label:"libregex", entries:{"$(wxregex)"}}, ᅡ
|
{label:"libpng", entries:{"$(wxpng)"}, targets:{"dynamic", "static", "wxpng"}}, ¬
|
||||||
{label:"libscintilla", entries:{"$(wxscintilla)"}}, ᅡ
|
{label:"libregex", entries:{"$(wxregex)"}, targets:{"dynamic", "static", "wxregex"}}, ¬
|
||||||
{label:"libexpat", entries:{"$(wxexpat)"}} ᅡ
|
{label:"libscintilla", entries:{"$(wxscintilla)"}, targets:{"dynamic", "static", "wxscintilla"}}, ¬
|
||||||
|
{label:"libexpat", entries:{"$(wxexpat)"}, targets:{"dynamic", "static", "wxexpat"}} ¬
|
||||||
}}
|
}}
|
||||||
set conditions of theProject to {"PLATFORM_MACOSX=='1'", "TOOLKIT=='OSX_CARBON'", "WXUNIV=='0'", "USE_GUI=='1' and WXUNIV=='0'"}
|
set conditions of theProject to {"PLATFORM_MACOSX=='1'", "TOOLKIT=='OSX_CARBON'", "WXUNIV=='0'", "USE_GUI=='1' and WXUNIV=='0'"}
|
||||||
set projectName of theProject to "wxcarbon"
|
set projectName of theProject to "wxcarbon"
|
||||||
@@ -249,6 +252,7 @@ set conditions of theProject to {"PLATFORM_MACOSX=='1'", "TOOLKIT=='OSX_COCOA'",
|
|||||||
set projectName of theProject to "wxcocoa"
|
set projectName of theProject to "wxcocoa"
|
||||||
|
|
||||||
makeProject(theProject)
|
makeProject(theProject)
|
||||||
|
|
||||||
set conditions of theProject to {"PLATFORM_MACOSX=='1'", "TOOLKIT=='OSX_IPHONE'", "WXUNIV=='0'", "USE_GUI=='1' and WXUNIV=='0'"}
|
set conditions of theProject to {"PLATFORM_MACOSX=='1'", "TOOLKIT=='OSX_IPHONE'", "WXUNIV=='0'", "USE_GUI=='1' and WXUNIV=='0'"}
|
||||||
set projectName of theProject to "wxiphone"
|
set projectName of theProject to "wxiphone"
|
||||||
makeProject(theProject)
|
makeProject(theProject)
|
||||||
|
Reference in New Issue
Block a user