-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerate.sh
executable file
·68 lines (49 loc) · 1.8 KB
/
generate.sh
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/usr/bin/env bash
copy() {
local SOURCES="$1Sources"
echo "Copy $SOURCES"
cp -a $SOURCES ../Fluenti 2>/dev/null
}
echo "Fluenti generator by LiveUI"
echo "Update SPM folder (original code)"
#cd ./SPM && rm -f Package.resolved && rm -rf .build && swift package generate-xcodeproj
s
echo "Clean Fluenti folder, all but essentials"
cd ./Fluenti
mkdir -p ../.tmp
cp .gitignore ../.tmp/.gitignore
cp Package.swift ../.tmp/Package.swift
cp LICENSE ../.tmp/LICENSE
cp README.md ../.tmp/README.md
find . ! -name '.git' -type f -exec rm -rf {} +
cp ../.tmp/.gitignore .gitignore
cp ../.tmp/Package.swift Package.swift
cp ../.tmp/LICENSE LICENSE
cp ../.tmp/README.md README.md
rm -rf ../.tmp
echo "Move SPM Project and Fluenti stuff over"
cp -rf ../SPM/Fluenti.xcodeproj ./
cp -rf ../SPM/Sources ./
cp -rf ../SPM/Tests ./
echo "Manage dependencies:"
cd ../SPM/
shopt -s dotglob
shopt -s nullglob
CHECKOUTS=(.build/checkouts/*/)
for CHECKOUT in "${CHECKOUTS[@]}"
do copy $CHECKOUT
done
echo "Gnerate new project with moved dependencies"
cd ../Fluenti
rm -rf ./Fluenti.xcodeproj
swift package generate-xcodeproj
mv ./Fluenti.xcodeproj/xcshareddata/xcschemes/Fluenti-Package.xcscheme ./Fluenti.xcodeproj/xcshareddata/xcschemes/Fluenti.xcscheme
sed -i -e 's/Fluenti-Package/Fluenti/g' ./Fluenti.xcodeproj/xcshareddata/xcschemes/xcschememanagement.plist
echo "Change project to iOS"
# TODO: Improve handing of the hardcoded values below!!!
#sed -i -e 's/\$(TOOLCHAIN_DIR)\/usr\/lib\/swift\/macosx//g' ./Fluenti.xcodeproj/project.pbxproj
#sed -i -e 's/SDKROOT = "macosx"/SDKROOT = "iphoneos"/g' ./Fluenti.xcodeproj/project.pbxproj
#sed -i -e 's/MACOSX_DEPLOYMENT_TARGET = "10.10"/IPHONEOS_DEPLOYMENT_TARGET = "11.3"/g' ./Fluenti.xcodeproj/project.pbxproj
echo "Commit changes to git"
git add -A
git commit -m "autogenerated update"