Sha256: 9baf6d051803ae3efc1e918df0372ed686fa5dd8bd5ed323bfb773c9d50154a2

Contents?: true

Size: 1.29 KB

Versions: 183

Compression:

Stored size: 1.29 KB

Contents

#!/bin/bash

if [ -d "./allProjects.xcworkspace" ]; then
  echo "Please remove allProjects.xcworkspace. This script recreates this file."
  exit 1;
fi

#creates all the xcode projects
for d in ./exercises/*/ ; do
    set -e -o pipefail # http://linuxcommand.org/lc3_man_pages/seth.html
    swift package -C $d generate-xcodeproj --output allProjects
done

#create a new blank copy of a workspace file with an scheme of AllTest
/bin/cp -rf allProjects.xcworkspace.source allProjects.xcworkspace

declare -a names
suffix=".xcodeproj/"
prefix="./allProjects/"
index=0

#This creates a workspace with an AllTest scheme to run all tests.
for p in ./allProjects/*/ ; do
	sed -i '' '/<\/Workspace>/i \
			<FileRef location = "group:'$p'"> </FileRef>' allProjects.xcworkspace/contents.xcworkspacedata
	name=${p#$prefix}
	name=${name%$suffix}
	names[$index]=$name;
	((index+=1))
	sed -i '' '/<Testables>/a \
        <TestableReference skipped = "NO"><BuildableReference BuildableIdentifier = "primary" BlueprintIdentifier = "OBJ_24" BuildableName = "'$name'Tests.xctest" BlueprintName = "'$name'Tests" ReferencedContainer = "container:'$p'"> </BuildableReference> </TestableReference>' allProjects.xcworkspace/xcshareddata/xcschemes/AllTest.xcscheme
	
done

echo "Now you can run the AllTests scheme on allProjects.xcworkspace";

Version data entries

183 entries across 183 versions & 1 rubygems

Version Path
trackler-2.2.1.175 tracks/swift/allProjectsPopulateWorkspace.sh
trackler-2.2.1.174 tracks/swift/allProjectsPopulateWorkspace.sh
trackler-2.2.1.173 tracks/swift/allProjectsPopulateWorkspace.sh
trackler-2.2.1.172 tracks/swift/allProjectsPopulateWorkspace.sh
trackler-2.2.1.171 tracks/swift/allProjectsPopulateWorkspace.sh
trackler-2.2.1.170 tracks/swift/allProjectsPopulateWorkspace.sh
trackler-2.2.1.169 tracks/swift/allProjectsPopulateWorkspace.sh
trackler-2.2.1.167 tracks/swift/allProjectsPopulateWorkspace.sh
trackler-2.2.1.166 tracks/swift/allProjectsPopulateWorkspace.sh
trackler-2.2.1.165 tracks/swift/allProjectsPopulateWorkspace.sh
trackler-2.2.1.164 tracks/swift/allProjectsPopulateWorkspace.sh
trackler-2.2.1.163 tracks/swift/allProjectsPopulateWorkspace.sh
trackler-2.2.1.162 tracks/swift/allProjectsPopulateWorkspace.sh
trackler-2.2.1.161 tracks/swift/allProjectsPopulateWorkspace.sh
trackler-2.2.1.160 tracks/swift/allProjectsPopulateWorkspace.sh
trackler-2.2.1.159 tracks/swift/allProjectsPopulateWorkspace.sh
trackler-2.2.1.158 tracks/swift/allProjectsPopulateWorkspace.sh
trackler-2.2.1.157 tracks/swift/allProjectsPopulateWorkspace.sh
trackler-2.2.1.156 tracks/swift/allProjectsPopulateWorkspace.sh
trackler-2.2.1.155 tracks/swift/allProjectsPopulateWorkspace.sh