Skip to content

Commit 7920624

Browse files
committed
Added xcode
Added find_rez_headers(), and build_rez(). Updated doxygen to 1.12
1 parent a2e3c2a commit 7920624

File tree

8 files changed

+625
-320
lines changed

8 files changed

+625
-320
lines changed

burger/__init__.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
is_codewarrior_mac_allowed, import_py_script, run_py_script, \
100100
execfile
101101

102-
from .locators import where_is_xcode, where_is_codeblocks, where_is_watcom, \
102+
from .locators import where_is_codeblocks, where_is_watcom, \
103103
where_is_doxygen, where_is_visual_studio
104104

105105
from .perforce import where_is_p4, is_under_p4_control, perforce_command, \
@@ -114,6 +114,8 @@
114114

115115
from .windowsutils import find_visual_studios
116116

117+
from .xcode import where_is_xcode, find_rez_headers, build_rez
118+
117119
if PY2:
118120
from cStringIO import StringIO
119121
else:
@@ -123,7 +125,7 @@
123125

124126

125127
# Numeric version
126-
__numversion__ = (1, 3, 1)
128+
__numversion__ = (1, 4, 0)
127129

128130
# Current version of the library
129131
__version__ = ".".join([str(num) for num in __numversion__])
@@ -209,7 +211,6 @@
209211
"import_py_script",
210212
"run_py_script",
211213
"execfile",
212-
"where_is_xcode",
213214
"where_is_codeblocks",
214215
"where_is_watcom",
215216
"where_is_doxygen",
@@ -235,7 +236,10 @@
235236
"StringListProperty",
236237
"EnumProperty",
237238
"NoneProperty",
238-
"find_visual_studios"
239+
"find_visual_studios",
240+
"where_is_xcode",
241+
"find_rez_headers",
242+
"build_rez"
239243
]
240244

241245
########################################

burger/locators.py

Lines changed: 3 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
except ImportError:
4141
pass
4242

43-
from .strutils import PY3_4_OR_HIGHER, get_mac_host_type, get_windows_host_type, \
43+
from .strutils import get_mac_host_type, get_windows_host_type, \
4444
IS_LINUX, convert_to_windows_slashes
4545

4646
from .buildutils import is_exe, find_in_path, _WINDOWS_ENV_PATHS
@@ -81,120 +81,6 @@
8181
########################################
8282

8383

84-
def where_is_xcode(xcode_version=None):
85-
"""
86-
Locate xcodebuild for a specific version of XCode.
87-
88-
Given a specific version by version, scan the locations that the IDE would
89-
be found.
90-
91-
Example:
92-
>>> burger.where_is_xcode()
93-
("/Developer/usr/bin/xcodebuild", 3)
94-
>>> burger.where_is_xcode(2093)
95-
None
96-
97-
Note:
98-
This function will always return None on non-macOS hosts.
99-
Minimum version of XCode is 3.
100-
101-
Args:
102-
xcode_version: Version number
103-
Returns:
104-
Path to xcodebuild for the XCode version or None.
105-
"""
106-
107-
# pylint: disable=too-many-branches
108-
109-
# Test if running on a mac host
110-
host_type = get_mac_host_type()
111-
if not host_type:
112-
return None
113-
114-
# Only import on macosx hosts
115-
# pylint: disable=import-outside-toplevel
116-
import plistlib
117-
118-
# XCode 5 and higher reside in the app folder
119-
highest_version = 0
120-
xcodebuild = None
121-
122-
# Version 3 and 4 is in /Developer while all
123-
# others are in /Applications
124-
125-
dir_list = []
126-
if xcode_version is None or xcode_version < 5:
127-
dir_list.append("/Developer/Applications")
128-
if xcode_version is None or xcode_version > 3:
129-
dir_list.append("/Applications")
130-
131-
for base_dir in dir_list:
132-
# Check if the directory exists first
133-
if os.path.isdir(base_dir):
134-
135-
# Scan the applications folder for all apps called "XCode"
136-
for item in os.listdir(base_dir):
137-
138-
# Scan only apps whose name starts with xcode
139-
if not item.lower().startswith("xcode"):
140-
continue
141-
142-
temp_path = base_dir + "/" + item + "/Contents/version.plist"
143-
try:
144-
# pylint: disable=no-member
145-
if PY3_4_OR_HIGHER:
146-
with open(temp_path, "rb") as filefp:
147-
version_dict = plistlib.load(filefp)
148-
else:
149-
version_dict = plistlib.readPlist(
150-
temp_path)
151-
152-
# Any IO error is acceptable to ignore
153-
except IOError:
154-
continue
155-
156-
version = version_dict.get("CFBundleShortVersionString", None)
157-
if not version:
158-
continue
159-
160-
# Check the version for a match
161-
version = int(version.split(".")[0])
162-
163-
# XCode 3 is hard coded to Developer
164-
if version == 3:
165-
temp_path = "/Developer/usr/bin/xcodebuild"
166-
else:
167-
temp_path = (
168-
"{}/{}/Contents/Developer"
169-
"/usr/bin/xcodebuild").format(base_dir, item)
170-
171-
if not os.path.isfile(temp_path):
172-
continue
173-
174-
if xcode_version:
175-
# If scanning for a perfect match, exit if found
176-
if version == xcode_version:
177-
highest_version = version
178-
return (temp_path, version)
179-
180-
# Scan for the most recent version of XCode
181-
elif version > highest_version:
182-
highest_version = version
183-
xcodebuild = (temp_path, version)
184-
185-
# XCode 3 is hard coded to a specific location
186-
if (not xcode_version and not highest_version) or xcode_version == 3:
187-
# On OSX Lion and higher, XCode 3.1.4 is a separate folder
188-
for item in ("/Xcode3.1.4/usr/bin/xcodebuild",):
189-
if os.path.isfile(item):
190-
xcodebuild = (item, 3)
191-
break
192-
193-
return xcodebuild
194-
195-
########################################
196-
197-
19884
def _get_codeblocks_registry_path():
19985
"""
20086
Locate codeblocks path using the Window Registry
@@ -614,7 +500,8 @@ def where_is_visual_studio(vs_version, tool_name=None, cpu=None):
614500
615501
Examples:
616502
>>> burger.where_is_visual_studio(2010)
617-
"C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\ide\\devenv.com"
503+
"C:\\Program Files (x86)\\Microsoft Visual Studio 10.0"
504+
"\\Common7\\ide\\devenv.com"
618505
619506
Args:
620507
vs_version: Version year as number

0 commit comments

Comments
 (0)