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