-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgenerate_projects.sh
More file actions
48 lines (39 loc) · 1.41 KB
/
generate_projects.sh
File metadata and controls
48 lines (39 loc) · 1.41 KB
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
#!/bin/bash
# Constants
WPILIB_VERSION="2025.3.2"
PROJECTS=(kitbot_2025 diff_drive spark_swerve talonfx_swerve vision skeleton)
VENDORDEPS=(
"Studica PathplannerLib Phoenix5 Phoenix6 REVLib URCL WPILibNewCommands" # kitbot_2025
"Studica PathplannerLib Phoenix5 Phoenix6 REVLib URCL WPILibNewCommands" # diff_drive
"Studica PathplannerLib Phoenix6 REVLib URCL WPILibNewCommands" # spark_swerve
"Studica PathplannerLib Phoenix6 WPILibNewCommands" # talonfx_swerve
"photonlib WPILibNewCommands" # vision
"WPILibNewCommands" # skeleton
)
# Clear old projects
rm -r generated
mkdir generated
# Iterate over projects
I=-1
for project in "${PROJECTS[@]}"; do
I=$(expr $I + 1)
declare -a vendordeps=(${VENDORDEPS[I]})
# Add template
cp -r template generated/$project
sed -i '' -e "s/WPILIB_VERSION/$WPILIB_VERSION/g" generated/$project/build.gradle
# Add sources
rsync -r sources/$project/ generated/$project/
# Add AdvantageKit vendordep
mkdir generated/$project/vendordeps
cp ../akit/build/vendordep/AdvantageKit.json generated/$project/vendordeps/AdvantageKit.json
# Copy additional vendordeps
for name in "${vendordeps[@]}"; do
cp vendordeps/$name.json generated/$project/vendordeps/$name.json
done
# Create zip
cd generated/$project
zip -r ../$project.zip . > /dev/null
cd ../..
# Print message
echo "Generated $project"
done