-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgradle
executable file
·60 lines (57 loc) · 1.38 KB
/
gradle
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
#!/bin/bash
###
# File: gradle
# Author: Leopold Meinel ([email protected])
# -----
# Copyright (c) 2023 Leopold Meinel & contributors
# SPDX ID: GPL-3.0-or-later
# URL: https://www.gnu.org/licenses/gpl-3.0-standalone.html
# -----
###
SOURCE_DIR="$2"
: ${SOURCE_DIR:=~/src}
DEBUG_DIR="$3"
: ${DEBUG_DIR:=~/src/20-debug}
set -eu
DIRECTORIES=$(/usr/bin/find "$SOURCE_DIR" -type f -name 'build.gradle' -printf '%h\n' | sort -u)
case "$1" in
update)
for directory in $DIRECTORIES; do
cd "${directory:?}"
gradle wrapper --gradle-version 8.2.1
done
;;
build)
mkdir -p "${DEBUG_DIR:?}/"java/papermc/plugins
for directory in $DIRECTORIES; do
cd "${directory:?}"
# Build
gradle build
# Move
cp "${directory:?}/"build/libs/* "${DEBUG_DIR:?}/"java/papermc/plugins
# Clean
gradle clean
rm -rf "${directory:?}/"build
rm -rf "${directory:?}/"bin
rm -rf "${directory:?}/".gradle
done
;;
clean)
for directory in $DIRECTORIES; do
cd "${directory:?}"
gradle clean
rm -rf "${directory:?}/"build
rm -rf "${directory:?}/"bin
rm -rf "${directory:?}/".gradle
done
;;
push)
for directory in $DIRECTORIES; do
cd "${directory:?}"
git add .
git commit -m "Update gradle-wrapper to 8.2.1"
git push
done
;;
esac
cd ~