-
Notifications
You must be signed in to change notification settings - Fork 8
/
build_bindings.sh
executable file
·76 lines (67 loc) · 2.96 KB
/
build_bindings.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
67
68
69
70
71
72
73
74
75
76
#!/bin/bash
# This script is used to build the source generated bindings for FishyFlip
# It includes a list of git repos to be cloned, building FFSourceGen, and passing the directories into it
# to generate the bindings
# List of git repos to clone
REPOS=(
"https://github.com/bluesky-social/atproto.git"
"https://github.com/whtwnd/whitewind-blog.git"
"https://github.com/ziodotsh/lexicons.git"
"https://github.com/shinolabs/PinkSea.git"
"https://github.com/mkizka/linkat.git"
"https://github.com/likeandscribe/frontpage.git"
"https://github.com/psky-atp/client.git"
"https://github.com/Gregoor/skylights.git"
"https://github.com/echo8/pastesphere.git"
"https://github.com/marukun712/AniBlue.git"
"https://github.com/lexicon-community/lexicon.git"
)
PWD=$(pwd)
# Clone the repos
for REPO in "${REPOS[@]}"
do
user_repo=$(echo "$REPO" | grep -o '[^/]*/[^/]*\.git$' | sed 's/\.git$//')
username=$(echo "$user_repo" | cut -d'/' -f1)
repo_name=$(echo "$user_repo" | cut -d'/' -f2)
target_dir="${username}-${repo_name}"
if [ -d "../fflexicons/$target_dir" ]; then
echo "Updating $target_dir"
cd "../fflexicons/$target_dir"
git pull
cd -
else
echo "Cloning $target_dir"
git clone "$REPO" "../fflexicons/$target_dir"
fi
done
# Create list of cloned repo directories from the above list except for atproto
REPO_DIRS=()
for REPO in "${REPOS[@]}"
do
user_repo=$(echo "$REPO" | grep -o '[^/]*/[^/]*\.git$' | sed 's/\.git$//')
username=$(echo "$user_repo" | cut -d'/' -f1)
repo_name=$(echo "$user_repo" | cut -d'/' -f2)
target_dir="${username}-${repo_name}"
if [ "$target_dir" != "bluesky-social-atproto" ]; then
if [ "$target_dir" == "whtwnd-whitewind-blog" ]; then
REPO_DIRS+=("$(PWD)/../fflexicons/$target_dir/lexicons/com/whtwnd")
elif [ "$target_dir" == "ziodotsh-lexicons" ]; then
REPO_DIRS+=("$(PWD)/../fflexicons/$target_dir/blue/zio")
elif [ "$target_dir" == "shinolabs-PinkSea" ]; then
REPO_DIRS+=("$(PWD)/../fflexicons/$target_dir/PinkSea.Lexicons/com")
elif [ "$target_dir" == "likeandscribe-frontpage" ]; then
REPO_DIRS+=("$(PWD)/../fflexicons/$target_dir/lexicons/fyi")
elif [ "$target_dir" == "Gregoor-skylights" ]; then
REPO_DIRS+=("$(PWD)/../fflexicons/$target_dir/web/lexicons")
elif [ "$target_dir" == "lexicon-community-lexicon" ]; then
REPO_DIRS+=("$(PWD)/../fflexicons/$target_dir/community/lexicon")
else
REPO_DIRS+=("$(PWD)/../fflexicons/$target_dir/lexicons")
fi
fi
done
# Build FFSourceGen
dotnet build tools/FFSourceGen/FFSourceGen.csproj
dotnet run --project tools/FFSourceGen/FFSourceGen.csproj -- generate $(PWD)/../fflexicons/bluesky-social-atproto/lexicons -o $(PWD)/src/FishyFlip/ -t "${REPO_DIRS[@]}"
# Build FishyFlip to verify the bindings compile
dotnet build src/FishyFlip/FishyFlip.csproj -c Release