-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnew-swiftpm
More file actions
executable file
·50 lines (42 loc) · 898 Bytes
/
Copy pathnew-swiftpm
File metadata and controls
executable file
·50 lines (42 loc) · 898 Bytes
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
#!/bin/bash -e
if [ $# -lt 1 ]; then
echo "usage: $0 <name> [<src-branch>]"
exit 1
fi
name=$1
if [ -n "$2" ]; then
branch=$2
else
branch=main
fi
mkdir $name
cd $name
clone() {
git clone https://github.com/swiftlang/$1 -b $branch
cd $1
git remote add work git@github.com:dschaefer2/$1
if [ $name != $branch ]; then
git checkout -b $name
fi
gh repo set-default https://github.com/swiftlang/$1
cd ..
}
clone swift-build
clone swift-package-manager
clone sourcekit-lsp
mkdir -p $name.xcworkspace
cat > $name.xcworkspace/contents.xcworkspacedata <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:swift-build">
</FileRef>
<FileRef
location = "group:swift-package-manager">
</FileRef>
<FileRef
location = "group:sourcekit-lsp">
</FileRef>
</Workspace>
EOF