Skip to content

Commit

Permalink
Create NookureStaff build cli
Browse files Browse the repository at this point in the history
  • Loading branch information
Angelillo15 committed Jun 18, 2024
1 parent 8046df7 commit 1e58f06
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
30 changes: 30 additions & 0 deletions nook
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env bash

case $1 in
"build" | "b")
scripts/build.sh --full || exit 1
;;
"genProto" | "gp")
scripts/genProto.sh || exit 1
;;
"miniBuild" | "mb")
scripts/build.sh || exit 1
;;
"migrate" | "m")
scripts/migrate.sh || exit 1
;;
"close")
exit 0
;;
*)
echo "This is the NookureStaff build tool. Please specify a command to run."
echo ""
echo "Commands:"
echo " * b, build | Builds the project"
echo " * gp, genProto | Generates the protobuf classes"
echo " * mb, miniBuild | Builds the project without running the full build"
echo " * m, migrate | Migrates the project to the latest version"
echo " * close | Closes the build tool"
exit 1
;;
esac
13 changes: 13 additions & 0 deletions scripts/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

if [ "$1" == "--full" ]; then
echo "Building full project"
./scripts/genProto.sh
./scripts/migrate.sh
fi

echo "Building project..."
./gradlew shadowJar

echo "Build successful!"
echo "You can find the jar file in the build/libs directory."
7 changes: 7 additions & 0 deletions scripts/genProto.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

echo "Generating protobuf files..."

git submodule update --init

protoc --proto_path=NookureStaff-Protobuf --java_out=lite:NookureStaff-API/src/main/java/ NookureStaff-Protobuf/*.proto

0 comments on commit 1e58f06

Please sign in to comment.