/
jucer_ProjectExport_Xcode.h
3510 lines (2793 loc) · 169 KB
/
jucer_ProjectExport_Xcode.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2020 - Raw Material Software Limited
JUCE is an open source library subject to commercial or open-source
licensing.
By using JUCE, you agree to the terms of both the JUCE 6 End-User License
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020).
End User License Agreement: www.juce.com/juce-6-licence
Privacy Policy: www.juce.com/juce-privacy-policy
Or: You may also use this code under the terms of the GPL v3 (see
www.gnu.org/licenses).
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
#pragma once
#include "jucer_XcodeProjectParser.h"
//==============================================================================
namespace
{
static const char* const iOSDefaultVersion = "9.3";
static const StringArray iOSVersions { "9.0", "9.1", "9.2", "9.3", "10.0", "10.1", "10.2", "10.3",
"11.0", "12.0", "13.0", "14.0" };
enum class MacOSVersion
{
v10_7,
v10_8,
v10_9,
v10_10,
v10_11,
v10_12,
v10_13,
v10_14,
v10_15,
v10_16,
v11_0,
v11_1,
};
static const char* getName (MacOSVersion m)
{
switch (m)
{
case MacOSVersion::v10_7: return "10.7";
case MacOSVersion::v10_8: return "10.8";
case MacOSVersion::v10_9: return "10.9";
case MacOSVersion::v10_10: return "10.10";
case MacOSVersion::v10_11: return "10.11";
case MacOSVersion::v10_12: return "10.12";
case MacOSVersion::v10_13: return "10.13";
case MacOSVersion::v10_14: return "10.14";
case MacOSVersion::v10_15: return "10.15";
case MacOSVersion::v10_16: return "10.16";
case MacOSVersion::v11_0: return "11.0";
case MacOSVersion::v11_1: return "11.1";
default: break;
}
jassertfalse;
return "";
}
static String getDisplayName (MacOSVersion m) { return getName (m) + String (" SDK"); }
static String getRootName (MacOSVersion m) { return String ("macosx") + getName (m); }
constexpr auto nextMacOSVersion = (MacOSVersion) ((int) MacOSVersion::v11_1 + 1);
constexpr auto oldestDeploymentTarget = MacOSVersion::v10_7;
constexpr auto macOSDefaultVersion = MacOSVersion::v10_11;
constexpr auto oldestSDKVersion = MacOSVersion::v10_11;
constexpr auto minimumAUv3SDKVersion = MacOSVersion::v10_11;
static MacOSVersion& operator++ (MacOSVersion& m)
{
return m = (MacOSVersion) ((int) m + 1);
}
static String getOSXSDKVersion (const String& sdkVersion)
{
for (auto v = oldestSDKVersion; v != nextMacOSVersion; ++v)
if (sdkVersion == getDisplayName (v))
return getRootName (v);
return "macosx";
}
template <class ContainerType>
static ContainerType getSDKChoiceList (MacOSVersion oldestVersion, bool displayName)
{
ContainerType container;
for (auto v = oldestVersion; v != nextMacOSVersion; ++v)
container.add (displayName ? getDisplayName (v) : getName (v));
return container;
}
static const char* const osxArch_Default = "default";
static const char* const osxArch_Native = "Native";
static const char* const osxArch_32BitUniversal = "32BitUniversal";
static const char* const osxArch_64BitUniversal = "64BitUniversal";
static const char* const osxArch_64Bit = "64BitIntel";
}
//==============================================================================
class XcodeProjectExporter : public ProjectExporter
{
public:
//==============================================================================
static String getDisplayNameMac() { return "Xcode (macOS)"; }
static String getDisplayNameiOS() { return "Xcode (iOS)"; }
static String getTargetFolderNameMac() { return "MacOSX"; }
static String getTargetFolderNameiOS() { return "iOS"; }
static String getValueTreeTypeNameMac() { return "XCODE_MAC"; }
static String getValueTreeTypeNameiOS() { return "XCODE_IPHONE"; }
//==============================================================================
XcodeProjectExporter (Project& p, const ValueTree& t, const bool isIOS)
: ProjectExporter (p, t),
xcodeCanUseDwarf (true),
iOS (isIOS),
customPListValue (settings, Ids::customPList, getUndoManager()),
pListPrefixHeaderValue (settings, Ids::pListPrefixHeader, getUndoManager()),
pListPreprocessValue (settings, Ids::pListPreprocess, getUndoManager()),
subprojectsValue (settings, Ids::xcodeSubprojects, getUndoManager()),
validArchsValue (settings, Ids::xcodeValidArchs, getUndoManager(), getAllArchs(), ","),
extraFrameworksValue (settings, Ids::extraFrameworks, getUndoManager()),
frameworkSearchPathsValue (settings, Ids::frameworkSearchPaths, getUndoManager()),
extraCustomFrameworksValue (settings, Ids::extraCustomFrameworks, getUndoManager()),
embeddedFrameworksValue (settings, Ids::embeddedFrameworks, getUndoManager()),
postbuildCommandValue (settings, Ids::postbuildCommand, getUndoManager()),
prebuildCommandValue (settings, Ids::prebuildCommand, getUndoManager()),
duplicateAppExResourcesFolderValue (settings, Ids::duplicateAppExResourcesFolder, getUndoManager(), true),
iosDeviceFamilyValue (settings, Ids::iosDeviceFamily, getUndoManager(), "1,2"),
iPhoneScreenOrientationValue (settings, Ids::iPhoneScreenOrientation, getUndoManager(), getDefaultScreenOrientations(), ","),
iPadScreenOrientationValue (settings, Ids::iPadScreenOrientation, getUndoManager(), getDefaultScreenOrientations(), ","),
customXcodeResourceFoldersValue (settings, Ids::customXcodeResourceFolders, getUndoManager()),
customXcassetsFolderValue (settings, Ids::customXcassetsFolder, getUndoManager()),
appSandboxValue (settings, Ids::appSandbox, getUndoManager()),
appSandboxInheritanceValue (settings, Ids::appSandboxInheritance, getUndoManager()),
appSandboxOptionsValue (settings, Ids::appSandboxOptions, getUndoManager(), Array<var>(), ","),
hardenedRuntimeValue (settings, Ids::hardenedRuntime, getUndoManager()),
hardenedRuntimeOptionsValue (settings, Ids::hardenedRuntimeOptions, getUndoManager(), Array<var>(), ","),
microphonePermissionNeededValue (settings, Ids::microphonePermissionNeeded, getUndoManager()),
microphonePermissionsTextValue (settings, Ids::microphonePermissionsText, getUndoManager(),
"This app requires audio input. If you do not have an audio interface connected it will use the built-in microphone."),
cameraPermissionNeededValue (settings, Ids::cameraPermissionNeeded, getUndoManager()),
cameraPermissionTextValue (settings, Ids::cameraPermissionText, getUndoManager(),
"This app requires access to the camera to function correctly."),
bluetoothPermissionNeededValue (settings, Ids::iosBluetoothPermissionNeeded, getUndoManager()),
bluetoothPermissionTextValue (settings, Ids::iosBluetoothPermissionText, getUndoManager(),
"This app requires access to Bluetooth to function correctly."),
sendAppleEventsPermissionNeededValue (settings, Ids::sendAppleEventsPermissionNeeded, getUndoManager()),
sendAppleEventsPermissionTextValue (settings, Ids::sendAppleEventsPermissionText, getUndoManager(),
"This app requires the ability to send Apple events to function correctly."),
uiFileSharingEnabledValue (settings, Ids::UIFileSharingEnabled, getUndoManager()),
uiSupportsDocumentBrowserValue (settings, Ids::UISupportsDocumentBrowser, getUndoManager()),
uiStatusBarHiddenValue (settings, Ids::UIStatusBarHidden, getUndoManager()),
uiRequiresFullScreenValue (settings, Ids::UIRequiresFullScreen, getUndoManager(), true),
documentExtensionsValue (settings, Ids::documentExtensions, getUndoManager()),
iosInAppPurchasesValue (settings, Ids::iosInAppPurchases, getUndoManager()),
iosContentSharingValue (settings, Ids::iosContentSharing, getUndoManager(), true),
iosBackgroundAudioValue (settings, Ids::iosBackgroundAudio, getUndoManager()),
iosBackgroundBleValue (settings, Ids::iosBackgroundBle, getUndoManager()),
iosPushNotificationsValue (settings, Ids::iosPushNotifications, getUndoManager()),
iosAppGroupsValue (settings, Ids::iosAppGroups, getUndoManager()),
iCloudPermissionsValue (settings, Ids::iCloudPermissions, getUndoManager()),
iosDevelopmentTeamIDValue (settings, Ids::iosDevelopmentTeamID, getUndoManager()),
iosAppGroupsIDValue (settings, Ids::iosAppGroupsId, getUndoManager()),
keepCustomXcodeSchemesValue (settings, Ids::keepCustomXcodeSchemes, getUndoManager()),
useHeaderMapValue (settings, Ids::useHeaderMap, getUndoManager()),
customLaunchStoryboardValue (settings, Ids::customLaunchStoryboard, getUndoManager()),
exporterBundleIdentifierValue (settings, Ids::bundleIdentifier, getUndoManager()),
suppressPlistResourceUsageValue (settings, Ids::suppressPlistResourceUsage, getUndoManager()),
useLegacyBuildSystemValue (settings, Ids::useLegacyBuildSystem, getUndoManager())
{
if (iOS)
{
name = getDisplayNameiOS();
targetLocationValue.setDefault (getDefaultBuildsRootFolder() + getTargetFolderNameiOS());
}
else
{
name = getDisplayNameMac();
targetLocationValue.setDefault (getDefaultBuildsRootFolder() + getTargetFolderNameMac());
}
}
static XcodeProjectExporter* createForSettings (Project& projectToUse, const ValueTree& settingsToUse)
{
if (settingsToUse.hasType (getValueTreeTypeNameMac())) return new XcodeProjectExporter (projectToUse, settingsToUse, false);
if (settingsToUse.hasType (getValueTreeTypeNameiOS())) return new XcodeProjectExporter (projectToUse, settingsToUse, true);
return nullptr;
}
//==============================================================================
String getPListToMergeString() const { return customPListValue.get(); }
String getPListPrefixHeaderString() const { return pListPrefixHeaderValue.get(); }
bool isPListPreprocessEnabled() const { return pListPreprocessValue.get(); }
String getSubprojectsString() const { return subprojectsValue.get(); }
String getExtraFrameworksString() const { return extraFrameworksValue.get(); }
String getFrameworkSearchPathsString() const { return frameworkSearchPathsValue.get(); }
String getExtraCustomFrameworksString() const { return extraCustomFrameworksValue.get(); }
String getEmbeddedFrameworksString() const { return embeddedFrameworksValue.get(); }
String getPostBuildScript() const { return postbuildCommandValue.get(); }
String getPreBuildScript() const { return prebuildCommandValue.get(); }
bool shouldDuplicateAppExResourcesFolder() const { return duplicateAppExResourcesFolderValue.get(); }
String getDeviceFamilyString() const { return iosDeviceFamilyValue.get(); }
Array<var> getDefaultScreenOrientations() const { return { "UIInterfaceOrientationPortrait",
"UIInterfaceOrientationLandscapeLeft",
"UIInterfaceOrientationLandscapeRight" }; }
Array<var> getAllArchs() const { return { "i386", "x86_64", "arm64", "arm64e"}; }
Array<var> getiPhoneScreenOrientations() const { return *iPhoneScreenOrientationValue.get().getArray(); }
Array<var> getiPadScreenOrientations() const { return *iPadScreenOrientationValue.get().getArray(); }
String getCustomResourceFoldersString() const { return customXcodeResourceFoldersValue.get().toString().replaceCharacters ("\r\n", "::"); }
String getCustomXcassetsFolderString() const { return customXcassetsFolderValue.get(); }
String getCustomLaunchStoryboardString() const { return customLaunchStoryboardValue.get(); }
bool shouldAddStoryboardToProject() const { return getCustomLaunchStoryboardString().isNotEmpty() || getCustomXcassetsFolderString().isEmpty(); }
bool isHardenedRuntimeEnabled() const { return hardenedRuntimeValue.get(); }
Array<var> getHardenedRuntimeOptions() const { return *hardenedRuntimeOptionsValue.get().getArray(); }
bool isAppSandboxEnabled() const { return appSandboxValue.get(); }
bool isAppSandboxInhertianceEnabled() const { return appSandboxInheritanceValue.get(); }
Array<var> getAppSandboxOptions() const { return *appSandboxOptionsValue.get().getArray(); }
Array<var> getValidArchs() const { return *validArchsValue.get().getArray(); }
bool isMicrophonePermissionEnabled() const { return microphonePermissionNeededValue.get(); }
String getMicrophonePermissionsTextString() const { return microphonePermissionsTextValue.get(); }
bool isCameraPermissionEnabled() const { return cameraPermissionNeededValue.get(); }
String getCameraPermissionTextString() const { return cameraPermissionTextValue.get(); }
bool isBluetoothPermissionEnabled() const { return bluetoothPermissionNeededValue.get(); }
String getBluetoothPermissionTextString() const { return bluetoothPermissionTextValue.get(); }
bool isSendAppleEventsPermissionEnabled() const { return sendAppleEventsPermissionNeededValue.get(); }
String getSendAppleEventsPermissionTextString() const { return sendAppleEventsPermissionTextValue.get(); }
bool isInAppPurchasesEnabled() const { return iosInAppPurchasesValue.get(); }
bool isContentSharingEnabled() const { return iosContentSharingValue.get(); }
bool isBackgroundAudioEnabled() const { return iosBackgroundAudioValue.get(); }
bool isBackgroundBleEnabled() const { return iosBackgroundBleValue.get(); }
bool isPushNotificationsEnabled() const { return iosPushNotificationsValue.get(); }
bool isAppGroupsEnabled() const { return iosAppGroupsValue.get(); }
bool isiCloudPermissionsEnabled() const { return iCloudPermissionsValue.get(); }
bool isFileSharingEnabled() const { return uiFileSharingEnabledValue.get(); }
bool isDocumentBrowserEnabled() const { return uiSupportsDocumentBrowserValue.get(); }
bool isStatusBarHidden() const { return uiStatusBarHiddenValue.get(); }
bool requiresFullScreen() const { return uiRequiresFullScreenValue.get(); }
bool getSuppressPlistResourceUsage() const { return suppressPlistResourceUsageValue.get(); }
bool shouldUseLegacyBuildSystem() const { return useLegacyBuildSystemValue.get(); }
String getDocumentExtensionsString() const { return documentExtensionsValue.get(); }
bool shouldKeepCustomXcodeSchemes() const { return keepCustomXcodeSchemesValue.get(); }
String getDevelopmentTeamIDString() const { return iosDevelopmentTeamIDValue.get(); }
String getAppGroupIdString() const { return iosAppGroupsIDValue.get(); }
String getDefaultLaunchStoryboardName() const { return "LaunchScreen"; }
//==============================================================================
bool usesMMFiles() const override { return true; }
bool canCopeWithDuplicateFiles() override { return true; }
bool supportsUserDefinedConfigurations() const override { return true; }
bool isXcode() const override { return true; }
bool isVisualStudio() const override { return false; }
bool isCodeBlocks() const override { return false; }
bool isMakefile() const override { return false; }
bool isAndroidStudio() const override { return false; }
bool isCLion() const override { return false; }
bool isAndroid() const override { return false; }
bool isWindows() const override { return false; }
bool isLinux() const override { return false; }
bool isOSX() const override { return ! iOS; }
bool isiOS() const override { return iOS; }
Identifier getExporterIdentifier() const override
{
return iOS ? getValueTreeTypeNameiOS() : getValueTreeTypeNameMac();
}
bool supportsPrecompiledHeaders() const override { return true; }
String getNewLineString() const override { return "\n"; }
bool supportsTargetType (build_tools::ProjectType::Target::Type type) const override
{
switch (type)
{
case build_tools::ProjectType::Target::AudioUnitv3PlugIn:
case build_tools::ProjectType::Target::StandalonePlugIn:
case build_tools::ProjectType::Target::GUIApp:
case build_tools::ProjectType::Target::StaticLibrary:
case build_tools::ProjectType::Target::DynamicLibrary:
case build_tools::ProjectType::Target::SharedCodeTarget:
case build_tools::ProjectType::Target::AggregateTarget:
return true;
case build_tools::ProjectType::Target::ConsoleApp:
case build_tools::ProjectType::Target::VSTPlugIn:
case build_tools::ProjectType::Target::VST3PlugIn:
case build_tools::ProjectType::Target::AAXPlugIn:
case build_tools::ProjectType::Target::RTASPlugIn:
case build_tools::ProjectType::Target::AudioUnitPlugIn:
case build_tools::ProjectType::Target::UnityPlugIn:
return ! iOS;
case build_tools::ProjectType::Target::unspecified:
default:
break;
}
return false;
}
void createExporterProperties (PropertyListBuilder& props) override
{
if (iOS)
{
props.add (new TextPropertyComponent (customXcassetsFolderValue, "Custom Xcassets Folder", 128, false),
"If this field is not empty, your Xcode project will use the custom xcassets folder specified here "
"for the app icons and launchimages, and will ignore the Icon files specified above. This will also prevent "
"a launch storyboard from being used.");
props.add (new TextPropertyComponent (customLaunchStoryboardValue, "Custom Launch Storyboard", 256, false),
"If this field is not empty then the specified launch storyboard file will be added to the project as an Xcode "
"resource and will be used for the app's launch screen, otherwise a default blank launch storyboard will be used. "
"The file path should be relative to the project folder.");
}
props.add (new TextPropertyComponent (customXcodeResourceFoldersValue, "Custom Xcode Resource Folders", 8192, true),
"You can specify a list of custom resource folders here (separated by newlines or whitespace). "
"References to these folders will then be added to the Xcode resources. "
"This way you can specify them for OS X and iOS separately, and modify the content of the resource folders "
"without re-saving the Projucer project.");
if (getProject().isAudioPluginProject())
props.add (new ChoicePropertyComponent (duplicateAppExResourcesFolderValue, "Add Duplicate Resources Folder to App Extension"),
"Disable this to prevent the Projucer from creating a duplicate resources folder for AUv3 app extensions.");
if (iOS)
{
props.add (new ChoicePropertyComponent (iosDeviceFamilyValue, "Device Family",
{ "iPhone", "iPad", "Universal" },
{ "1", "2", "1,2" }),
"The device family to target.");
{
StringArray orientationStrings { "Portrait", "Portrait Upside Down",
"Landscape Left", "Landscape Right" };
Array<var> orientationVars { "UIInterfaceOrientationPortrait", "UIInterfaceOrientationPortraitUpsideDown",
"UIInterfaceOrientationLandscapeLeft", "UIInterfaceOrientationLandscapeRight" };
props.add (new MultiChoicePropertyComponent (iPhoneScreenOrientationValue, "iPhone Screen Orientation", orientationStrings, orientationVars),
"The screen orientations that this app should support on iPhones.");
props.add (new MultiChoicePropertyComponent (iPadScreenOrientationValue, "iPad Screen Orientation", orientationStrings, orientationVars),
"The screen orientations that this app should support on iPads.");
}
props.add (new ChoicePropertyComponent (uiFileSharingEnabledValue, "File Sharing Enabled"),
"Enable this to expose your app's files to iTunes.");
props.add (new ChoicePropertyComponent (uiSupportsDocumentBrowserValue, "Support Document Browser"),
"Enable this to allow the user to access your app documents from a native file chooser.");
props.add (new ChoicePropertyComponent (uiStatusBarHiddenValue, "Status Bar Hidden"),
"Enable this to disable the status bar in your app.");
props.add (new ChoicePropertyComponent (uiRequiresFullScreenValue, "Requires Full Screen"),
"Disable this to enable non-fullscreen views such as Slide Over or Split View in your app. "
"You will also need to enable all orientations.");
}
else if (projectType.isGUIApplication())
{
props.add (new TextPropertyComponent (documentExtensionsValue, "Document File Extensions", 128, false),
"A comma-separated list of file extensions for documents that your app can open. "
"Using a leading '.' is optional, and the extensions are not case-sensitive.");
}
props.add (new ChoicePropertyComponent (useLegacyBuildSystemValue, "Use Legacy Build System"),
"Enable this to use the deprecated \"Legacy Build System\" in Xcode 10 and above. "
"This may fix build issues that were introduced with the new build system in Xcode 10 and subsequently fixed in Xcode 10.2, "
"however the new build system is recommended for apps targeting Apple silicon.");
if (isOSX())
{
props.add (new MultiChoicePropertyComponent (validArchsValue, "Valid Architectures", getAllArchs(), getAllArchs()),
"The full set of architectures which this project may target. "
"Each configuration will build for the intersection of this property, and the per-configuration macOS Architecture property");
props.add (new ChoicePropertyComponent (appSandboxValue, "Use App Sandbox"),
"Enable this to use the app sandbox.");
props.add (new ChoicePropertyComponentWithEnablement (appSandboxInheritanceValue, appSandboxValue, "App Sandbox Inheritance"),
"If app sandbox is enabled, this setting will configure a child process to inherit the sandbox of its parent. "
"Note that if you enable this and have specified any other app sandbox entitlements below, the child process "
"will fail to launch.");
std::vector<std::pair<String, String>> sandboxOptions
{
{ "Network: Incoming Connections (Server)", "network.server" },
{ "Network: Outgoing Connections (Client)", "network.client" },
{ "Hardware: Camera", "device.camera" },
{ "Hardware: Microphone", "device.microphone" },
{ "Hardware: USB", "device.usb" },
{ "Hardware: Printing", "print" },
{ "Hardware: Bluetooth", "device.bluetooth" },
{ "App Data: Contacts", "personal-information.addressbook" },
{ "App Data: Location", "personal-information.location" },
{ "App Data: Calendar", "personal-information.calendars" },
{ "File Access: User Selected File (Read Only)", "files.user-selected.read-only" },
{ "File Access: User Selected File (Read/Write)", "files.user-selected.read-write" },
{ "File Access: Downloads Folder (Read Only)", "files.downloads.read-only" },
{ "File Access: Downloads Folder (Read/Write)", "files.downloads.read-write" },
{ "File Access: Pictures Folder (Read Only)", "files.pictures.read-only" },
{ "File Access: Pictures Folder (Read/Write)", "files.pictures.read-write" },
{ "File Access: Music Folder (Read Only)", "assets.music.read-only" },
{ "File Access: Music Folder (Read/Write)", "assets.music.read-write" },
{ "File Access: Movies Folder (Read Only)", "assets.movies.read-only" },
{ "File Access: Movies Folder (Read/Write)", "assets.movies.read-write" },
{ "Temporary Exception: Audio Unit Hosting", "temporary-exception.audio-unit-host" },
{ "Temporary Exception: Global Mach Service", "temporary-exception.mach-lookup.global-name" },
{ "Temporary Exception: Global Mach Service Dynamic Registration", "temporary-exception.mach-register.global-name" },
{ "Temporary Exception: Home Directory File Access (Read Only)", "temporary-exception.files.home-relative-path.read-only" },
{ "Temporary Exception: Home Directory File Access (Read/Write)", "temporary-exception.files.home-relative-path.read-write" },
{ "Temporary Exception: Absolute Path File Access (Read Only)", "temporary-exception.files.absolute-path.read-only" },
{ "Temporary Exception: Absolute Path File Access (Read/Write)", "temporary-exception.files.absolute-path.read-write" },
{ "Temporary Exception: IOKit User Client Class", "temporary-exception.iokit-user-client-class" },
{ "Temporary Exception: Shared Preference Domain (Read Only)", "temporary-exception.shared-preference.read-only" },
{ "Temporary Exception: Shared Preference Domain (Read/Write)", "temporary-exception.shared-preference.read-write" }
};
StringArray sandboxKeys;
Array<var> sanboxValues;
for (auto& opt : sandboxOptions)
{
sandboxKeys.add (opt.first);
sanboxValues.add ("com.apple.security." + opt.second);
}
props.add (new MultiChoicePropertyComponentWithEnablement (appSandboxOptionsValue,
appSandboxValue,
"App Sandbox Options",
sandboxKeys,
sanboxValues));
props.add (new ChoicePropertyComponent (hardenedRuntimeValue, "Use Hardened Runtime"),
"Enable this to use the hardened runtime required for app notarization.");
std::vector<std::pair<String, String>> hardeningOptions
{
{ "Runtime Exceptions: Allow Execution of JIT-compiled Code", "cs.allow-jit" },
{ "Runtime Exceptions: Allow Unsigned Executable Memory", "cs.allow-unsigned-executable-memory" },
{ "Runtime Exceptions: Allow DYLD Environment Variables", "cs.allow-dyld-environment-variables" },
{ "Runtime Exceptions: Disable Library Validation", "cs.disable-library-validation" },
{ "Runtime Exceptions: Disable Executable Memory Protection", "cs.disable-executable-page-protection" },
{ "Runtime Exceptions: Debugging Tool", "cs.debugger" },
{ "Resource Access: Audio Input", "device.audio-input" },
{ "Resource Access: Camera", "device.camera" },
{ "Resource Access: Location", "personal-information.location" },
{ "Resource Access: Address Book", "personal-information.addressbook" },
{ "Resource Access: Calendar", "personal-information.calendars" },
{ "Resource Access: Photos Library", "personal-information.photos-library" },
{ "Resource Access: Apple Events", "automation.apple-events" }
};
StringArray hardeningKeys;
Array<var> hardeningValues;
for (auto& opt : hardeningOptions)
{
hardeningKeys.add (opt.first);
hardeningValues.add ("com.apple.security." + opt.second);
}
props.add (new MultiChoicePropertyComponentWithEnablement (hardenedRuntimeOptionsValue,
hardenedRuntimeValue,
"Hardened Runtime Options",
hardeningKeys,
hardeningValues));
}
props.add (new ChoicePropertyComponent (microphonePermissionNeededValue, "Microphone Access"),
"Enable this to allow your app to use the microphone. "
"The user of your app will be prompted to grant microphone access permissions.");
props.add (new TextPropertyComponentWithEnablement (microphonePermissionsTextValue, microphonePermissionNeededValue,
"Microphone Access Text", 1024, false),
"A short description of why your app requires microphone access.");
props.add (new ChoicePropertyComponent (cameraPermissionNeededValue, "Camera Access"),
"Enable this to allow your app to use the camera. "
"The user of your app will be prompted to grant camera access permissions.");
props.add (new TextPropertyComponentWithEnablement (cameraPermissionTextValue, cameraPermissionNeededValue,
"Camera Access Text", 1024, false),
"A short description of why your app requires camera access.");
props.add (new ChoicePropertyComponent (bluetoothPermissionNeededValue, "Bluetooth Access"),
"Enable this to allow your app to use Bluetooth on iOS 13.0 and above, and macOS 11.0 and above. "
"The user of your app will be prompted to grant Bluetooth access permissions.");
props.add (new TextPropertyComponentWithEnablement (bluetoothPermissionTextValue, bluetoothPermissionNeededValue,
"Bluetooth Access Text", 1024, false),
"A short description of why your app requires Bluetooth access.");
if (! iOS)
{
props.add (new ChoicePropertyComponent (sendAppleEventsPermissionNeededValue, "Send Apple Events"),
"Enable this to allow your app to send Apple events. "
"The user of your app will be prompted to grant permissions to control other apps.");
props.add (new TextPropertyComponentWithEnablement (sendAppleEventsPermissionTextValue, sendAppleEventsPermissionNeededValue,
"Send Apple Events Text", 1024, false),
"A short description of why your app requires the ability to send Apple events.");
}
props.add (new ChoicePropertyComponent (iosInAppPurchasesValue, "In-App Purchases Capability"),
"Enable this to grant your app the capability for in-app purchases. "
"This option requires that you specify a valid Development Team ID.");
if (iOS)
{
props.add (new ChoicePropertyComponent (iosContentSharingValue, "Content Sharing"),
"Enable this to allow your app to share content with other apps.");
props.add (new ChoicePropertyComponent (iosBackgroundAudioValue, "Audio Background Capability"),
"Enable this to grant your app the capability to access audio when in background mode. "
"This permission is required if your app creates a MIDI input or output device.");
props.add (new ChoicePropertyComponent (iosBackgroundBleValue, "Bluetooth MIDI Background Capability"),
"Enable this to grant your app the capability to connect to Bluetooth LE devices when in background mode.");
props.add (new ChoicePropertyComponent (iosAppGroupsValue, "App Groups Capability"),
"Enable this to grant your app the capability to share resources between apps using the same app group ID.");
props.add (new ChoicePropertyComponent (iCloudPermissionsValue, "iCloud Permissions"),
"Enable this to grant your app the capability to use native file load/save browser windows on iOS.");
}
props.add (new ChoicePropertyComponent (iosPushNotificationsValue, "Push Notifications Capability"),
"Enable this to grant your app the capability to receive push notifications.");
props.add (new TextPropertyComponent (customPListValue, "Custom PList", 8192, true),
"You can paste the contents of an XML PList file in here, and the settings that it contains will override any "
"settings that the Projucer creates. BEWARE! When doing this, be careful to remove from the XML any "
"values that you DO want the Projucer to change!");
props.add (new ChoicePropertyComponent (pListPreprocessValue, "PList Preprocess"),
"Enable this to preprocess PList file. This will allow you to set values to preprocessor defines,"
" for instance if you define: #define MY_FLAG 1 in a prefix header file (see PList prefix header), you can have"
" a key with MY_FLAG value and it will be replaced with 1.");
props.add (new TextPropertyComponent (pListPrefixHeaderValue, "PList Prefix Header", 512, false),
"Header file containing definitions used in plist file (see PList Preprocess).");
props.add (new ChoicePropertyComponent (suppressPlistResourceUsageValue, "Suppress AudioUnit Plist resourceUsage Key"),
"Suppress the resourceUsage key in the target's generated Plist. This is useful for AU"
" plugins that must access resources which cannot be declared in the resourceUsage block, such"
" as UNIX domain sockets. In particular, PACE-protected AU plugins may require this option to be enabled"
" in order for the plugin to load in GarageBand.");
props.add (new TextPropertyComponent (extraFrameworksValue, "Extra System Frameworks", 2048, false),
"A comma-separated list of extra system frameworks that should be added to the build. "
"(Don't include the .framework extension in the name)"
" The frameworks are expected to be located in /System/Library/Frameworks");
props.add (new TextPropertyComponent (frameworkSearchPathsValue, "Framework Search Paths", 8192, true),
"A set of paths to search for custom frameworks (one per line).");
props.add (new TextPropertyComponent (extraCustomFrameworksValue, "Extra Custom Frameworks", 8192, true),
"Paths to custom frameworks that should be added to the build (one per line). "
"You will probably need to add an entry to the Framework Search Paths for each unique directory.");
props.add (new TextPropertyComponent (embeddedFrameworksValue, "Embedded Frameworks", 8192, true),
"Paths to frameworks to be embedded with the app (one per line). "
"If you are adding a framework here then you do not need to specify it in Extra Custom Frameworks too. "
"You will probably need to add an entry to the Framework Search Paths for each unique directory.");
props.add (new TextPropertyComponent (subprojectsValue, "Xcode Subprojects", 8192, true),
"Paths to Xcode projects that should be added to the build (one per line). "
"These can be absolute or relative to the build directory. "
"The names of the required build products can be specified after a colon, comma separated, "
"e.g. \"path/to/MySubProject.xcodeproj: MySubProject, OtherTarget\". "
"If no build products are specified, all build products associated with a subproject will be added.");
props.add (new TextPropertyComponent (prebuildCommandValue, "Pre-Build Shell Script", 32768, true),
"Some shell-script that will be run before a build starts.");
props.add (new TextPropertyComponent (postbuildCommandValue, "Post-Build Shell Script", 32768, true),
"Some shell-script that will be run after a build completes.");
props.add (new TextPropertyComponent (exporterBundleIdentifierValue, "Exporter Bundle Identifier", 256, false),
"Use this to override the project bundle identifier for this exporter. "
"This is useful if you want to use different bundle identifiers for Mac and iOS exporters in the same project.");
props.add (new TextPropertyComponent (iosDevelopmentTeamIDValue, "Development Team ID", 10, false),
"The Development Team ID to be used for setting up code-signing your app. This is a ten-character "
"string (for example, \"S7B6T5XJ2Q\") that describes the distribution certificate Apple issued to you. "
"You can find this string in the OS X app Keychain Access under \"Certificates\".");
if (iOS)
props.add (new TextPropertyComponentWithEnablement (iosAppGroupsIDValue, iosAppGroupsValue, "App Group ID", 256, false),
"The App Group ID to be used for allowing multiple apps to access a shared resource folder. Multiple IDs can be "
"added separated by a semicolon.");
props.add (new ChoicePropertyComponent (keepCustomXcodeSchemesValue, "Keep Custom Xcode Schemes"),
"Enable this to keep any Xcode schemes you have created for debugging or running, e.g. to launch a plug-in in"
"various hosts. If disabled, all schemes are replaced by a default set.");
props.add (new ChoicePropertyComponent (useHeaderMapValue, "USE_HEADERMAP"),
"Enable this to make Xcode search all the projects folders for include files. This means you can be lazy "
"and not bother using relative paths to include your headers, but it means your code won't be "
"compatible with other build systems");
}
bool launchProject() override
{
#if JUCE_MAC
return getProjectBundle().startAsProcess();
#else
return false;
#endif
}
bool canLaunchProject() override
{
#if JUCE_MAC
return true;
#else
return false;
#endif
}
//==============================================================================
void create (const OwnedArray<LibraryModule>&) const override
{
for (auto& target : targets)
if (target->shouldCreatePList())
target->infoPlistFile = getTargetFolder().getChildFile (target->getInfoPlistName());
menuNibFile = getTargetFolder().getChildFile ("RecentFilesMenuTemplate.nib");
createIconFile();
auto projectBundle = getProjectBundle();
createDirectoryOrThrow (projectBundle);
createObjects();
build_tools::writeStreamToFile (projectBundle.getChildFile ("project.pbxproj"),
[this] (MemoryOutputStream& mo) { writeProjectFile (mo); });
writeInfoPlistFiles();
writeWorkspaceSettings();
// Deleting the .rsrc files can be needed to force Xcode to update the version number.
deleteRsrcFiles (getTargetFolder().getChildFile ("build"));
}
//==============================================================================
void addPlatformSpecificSettingsForProjectType (const build_tools::ProjectType&) override
{
callForAllSupportedTargets ([this] (build_tools::ProjectType::Target::Type targetType)
{
targets.insert (targetType == build_tools::ProjectType::Target::AggregateTarget ? 0 : -1,
new XcodeTarget (targetType, *this));
});
// If you hit this assert, you tried to generate a project for an exporter
// that does not support any of your targets!
jassert (targets.size() > 0);
}
void updateDeprecatedSettings() override
{
if (iOS)
updateOldOrientationSettings();
}
void updateDeprecatedSettingsInteractively() override
{
if (hasInvalidPostBuildScript())
{
String alertWindowText = iOS ? "Your Xcode (iOS) Exporter settings use an invalid post-build script. Click 'Update' to remove it."
: "Your Xcode (macOS) Exporter settings use a pre-JUCE 4.2 post-build script to move the plug-in binaries to their plug-in install folders.\n\n"
"Since JUCE 4.2, this is instead done using \"AU/VST/VST2/AAX/RTAS Binary Location\" in the Xcode (OS X) configuration settings.\n\n"
"Click 'Update' to remove the script (otherwise your plug-in may not compile correctly).";
if (AlertWindow::showOkCancelBox (AlertWindow::WarningIcon,
"Project settings: " + project.getDocumentTitle(),
alertWindowText, "Update", "Cancel", nullptr, nullptr))
postbuildCommandValue.resetToDefault();
}
}
bool hasInvalidPostBuildScript() const
{
// check whether the script is identical to the old one that the Introjucer used to auto-generate
return (MD5 (getPostBuildScript().toUTF8()).toHexString() == "265ac212a7e734c5bbd6150e1eae18a1");
}
//==============================================================================
void initialiseDependencyPathValues() override
{
vstLegacyPathValueWrapper.init ({ settings, Ids::vstLegacyFolder, nullptr },
getAppSettings().getStoredPath (Ids::vstLegacyPath, TargetOS::osx), TargetOS::osx);
aaxPathValueWrapper.init ({ settings, Ids::aaxFolder, nullptr },
getAppSettings().getStoredPath (Ids::aaxPath, TargetOS::osx), TargetOS::osx);
rtasPathValueWrapper.init ({ settings, Ids::rtasFolder, nullptr },
getAppSettings().getStoredPath (Ids::rtasPath, TargetOS::osx), TargetOS::osx);
}
protected:
//==============================================================================
class XcodeBuildConfiguration : public BuildConfiguration
{
public:
XcodeBuildConfiguration (Project& p, const ValueTree& t, const bool isIOS, const ProjectExporter& e)
: BuildConfiguration (p, t, e),
iOS (isIOS),
osxSDKVersion (config, Ids::osxSDK, getUndoManager()),
osxDeploymentTarget (config, Ids::osxCompatibility, getUndoManager(), getDisplayName (macOSDefaultVersion)),
iosDeploymentTarget (config, Ids::iosCompatibility, getUndoManager(), iOSDefaultVersion),
osxArchitecture (config, Ids::osxArchitecture, getUndoManager(), osxArch_Default),
customXcodeFlags (config, Ids::customXcodeFlags, getUndoManager()),
plistPreprocessorDefinitions (config, Ids::plistPreprocessorDefinitions, getUndoManager()),
codeSignIdentity (config, Ids::codeSigningIdentity, getUndoManager()),
fastMathEnabled (config, Ids::fastMath, getUndoManager()),
stripLocalSymbolsEnabled (config, Ids::stripLocalSymbols, getUndoManager()),
pluginBinaryCopyStepEnabled (config, Ids::enablePluginBinaryCopyStep, getUndoManager(), true),
vstBinaryLocation (config, Ids::vstBinaryLocation, getUndoManager(), "$(HOME)/Library/Audio/Plug-Ins/VST/"),
vst3BinaryLocation (config, Ids::vst3BinaryLocation, getUndoManager(), "$(HOME)/Library/Audio/Plug-Ins/VST3/"),
auBinaryLocation (config, Ids::auBinaryLocation, getUndoManager(), "$(HOME)/Library/Audio/Plug-Ins/Components/"),
rtasBinaryLocation (config, Ids::rtasBinaryLocation, getUndoManager(), "/Library/Application Support/Digidesign/Plug-Ins/"),
aaxBinaryLocation (config, Ids::aaxBinaryLocation, getUndoManager(), "/Library/Application Support/Avid/Audio/Plug-Ins/"),
unityPluginBinaryLocation (config, Ids::unityPluginBinaryLocation, getUndoManager())
{
updateOldPluginBinaryLocations();
updateOldSDKDefaults();
optimisationLevelValue.setDefault (isDebug() ? gccO0 : gccO3);
}
//==============================================================================
void createConfigProperties (PropertyListBuilder& props) override
{
if (project.isAudioPluginProject())
addXcodePluginInstallPathProperties (props);
addRecommendedLLVMCompilerWarningsProperty (props);
addGCCOptimisationProperty (props);
if (iOS)
{
Array<var> iOSVersionVars;
for (auto& s : iOSVersions)
iOSVersionVars.add (s);
props.add (new ChoicePropertyComponent (iosDeploymentTarget, "iOS Deployment Target", iOSVersions, iOSVersionVars),
"The minimum version of iOS that the target binary will run on.");
}
else
{
props.add (new ChoicePropertyComponent (osxSDKVersion, "macOS Base SDK Version", getSDKChoiceList<StringArray> (oldestSDKVersion, true),
getSDKChoiceList<Array<var>> (oldestSDKVersion, true)),
"The version of the macOS SDK to link against. If \"Default\" is selected then the Xcode default will be used.");
props.add (new ChoicePropertyComponent (osxDeploymentTarget, "macOS Deployment Target", getSDKChoiceList<StringArray> (oldestDeploymentTarget, false),
getSDKChoiceList<Array<var>> (oldestDeploymentTarget, true)),
"The minimum version of macOS that the target binary will be compatible with.");
props.add (new ChoicePropertyComponent (osxArchitecture, "macOS Architecture",
{ "Native architecture of build machine", "Standard 32-bit", "Standard 32/64-bit", "Standard 64-bit" },
{ osxArch_Native, osxArch_32BitUniversal, osxArch_64BitUniversal, osxArch_64Bit }),
"The type of macOS binary that will be produced.");
}
props.add (new TextPropertyComponent (customXcodeFlags, "Custom Xcode Flags", 8192, true),
"A comma-separated list of custom Xcode setting flags which will be appended to the list of generated flags, "
"e.g. MACOSX_DEPLOYMENT_TARGET_i386 = 10.5");
props.add (new TextPropertyComponent (plistPreprocessorDefinitions, "PList Preprocessor Definitions", 2048, true),
"Preprocessor definitions used during PList preprocessing (see PList Preprocess).");
props.add (new TextPropertyComponent (codeSignIdentity, "Code-Signing Identity", 1024, false),
"The name of a code-signing identity for Xcode to apply.");
props.add (new ChoicePropertyComponent (fastMathEnabled, "Relax IEEE Compliance"),
"Enable this to use FAST_MATH non-IEEE mode. (Warning: this can have unexpected results!)");
props.add (new ChoicePropertyComponent (stripLocalSymbolsEnabled, "Strip Local Symbols"),
"Enable this to strip any locally defined symbols resulting in a smaller binary size. Enabling this "
"will also remove any function names from crash logs. Must be disabled for static library projects. "
"Note that disabling this will not necessarily generate full debug symbols. For release configs, "
"you will also need to add the following to the \"Custom Xcode Flags\" field: "
"GCC_GENERATE_DEBUGGING_SYMBOLS = YES, STRIP_INSTALLED_PRODUCT = NO, COPY_PHASE_STRIP = NO");
}
String getModuleLibraryArchName() const override
{
return "${CURRENT_ARCH}";
}
//==============================================================================
String getOSXArchitectureString() const { return osxArchitecture.get(); }
String getPListPreprocessorDefinitionsString() const { return plistPreprocessorDefinitions.get(); }
bool isFastMathEnabled() const { return fastMathEnabled.get(); }
bool isStripLocalSymbolsEnabled() const { return stripLocalSymbolsEnabled.get(); }
String getCustomXcodeFlagsString() const { return customXcodeFlags.get(); }
String getOSXSDKVersionString() const { return osxSDKVersion.get(); }
String getOSXDeploymentTargetString() const { return osxDeploymentTarget.get(); }
String getCodeSignIdentityString() const { return codeSignIdentity.get(); }
String getiOSDeploymentTargetString() const { return iosDeploymentTarget.get(); }
bool isPluginBinaryCopyStepEnabled() const { return pluginBinaryCopyStepEnabled.get(); }
String getVSTBinaryLocationString() const { return vstBinaryLocation.get(); }
String getVST3BinaryLocationString() const { return vst3BinaryLocation.get(); }
String getAUBinaryLocationString() const { return auBinaryLocation.get(); }
String getRTASBinaryLocationString() const { return rtasBinaryLocation.get();}
String getAAXBinaryLocationString() const { return aaxBinaryLocation.get();}
String getUnityPluginBinaryLocationString() const { return unityPluginBinaryLocation.get(); }
private:
//==============================================================================
bool iOS;
ValueWithDefault osxSDKVersion, osxDeploymentTarget, iosDeploymentTarget, osxArchitecture,
customXcodeFlags, plistPreprocessorDefinitions, codeSignIdentity,
fastMathEnabled, stripLocalSymbolsEnabled, pluginBinaryCopyStepEnabled,
vstBinaryLocation, vst3BinaryLocation, auBinaryLocation, rtasBinaryLocation,
aaxBinaryLocation, unityPluginBinaryLocation;
//==============================================================================
void addXcodePluginInstallPathProperties (PropertyListBuilder& props)
{
auto isBuildingAnyPlugins = (project.shouldBuildVST() || project.shouldBuildVST3() || project.shouldBuildAU()
|| project.shouldBuildRTAS() || project.shouldBuildAAX() || project.shouldBuildUnityPlugin());
if (isBuildingAnyPlugins)
props.add (new ChoicePropertyComponent (pluginBinaryCopyStepEnabled, "Enable Plugin Copy Step"),
"Enable this to copy plugin binaries to the specified folder after building.");
if (project.shouldBuildVST3())
props.add (new TextPropertyComponentWithEnablement (vst3BinaryLocation, pluginBinaryCopyStepEnabled, "VST3 Binary Location",
1024, false),
"The folder in which the compiled VST3 binary should be placed.");
if (project.shouldBuildAU())
props.add (new TextPropertyComponentWithEnablement (auBinaryLocation, pluginBinaryCopyStepEnabled, "AU Binary Location",
1024, false),
"The folder in which the compiled AU binary should be placed.");
if (project.shouldBuildRTAS())
props.add (new TextPropertyComponentWithEnablement (rtasBinaryLocation, pluginBinaryCopyStepEnabled, "RTAS Binary Location",
1024, false),
"The folder in which the compiled RTAS binary should be placed.");
if (project.shouldBuildAAX())
props.add (new TextPropertyComponentWithEnablement (aaxBinaryLocation, pluginBinaryCopyStepEnabled, "AAX Binary Location",
1024, false),
"The folder in which the compiled AAX binary should be placed.");
if (project.shouldBuildUnityPlugin())
props.add (new TextPropertyComponentWithEnablement (unityPluginBinaryLocation, pluginBinaryCopyStepEnabled, "Unity Binary Location",
1024, false),
"The folder in which the compiled Unity plugin binary and associated C# GUI script should be placed.");
if (project.shouldBuildVST())
props.add (new TextPropertyComponentWithEnablement (vstBinaryLocation, pluginBinaryCopyStepEnabled, "VST Binary Location",
1024, false),
"The folder in which the compiled legacy VST binary should be placed.");
}
void updateOldPluginBinaryLocations()
{
if (! config ["xcodeVstBinaryLocation"].isVoid()) vstBinaryLocation = config ["xcodeVstBinaryLocation"];
if (! config ["xcodeVst3BinaryLocation"].isVoid()) vst3BinaryLocation = config ["xcodeVst3BinaryLocation"];
if (! config ["xcodeAudioUnitBinaryLocation"].isVoid()) auBinaryLocation = config ["xcodeAudioUnitBinaryLocation"];
if (! config ["xcodeRtasBinaryLocation"].isVoid()) rtasBinaryLocation = config ["xcodeRtasBinaryLocation"];
if (! config ["xcodeAaxBinaryLocation"].isVoid()) aaxBinaryLocation = config ["xcodeAaxBinaryLocation"];
}
void updateOldSDKDefaults()
{
if (iosDeploymentTarget.get() == "default") iosDeploymentTarget.resetToDefault();
if (osxArchitecture.get() == "default") osxArchitecture.resetToDefault();
if (osxSDKVersion.get() == "default") osxSDKVersion.resetToDefault();
if (osxDeploymentTarget.get() == "default") osxDeploymentTarget.resetToDefault();
}
};
BuildConfiguration::Ptr createBuildConfig (const ValueTree& v) const override
{
return *new XcodeBuildConfiguration (project, v, iOS, *this);
}
public:
//==============================================================================
/* The numbers for these enum values are defined by Xcode for the different
possible destinations of a "copy files" post-build step.
*/
enum XcodeCopyFilesDestinationIDs
{
kWrapperFolder = 1,
kExecutablesFolder = 6,
kResourcesFolder = 7,
kFrameworksFolder = 10,
kSharedFrameworksFolder = 11,
kSharedSupportFolder = 12,
kPluginsFolder = 13,
kJavaResourcesFolder = 15,
kXPCServicesFolder = 16
};
//==============================================================================
struct XcodeTarget : build_tools::ProjectType::Target
{
//==============================================================================
XcodeTarget (build_tools::ProjectType::Target::Type targetType, const XcodeProjectExporter& exporter)
: Target (targetType),
owner (exporter)
{
switch (type)
{
case GUIApp:
xcodeFileType = "wrapper.application";
xcodeBundleExtension = ".app";
xcodeProductType = "com.apple.product-type.application";
xcodeCopyToProductInstallPathAfterBuild = false;
break;
case ConsoleApp:
xcodeFileType = "compiled.mach-o.executable";
xcodeBundleExtension = String();
xcodeProductType = "com.apple.product-type.tool";
xcodeCopyToProductInstallPathAfterBuild = false;
break;
case StaticLibrary:
xcodeFileType = "archive.ar";
xcodeBundleExtension = ".a";
xcodeProductType = "com.apple.product-type.library.static";
xcodeCopyToProductInstallPathAfterBuild = false;
break;
case DynamicLibrary:
xcodeFileType = "compiled.mach-o.dylib";
xcodeProductType = "com.apple.product-type.library.dynamic";
xcodeBundleExtension = ".dylib";
xcodeCopyToProductInstallPathAfterBuild = false;
break;
case VSTPlugIn: