@@ -235,9 +235,9 @@ addPlaygroundReference() {
235
235
236
236
find . -name ' *.pbxproj' -print0 | while IFS= read -r -d $' \0' project; do
237
237
workspace=$( workspaceForProjectPath " $1 " " $project " )
238
- workspaceName=$( echo $workspace | rev | cut -d' /' -f 1 | rev | cut -d' .' -f 1)
238
+ workspaceName=$( echo " $workspace " | rev | cut -d' /' -f 1 | rev | cut -d' .' -f 1)
239
239
workspaceContent=" $workspace /contents.xcworkspacedata"
240
- ! [[ $workspace = .* " .xcworkspace" ]] && continue
240
+ ! [[ " $workspace " = .* " .xcworkspace" ]] && continue
241
241
grep -q " .playground" " $workspaceContent " ; [ $? -eq 0 ] && continue
242
242
243
243
for playground in " ${playgroundForProjectPath[@]} " ; do
@@ -276,24 +276,24 @@ makeStructure() {
276
276
set +e
277
277
local projectFolder=$1 # parameter `folder`
278
278
279
- cd $projectFolder
279
+ cd " $projectFolder "
280
280
281
- cleanStructure $projectFolder
281
+ cleanStructure " $projectFolder "
282
282
mkdir -p nef/build/fw
283
283
mkdir -p nef/build/output
284
284
mkdir -p nef/log
285
- mkdir -p $DERIVED_DATA_DIR
285
+ mkdir -p " $DERIVED_DATA_DIR "
286
286
}
287
287
288
288
cleanStructure () {
289
289
set +e
290
290
local projectFolder=$1 # parameter `folder`
291
291
292
- cd $projectFolder
292
+ cd " $projectFolder "
293
293
294
294
rm -r nef/build 1> /dev/null 2> /dev/null
295
295
rm -r nef/log 1> /dev/null 2> /dev/null
296
- rm -r $DERIVED_DATA_DIR 1> /dev/null 2> /dev/null
296
+ rm -r " $DERIVED_DATA_DIR " 1> /dev/null 2> /dev/null
297
297
}
298
298
299
299
# #
@@ -303,7 +303,7 @@ cleanStructure() {
303
303
copyFrameworks () {
304
304
local projectFolder=$1 # parameter `folder`
305
305
306
- cd $projectFolder
306
+ cd " $projectFolder "
307
307
308
308
if [ ! -d " $DERIVED_DATA_DIR /build" ]; then
309
309
echo " Copy ${green} frameworks${reset} ❌"
@@ -352,7 +352,7 @@ makeHeaders() {
352
352
compilePlaygroundPages () {
353
353
local projectFolder=$1 # parameter `folder`
354
354
355
- cd $projectFolder
355
+ cd " $projectFolder "
356
356
357
357
pages=()
358
358
while read -r -d $' \0' playground; do
@@ -362,14 +362,14 @@ compilePlaygroundPages() {
362
362
echo " ${bold} Found ${# pages[@]} playgrounds${normal} "
363
363
364
364
for file in " ${pages[@]} " ; do
365
- pageName=$( echo $file | rev | cut -d' /' -f 1 | rev)
365
+ pageName=$( echo " $file " | rev | cut -d' /' -f 1 | rev)
366
366
echo -ne " ${normal} Compiling ${green} $pageName ${reset} ..."
367
367
368
368
# paths
369
- baseFile=$( echo $file | cut -c 2-)
369
+ baseFile=$( echo " $file " | cut -c 2-)
370
370
baseAbsolute=$( echo " $projectFolder$baseFile " )
371
- content=$baseAbsolute /Contents.swift
372
- playgroundName=$( echo $baseAbsolute | rev | cut -d' /' -f 1 | cut -d' .' -f 2 | rev)
371
+ content=" $baseAbsolute /Contents.swift"
372
+ playgroundName=$( echo " $baseAbsolute " | rev | cut -d' /' -f 1 | cut -d' .' -f 2 | rev)
373
373
374
374
# headers
375
375
output=$( makeHeaders " $content " " $playgroundName " )
@@ -393,17 +393,17 @@ compilePlaygroundPage() {
393
393
local playgroundPage=" $3 " # parameter `playground`
394
394
local llog=" nef/log/$playgroundName -dlyb.log"
395
395
local log=" nef/log/$playgroundName .log"
396
- local sources=" $playgroundPage /../../Sources/* "
396
+ local sources=" $playgroundPage /../../Sources"
397
397
local staticLib=" $playgroundName " $( date ' +_%H_%M_%S' )
398
398
local staticLibPath=" nef/build/fw/$staticLib "
399
399
400
400
platformIOS=$( isPlatfromIOSPlaygroundPage " $playgroundPage " )
401
- hasSourceFolderFiles=$( ls $sources 2> /dev/null)
401
+ hasSourceFolderFiles=$( ls " $sources " 2> /dev/null)
402
402
403
403
# A. macOS paltform
404
404
if [ " $platformIOS " -eq " 0" ]; then
405
405
if [ " ${# hasSourceFolderFiles} " -gt 0 ]; then
406
- xcrun -k swiftc -D NOT_IN_PLAYGROUND -emit-module $sources -F " nef/build/fw" -o " $staticLibPath " 1> " $llog " 2>&1
406
+ xcrun -k swiftc -D NOT_IN_PLAYGROUND -emit-module " $sources " / * -F " nef/build/fw" -o " $staticLibPath " 1> " $llog " 2>&1
407
407
xcrun -k swiftc -D NOT_IN_PLAYGROUND -static-executable " $staticLibPath " -F " nef/build/fw" " $file " -o " nef/build/output/$playgroundName " 1> " $log " 2>&1
408
408
else
409
409
xcrun -k swiftc -D NOT_IN_PLAYGROUND -F " nef/build/fw" " $file " -o " nef/build/output/$playgroundName " 1> " $log " 2>&1
@@ -412,7 +412,7 @@ compilePlaygroundPage() {
412
412
# B. iOS platform
413
413
else
414
414
if [ " ${# hasSourceFolderFiles} " -gt 0 ]; then
415
- xcrun -k -sdk " iphonesimulator" swiftc -D NOT_IN_PLAYGROUND -target " x86_64-apple-ios12.1-simulator" -emit-module $sources -F " nef/build/fw" -o " $staticLibPath " 1> " $llog " 2>&1
415
+ xcrun -k -sdk " iphonesimulator" swiftc -D NOT_IN_PLAYGROUND -target " x86_64-apple-ios12.1-simulator" -emit-module " $sources " / * -F " nef/build/fw" -o " $staticLibPath " 1> " $llog " 2>&1
416
416
xcrun -k -sdk " iphonesimulator" swiftc -D NOT_IN_PLAYGROUND -target " x86_64-apple-ios12.1-simulator" -static-executable " $staticLibPath " -F " nef/build/fw" " $file " -o " nef/build/output/$playgroundName " 1> " $log " 2>&1
417
417
else
418
418
xcrun -k -sdk " iphonesimulator" swiftc -D NOT_IN_PLAYGROUND -target " x86_64-apple-ios12.1-simulator" -F " nef/build/fw" " $file " -o " nef/build/output/$playgroundName " 1> " $log " 2>&1
0 commit comments