@@ -85,6 +85,8 @@ KNOWN_SETTINGS=(
85
85
lldb-build-type " Debug" " the CMake build variant for LLDB"
86
86
llbuild-build-type " Debug" " the CMake build variant for llbuild"
87
87
foundation-build-type " Debug" " the build variant for Foundation"
88
+ playgroundlogger-build-type " Debug" " the build variant for PlaygroundLogger"
89
+ playgroundsupport-build-type " Debug" " the build variant for PlaygroundSupport"
88
90
xctest-build-type " Debug" " the build variant for xctest"
89
91
llbuild-enable-assertions " 1" " enable assertions in llbuild"
90
92
enable-asan " " " enable Address Sanitizer"
@@ -127,6 +129,8 @@ KNOWN_SETTINGS=(
127
129
skip-build-foundation " " " set to skip building foundation"
128
130
skip-build-libdispatch " " " set to skip building libdispatch"
129
131
skip-build-benchmarks " " " set to skip building Swift Benchmark Suite"
132
+ skip-build-playgroundlogger " " " set to skip building PlaygroundLogger"
133
+ skip-build-playgroundsupport " " " set to skip building PlaygroundSupport"
130
134
skip-test-cmark " " " set to skip testing CommonMark"
131
135
skip-test-lldb " " " set to skip testing lldb"
132
136
skip-test-swift " " " set to skip testing Swift"
@@ -135,6 +139,8 @@ KNOWN_SETTINGS=(
135
139
skip-test-xctest " " " set to skip testing xctest"
136
140
skip-test-foundation " " " set to skip testing foundation"
137
141
skip-test-libdispatch " " " set to skip testing libdispatch"
142
+ skip-test-playgroundlogger " " " set to skip testing PlaygroundLogger"
143
+ skip-test-playgroundsupport " " " set to skip testing PlaygroundSupport"
138
144
skip-test-linux " " " set to skip testing Swift stdlibs for Linux"
139
145
skip-test-freebsd " " " set to skip testing Swift stdlibs for FreeBSD"
140
146
skip-test-cygwin " " " set to skip testing Swift stdlibs for Cygwin"
@@ -185,6 +191,8 @@ KNOWN_SETTINGS=(
185
191
install-xctest " " " whether to install xctest"
186
192
install-foundation " " " whether to install foundation"
187
193
install-libdispatch " " " whether to install libdispatch"
194
+ install-playgroundlogger " " " whether to install PlaygroundLogger"
195
+ install-playgroundsupport " " " whether to install PlaygroundSupport"
188
196
darwin-install-extract-symbols " " " whether to extract symbols with dsymutil during installations"
189
197
host-target " " " The host target. LLVM, Clang, and Swift will be built for this target. The built LLVM and Clang will be used to compile Swift for the cross-compilation targets. **This argument is required**"
190
198
stdlib-deployment-targets " " " space-separated list of targets to configure the Swift standard library to be compiled or cross-compiled for"
@@ -391,6 +399,14 @@ function set_build_options_for_host() {
391
399
case ${host} in
392
400
linux-x86_64)
393
401
SWIFT_HOST_VARIANT_ARCH=" x86_64"
402
+ playgroundlogger_build_cmd=" ${PLAYGROUNDLOGGER_SOURCE_DIR} /build.py"
403
+ playgroundlogger_build_options=(
404
+ --swiftc " $( build_directory_bin ${host} swift) "
405
+ --foundation " $( build_directory ${host} foundation) "
406
+ --build-dir " $( build_directory ${host} playgroundlogger) "
407
+ --swift-build-dir " $( build_directory ${host} swift) "
408
+ --` python -c ' import sys; print sys.argv[1].lower()' ${PLAYGROUNDLOGGER_BUILD_TYPE} `
409
+ )
394
410
;;
395
411
linux-armv6)
396
412
SWIFT_HOST_VARIANT_ARCH=" armv6"
@@ -438,6 +454,9 @@ function set_build_options_for_host() {
438
454
swiftpm_bootstrap_options=(
439
455
--sysroot=" $( xcrun --sdk ${xcrun_sdk_name} --show-sdk-path) "
440
456
)
457
+ playgroundlogger_build_cmd=" xcodebuild"
458
+ playgroundlogger_build_target=(" PlaygroundLogger_TestDriver" )
459
+ PLAYGROUNDLOGGER_INSTALL_PLATFORM=" MacOSX.platform"
441
460
;;
442
461
iphonesimulator-i386)
443
462
xcrun_sdk_name=" iphonesimulator"
@@ -453,6 +472,9 @@ function set_build_options_for_host() {
453
472
-DCMAKE_CXX_FLAGS=" $( cmark_c_flags ${host} ) "
454
473
-DCMAKE_OSX_SYSROOT:PATH=" $( xcrun --sdk ${xcrun_sdk_name} --show-sdk-path) "
455
474
)
475
+ playgroundlogger_build_cmd=" xcodebuild"
476
+ playgroundlogger_build_target=(" PlaygroundLogger_iOS" )
477
+ PLAYGROUNDLOGGER_INSTALL_PLATFORM=" iPhoneSimulator.platform"
456
478
;;
457
479
iphonesimulator-x86_64)
458
480
xcrun_sdk_name=" iphonesimulator"
@@ -468,6 +490,9 @@ function set_build_options_for_host() {
468
490
-DCMAKE_CXX_FLAGS=" $( cmark_c_flags ${host} ) "
469
491
-DCMAKE_OSX_SYSROOT:PATH=" $( xcrun --sdk ${xcrun_sdk_name} --show-sdk-path) "
470
492
)
493
+ playgroundlogger_build_cmd=" xcodebuild"
494
+ playgroundlogger_build_target=(" PlaygroundLogger_iOS" )
495
+ PLAYGROUNDLOGGER_INSTALL_PLATFORM=" iPhoneSimulator.platform"
471
496
;;
472
497
iphoneos-armv7)
473
498
xcrun_sdk_name=" iphoneos"
@@ -483,6 +508,9 @@ function set_build_options_for_host() {
483
508
-DCMAKE_CXX_FLAGS=" $( cmark_c_flags ${host} ) "
484
509
-DCMAKE_OSX_SYSROOT:PATH=" $( xcrun --sdk ${xcrun_sdk_name} --show-sdk-path) "
485
510
)
511
+ playgroundlogger_build_cmd=" xcodebuild"
512
+ playgroundlogger_build_target=(" PlaygroundLogger_iOS" )
513
+ PLAYGROUNDLOGGER_INSTALL_PLATFORM=" iPhoneOS.platform"
486
514
;;
487
515
iphoneos-armv7s)
488
516
xcrun_sdk_name=" iphoneos"
@@ -498,6 +526,9 @@ function set_build_options_for_host() {
498
526
-DCMAKE_CXX_FLAGS=" $( cmark_c_flags ${host} ) "
499
527
-DCMAKE_OSX_SYSROOT:PATH=" $( xcrun --sdk ${xcrun_sdk_name} --show-sdk-path) "
500
528
)
529
+ playgroundlogger_build_cmd=" xcodebuild"
530
+ playgroundlogger_build_target=(" PlaygroundLogger_iOS" )
531
+ PLAYGROUNDLOGGER_INSTALL_PLATFORM=" iPhoneOS.platform"
501
532
;;
502
533
iphoneos-arm64)
503
534
xcrun_sdk_name=" iphoneos"
@@ -513,6 +544,9 @@ function set_build_options_for_host() {
513
544
-DCMAKE_CXX_FLAGS=" $( cmark_c_flags ${host} ) "
514
545
-DCMAKE_OSX_SYSROOT:PATH=" $( xcrun --sdk ${xcrun_sdk_name} --show-sdk-path) "
515
546
)
547
+ playgroundlogger_build_cmd=" xcodebuild"
548
+ playgroundlogger_build_target=(" PlaygroundLogger_iOS" )
549
+ PLAYGROUNDLOGGER_INSTALL_PLATFORM=" iPhoneOS.platform"
516
550
;;
517
551
appletvsimulator-x86_64)
518
552
xcrun_sdk_name=" appletvsimulator"
@@ -528,6 +562,9 @@ function set_build_options_for_host() {
528
562
-DCMAKE_CXX_FLAGS=" $( cmark_c_flags ${host} ) "
529
563
-DCMAKE_OSX_SYSROOT:PATH=" $( xcrun --sdk ${xcrun_sdk_name} --show-sdk-path) "
530
564
)
565
+ playgroundlogger_build_cmd=" xcodebuild"
566
+ playgroundlogger_build_target=(" PlaygroundLogger_tvOS" )
567
+ PLAYGROUNDLOGGER_INSTALL_PLATFORM=" AppleTVSimulator.platform"
531
568
;;
532
569
appletvos-arm64)
533
570
xcrun_sdk_name=" appletvos"
@@ -543,6 +580,9 @@ function set_build_options_for_host() {
543
580
-DCMAKE_CXX_FLAGS=" $( cmark_c_flags ${host} ) "
544
581
-DCMAKE_OSX_SYSROOT:PATH=" $( xcrun --sdk ${xcrun_sdk_name} --show-sdk-path) "
545
582
)
583
+ playgroundlogger_build_cmd=" xcodebuild"
584
+ playgroundlogger_build_target=(" PlaygroundLogger_tvOS" )
585
+ PLAYGROUNDLOGGER_INSTALL_PLATFORM=" AppleTVOS.platform"
546
586
;;
547
587
watchsimulator-i386)
548
588
xcrun_sdk_name=" watchsimulator"
@@ -1087,6 +1127,8 @@ SWIFTPM_SOURCE_DIR="${WORKSPACE}/swiftpm"
1087
1127
XCTEST_SOURCE_DIR=" ${WORKSPACE} /swift-corelibs-xctest"
1088
1128
FOUNDATION_SOURCE_DIR=" ${WORKSPACE} /swift-corelibs-foundation"
1089
1129
LIBDISPATCH_SOURCE_DIR=" ${WORKSPACE} /swift-corelibs-libdispatch"
1130
+ PLAYGROUNDLOGGER_SOURCE_DIR=" ${WORKSPACE} /swift-xcode-playground-support/PlaygroundLogger"
1131
+ PLAYGROUNDSUPPORT_SOURCE_DIR=" ${WORKSPACE} /swift-xcode-playground-support/PlaygroundSupport"
1090
1132
1091
1133
if [[ ! -d ${CMARK_SOURCE_DIR} ]]; then
1092
1134
echo " Couldn't find cmark source directory."
@@ -1118,6 +1160,16 @@ if [[ ! "${SKIP_BUILD_LIBDISPATCH}" && ! -d ${LIBDISPATCH_SOURCE_DIR} ]]; then
1118
1160
exit 1
1119
1161
fi
1120
1162
1163
+ if [[ ! " ${SKIP_BUILD_PLAYGROUNDLOGGER} " && ! -d ${PLAYGROUNDLOGGER_SOURCE_DIR} ]]; then
1164
+ echo " Couldn't find PlaygroundLogger source directory."
1165
+ exit 1
1166
+ fi
1167
+
1168
+ if [[ ! " ${SKIP_BUILD_PLAYGROUNDSUPPORT} " && ! -d ${PLAYGROUNDSUPPORT_SOURCE_DIR} ]]; then
1169
+ echo " Couldn't find PlaygroundSupport source directory."
1170
+ exit 1
1171
+ fi
1172
+
1121
1173
# Symlink clang into the llvm tree.
1122
1174
CLANG_SOURCE_DIR=" ${LLVM_SOURCE_DIR} /tools/clang"
1123
1175
if [ ! -e " ${WORKSPACE} /clang" ] ; then
@@ -1154,6 +1206,12 @@ fi
1154
1206
if [[ ! " ${SKIP_BUILD_FOUNDATION} " ]] ; then
1155
1207
PRODUCTS=(" ${PRODUCTS[@]} " foundation)
1156
1208
fi
1209
+ if [[ ! " ${SKIP_BUILD_PLAYGROUNDLOGGER} " ]] ; then
1210
+ PRODUCTS=(" ${PRODUCTS[@]} " playgroundlogger)
1211
+ fi
1212
+ if [[ ! " ${SKIP_BUILD_PLAYGROUNDSUPPORT} " ]] ; then
1213
+ PRODUCTS=(" ${PRODUCTS[@]} " playgroundsupport)
1214
+ fi
1157
1215
# SwiftPM is dependent on XCTest, so XCTest must be added to the list of
1158
1216
# build products first.
1159
1217
if [[ ! " ${SKIP_BUILD_XCTEST} " ]] ; then
@@ -1415,6 +1473,13 @@ function build_directory_bin() {
1415
1473
libdispatch)
1416
1474
echo " ${root} /bin"
1417
1475
;;
1476
+ playgroundlogger)
1477
+ # FIXME: var name for build type
1478
+ echo " ${root} /${PLAYGROUNDLOGGER_BUILD_TYPE} /bin"
1479
+ ;;
1480
+ playgroundsupport)
1481
+ echo " ${root} /${PLAYGROUNDSUPPORT_BUILD_TYPE} /bin"
1482
+ ;;
1418
1483
* )
1419
1484
echo " error: unknown product: ${product} "
1420
1485
exit 1
@@ -1526,6 +1591,13 @@ function cmake_config_opt() {
1526
1591
;;
1527
1592
libdispatch)
1528
1593
;;
1594
+ playgroundlogger)
1595
+ # FIXME: var name
1596
+ echo " --config ${PLAYGROUNDLOGGER_BUILD_TYPE} "
1597
+ ;;
1598
+ playgroundsupport)
1599
+ echo " --config ${PLAYGROUNDSUPPORT_BUILD_TYPE} "
1600
+ ;;
1529
1601
* )
1530
1602
echo " error: unknown product: ${product} "
1531
1603
exit 1
@@ -2205,6 +2277,30 @@ for host in "${ALL_HOSTS[@]}"; do
2205
2277
# libdispatch builds itself and doesn't use cmake
2206
2278
continue
2207
2279
;;
2280
+ playgroundlogger)
2281
+ PLAYGROUNDLOGGER_BUILD_DIR=$( build_directory ${host} ${product} )
2282
+ SWIFTC_BIN=" $( build_directory_bin ${host} swift) /swiftc"
2283
+
2284
+ set -x
2285
+ pushd " ${PLAYGROUNDLOGGER_SOURCE_DIR} "
2286
+ mkdir -p " ${PLAYGROUNDLOGGER_BUILD_DIR} "
2287
+ " ${playgroundlogger_build_cmd} " -configuration " ${PLAYGROUNDLOGGER_BUILD_TYPE} " -target " ${playgroundlogger_build_target} " install SWIFT_EXEC=" ${SWIFTC_BIN} " DSTROOT=${build_dir} INSTALL_PATH=" /" SKIP_INSTALL=NO
2288
+ popd
2289
+ { set +x; } 2> /dev/null
2290
+ continue
2291
+ ;;
2292
+ playgroundsupport)
2293
+ PLAYGROUNDSUPPORT_BUILD_DIR=$( build_directory ${host} ${product} )
2294
+ SWIFTC_BIN=" $( build_directory_bin ${host} swift) /swiftc"
2295
+
2296
+ set -x
2297
+ pushd " ${PLAYGROUNDSUPPORT_SOURCE_DIR} "
2298
+ mkdir -p " ${PLAYGROUNDSUPPORT_BUILD_DIR} "
2299
+ " xcodebuild" -configuration " ${PLAYGROUNDSUPPORT_BUILD_TYPE} " -target AllProducts SWIFT_EXEC=" ${SWIFTC_BIN} " DSTROOT=" $( get_host_install_destdir ${host} ) "
2300
+ popd
2301
+ { set +x; } 2> /dev/null
2302
+ continue
2303
+ ;;
2208
2304
* )
2209
2305
echo " error: unknown product: ${product} "
2210
2306
exit 1
@@ -2474,6 +2570,19 @@ for host in "${ALL_HOSTS[@]}"; do
2474
2570
echo " --- Finished tests for ${product} ---"
2475
2571
continue
2476
2572
;;
2573
+ playgroundlogger)
2574
+ SWIFT_DYLIB_PATH=$( build_directory ${host} swift) /lib/swift/macosx/
2575
+ PLAYGROUNDLOGGER_FRAMEWORK_PATH=$( build_directory ${host} ${product} )
2576
+ set -x
2577
+ pushd " ${PLAYGROUNDLOGGER_FRAMEWORK_PATH} "
2578
+ DYLD_LIBRARY_PATH=$SWIFT_DYLIB_PATH DYLD_FRAMEWORK_PATH=$PLAYGROUNDLOGGER_FRAMEWORK_PATH ./PlaygroundLogger_TestDriver
2579
+ popd
2580
+ { set +x; } 2> /dev/null
2581
+ continue
2582
+ ;;
2583
+ playgroundsupport)
2584
+ continue
2585
+ ;;
2477
2586
* )
2478
2587
echo " error: unknown product: ${product} "
2479
2588
exit 1
@@ -2691,6 +2800,64 @@ for host in "${ALL_HOSTS[@]}"; do
2691
2800
# As libdispatch installation is self-contained, we break early here.
2692
2801
continue
2693
2802
;;
2803
+ playgroundlogger)
2804
+ if [[ -z " ${INSTALL_PLAYGROUNDLOGGER} " ]] ; then
2805
+ continue
2806
+ fi
2807
+ if [[ -z " ${INSTALL_DESTDIR} " ]] ; then
2808
+ echo " --install-destdir is required to install products."
2809
+ exit 1
2810
+ fi
2811
+
2812
+ echo " --- Installing ${product} ---"
2813
+ PLAYGROUNDLOGGER_BUILD_DIR=$( build_directory ${host} playgroundlogger)
2814
+ PLAYGROUNDLOGGER_INSTALL_PREFIX=" ${INSTALL_DESTDIR} "
2815
+ # Note that installing directly to /usr/lib/swift usually
2816
+ # requires root permissions.
2817
+ set -x
2818
+ case " $( uname -s) " in
2819
+ Linux)
2820
+ PLAYGROUNDLOGGER_INSTALL_DIR=" $( get_host_install_destdir ${host} ) /$( get_host_install_prefix ${host} ) /lib/swift/linux"
2821
+ mkdir -p " ${PLAYGROUNDLOGGER_INSTALL_DIR} "
2822
+ cp -R " ${PLAYGROUNDLOGGER_BUILD_DIR} " /libPlaygroundLogger.so " ${PLAYGROUNDLOGGER_INSTALL_DIR} "
2823
+ ;;
2824
+ Darwin)
2825
+ pushd " ${PLAYGROUNDLOGGER_SOURCE_DIR} "
2826
+ xcodebuild -target " All Platforms Logger" -configuration Toolchain_${PLAYGROUNDLOGGER_BUILD_TYPE} install SWIFT_EXEC=" ${SWIFTC_BIN} " DT_TOOLCHAIN_DIR=" ${TOOLCHAIN_PREFIX} " DSTROOT=" $( get_host_install_destdir ${host} ) "
2827
+ popd
2828
+ continue
2829
+ ;;
2830
+ * )
2831
+ echo " error: --install-playgroundlogger is not supported on this platform"
2832
+ exit 1
2833
+ ;;
2834
+ esac
2835
+ { set +x; } 2> /dev/null
2836
+
2837
+ # As XCTest installation is self-contained, we break early here.
2838
+ continue
2839
+ ;;
2840
+ playgroundsupport)
2841
+ set -x
2842
+ if [[ -z " ${INSTALL_PLAYGROUNDSUPPORT} " ]] ; then
2843
+ continue
2844
+ fi
2845
+ case " $( uname -s) " in
2846
+ Linux)
2847
+ ;;
2848
+ FreeBSD)
2849
+ ;;
2850
+ CYGWIN_NT-10.0)
2851
+ ;;
2852
+ Darwin)
2853
+ pushd " ${PLAYGROUNDSUPPORT_SOURCE_DIR} "
2854
+ xcodebuild -target AllProducts -configuration ${PLAYGROUNDSUPPORT_BUILD_TYPE} install SWIFT_EXEC=" ${SWIFTC_BIN} " DT_TOOLCHAIN_DIR=" ${TOOLCHAIN_PREFIX} " DSTROOT=" $( get_host_install_destdir ${host} ) "
2855
+ popd
2856
+ continue
2857
+ ;;
2858
+ esac
2859
+ { set +x; } 2> /dev/null
2860
+ ;;
2694
2861
* )
2695
2862
echo " error: unknown product: ${product} "
2696
2863
exit 1
0 commit comments