forked from ZacSweers/metro
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmetrow
More file actions
executable file
·74 lines (64 loc) · 2.03 KB
/
metrow
File metadata and controls
executable file
·74 lines (64 loc) · 2.03 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
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
#!/usr/bin/env bash
set -e
case "$1" in
"publish")
version=""
local=false
while [[ $# -gt 1 ]]; do
case "$2" in
--version)
version="$3"
shift 2
;;
--local)
local=true
shift
;;
*)
echo "Unknown publish argument: $2"
exit 1
;;
esac
done
export PUBLISHING=true
if [[ "$local" = true ]]; then
if [[ -z "$version" ]]; then
echo "Version required for local publish"
exit 1
fi
echo "Publishing version $version locally..."
./gradlew publishToMavenLocal -x dokkaGeneratePublicationHtml -PVERSION_NAME="${version}" --rerun-tasks
else
echo "Publishing version $version..."
./gradlew publish -x dokkaGeneratePublicationHtml --no-configuration-cache
fi
;;
"check")
echo "Running checks..."
./gradlew check -x dokkaGeneratePublicationHtml
./gradlew -p samples check
;;
"clean")
echo "Cleaning..."
./gradlew clean
./gradlew -p samples clean
;;
"format")
echo "Applying formatting..."
./gradlew spotlessApply --no-configuration-cache
./gradlew -p samples spotlessApply --no-configuration-cache
;;
"regen")
echo "Applying formatting and API gen..."
# Annoyingly, the apiDump task has some caching issues
./gradlew spotlessApply apiDump kotlinUpgradePackageLock --rerun-tasks --no-build-cache --no-configuration-cache
./gradlew -p samples spotlessApply kotlinUpgradePackageLock --no-configuration-cache
;;
*)
echo "Usage: metrow (publish|check|clean|format|regen)"
echo "publish options:"
echo " --version <version> Specify version for publishing"
echo " --local Publish locally"
exit 1
;;
esac