Skip to content

Commit 6b3517c

Browse files
committed
Use ide-gen for Xcode
1 parent 2706ca9 commit 6b3517c

12 files changed

Lines changed: 207 additions & 1346 deletions

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ Compatibility
2424
Installation
2525
------------
2626

27-
Type in ``pip install -U makeprojects``. Some platforms may require the ``sudo``
28-
prefix.
27+
Type in ``pip install -U makeprojects``. Some platforms may require the
28+
``sudo`` prefix.
2929

3030
Bugs
3131
----

docs/functions.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -307,10 +307,6 @@ visual_studio.generate
307307
^^^^^^^^^^^^^^^^^^^^^^
308308
.. doxygenfunction:: makeprojects::visual_studio::generate
309309

310-
visual_studio_utils.get_uuid
311-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
312-
.. doxygenfunction:: makeprojects::visual_studio_utils::get_uuid
313-
314310
visual_studio_utils.get_path_property
315311
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
316312
.. doxygenfunction:: makeprojects::visual_studio_utils::get_path_property

makeprojects/enums.py

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,8 @@ class IDETypes(IntEnum):
552552
xcode12: XCode 12
553553
xcode13: XCode 13
554554
xcode14: XCode 14
555+
xcode15: XCode 15
556+
xcode16: XCode 16
555557
556558
codeblocks: Codeblocks
557559
@@ -597,20 +599,22 @@ class IDETypes(IntEnum):
597599
xcode12 = 23
598600
xcode13 = 24
599601
xcode14 = 25
602+
xcode15 = 26
603+
xcode16 = 27
600604

601-
codeblocks = 26
605+
codeblocks = 28
602606

603-
nmake = 27
607+
nmake = 29
604608

605-
make = 28
609+
make = 30
606610

607-
bazel = 29
611+
bazel = 31
608612

609-
mpw = 30
613+
mpw = 32
610614

611-
buck = 31
615+
buck = 33
612616

613-
ninja = 32
617+
ninja = 34
614618

615619
########################################
616620

@@ -657,7 +661,7 @@ def is_xcode(self):
657661
IDETypes.xcode3, IDETypes.xcode4, IDETypes.xcode5, IDETypes.xcode6,
658662
IDETypes.xcode7, IDETypes.xcode8, IDETypes.xcode9, IDETypes.xcode10,
659663
IDETypes.xcode11, IDETypes.xcode12, IDETypes.xcode13,
660-
IDETypes.xcode14)
664+
IDETypes.xcode14, IDETypes.xcode15, IDETypes.xcode16)
661665

662666
########################################
663667

@@ -807,6 +811,8 @@ def __str__(self):
807811
IDETypes.xcode12: "x12",
808812
IDETypes.xcode13: "x13",
809813
IDETypes.xcode14: "x14",
814+
IDETypes.xcode15: "x15",
815+
IDETypes.xcode16: "x16",
810816
IDETypes.codeblocks: "cdb", # Codeblocks
811817
IDETypes.nmake: "nmk", # nmake
812818
IDETypes.make: "mak", # make
@@ -843,6 +849,8 @@ def __str__(self):
843849
IDETypes.xcode12: "XCode 12",
844850
IDETypes.xcode13: "XCode 13",
845851
IDETypes.xcode14: "XCode 14",
852+
IDETypes.xcode15: "XCode 15",
853+
IDETypes.xcode16: "XCode 16",
846854
IDETypes.codeblocks: "CodeBlocks 13.12",
847855
IDETypes.nmake: "GNU make",
848856
IDETypes.make: "Linux make",
@@ -899,6 +907,8 @@ def get_installed_xcode():
899907
"""
900908

901909
xcode_table = (
910+
(16, IDETypes.xcode16),
911+
(15, IDETypes.xcode15),
902912
(14, IDETypes.xcode14),
903913
(13, IDETypes.xcode13),
904914
(12, IDETypes.xcode12),

makeprojects/makefile.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ def match(filename):
189189

190190

191191
def create_build_object(file_name, priority=50,
192-
configurations=None, verbose=False):
192+
configurations=None, verbose=False):
193193
"""
194194
Create BuildMakeFile build records for every desired configuration
195195
@@ -219,7 +219,7 @@ def create_build_object(file_name, priority=50,
219219

220220

221221
def create_clean_object(file_name, priority=50,
222-
configurations=None, verbose=False):
222+
configurations=None, verbose=False):
223223
"""
224224
Create BuildMakeFile build records for every desired configuration
225225
@@ -377,8 +377,8 @@ def __init__(self, solution):
377377

378378
# Get the rule list
379379
rule_list = (configuration.custom_rules,
380-
configuration.parent.custom_rules,
381-
configuration.parent.parent.custom_rules)
380+
configuration.parent.custom_rules,
381+
configuration.parent.parent.custom_rules)
382382
get_custom_list(custom_list, rule_list, codefiles)
383383

384384
self.custom_list = custom_list
@@ -998,7 +998,7 @@ def _setlinkerflags(self, line_list):
998998
lib_list = configuration.get_unique_chained_list(
999999
"library_folders_list")
10001000
for item in lib_list:
1001-
entries.append("-L" + item)
1001+
entries.append("-L" + convert_to_linux_slashes(item))
10021002

10031003
line_list.append(" ".join(entries))
10041004

@@ -1209,7 +1209,7 @@ def write_all_target(self, line_list):
12091209
line_list.extend(
12101210
("",
12111211
"$(TEMP_DIR)/{0}.o: {1} ; $({2})".format(entry,
1212-
item, build_cpp)
1212+
item, build_cpp)
12131213
))
12141214
return 0
12151215

makeprojects/visual_studio.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
from burger import save_text_file_if_newer, convert_to_windows_slashes, \
4545
escape_xml_cdata, escape_xml_attribute, where_is_visual_studio, \
4646
load_text_file, string_to_bool, delete_file
47+
from ide_gen import vs_calcguid
4748

4849
try:
4950
from wslwinreg import convert_to_windows_path
@@ -58,7 +59,7 @@
5859
from .glsl_support import make_glsl_command
5960
from .masm_support import MASM_ENUMS, make_masm_command
6061
from .build_objects import BuildObject, BuildError
61-
from .visual_studio_utils import get_uuid, get_path_property, \
62+
from .visual_studio_utils import get_path_property, \
6263
convert_file_name_vs2010, add_masm_support, create_deploy_script, \
6364
generate_solution_file, wiiu_props
6465
from .visual_studio_2010 import VS2010vcproj, VS2010vcprojfilter
@@ -8240,7 +8241,7 @@ def generate(solution):
82408241
# Set the project UUID
82418242
item = getattr(project, "vs_uuid", None)
82428243
if not item:
8243-
project.vs_uuid = get_uuid(project.vs_output_filename)
8244+
project.vs_uuid = vs_calcguid(project.vs_output_filename)
82448245

82458246
for configuration in project.configuration_list:
82468247

makeprojects/visual_studio_2010.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@
2020
import os
2121
from burger import convert_to_windows_slashes, escape_xml_cdata, \
2222
escape_xml_attribute, packed_paths, truefalse
23+
from ide_gen import vs_calcguid
2324

2425
from .enums import FileTypes, ProjectTypes, IDETypes, PlatformTypes, \
2526
source_file_filter
26-
from .visual_studio_utils import get_toolset_version, get_uuid, \
27+
from .visual_studio_utils import get_toolset_version, \
2728
create_deploy_script
2829

2930
########################################
@@ -1830,7 +1831,7 @@ def __init__(self, project):
18301831
# Output the group list
18311832
for item in groupset:
18321833
item = convert_to_windows_slashes(item)
1833-
groupuuid = get_uuid(
1834+
groupuuid = vs_calcguid(
18341835
project.vs_output_filename + item)
18351836
filterxml = VS2010XML("Filter", {"Include": item})
18361837
self.main_element.add_element(filterxml)

makeprojects/visual_studio_utils.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -106,26 +106,6 @@
106106
########################################
107107

108108

109-
def get_uuid(input_str):
110-
"""
111-
Convert a string to a UUID.
112-
113-
Given a project name string, create a 128 bit unique hash for
114-
Visual Studio.
115-
116-
Args:
117-
input_str: Unicode string of the filename to convert into a hash
118-
Returns:
119-
A string in the format of CF994A05-58B3-3EF5-8539-E7753D89E84F
120-
"""
121-
122-
# Generate using md5 with NAMESPACE_DNS as salt
123-
temp_md5 = md5(NAMESPACE_DNS.bytes + input_str.encode("utf-8")).digest()
124-
return str(UUID(bytes=temp_md5[:16], version=3)).upper()
125-
126-
########################################
127-
128-
129109
def get_path_property(ide, pathname):
130110
"""
131111
If a path is relative, return the proper object

0 commit comments

Comments
 (0)