-
Notifications
You must be signed in to change notification settings - Fork 2
/
both.sh
executable file
·64 lines (48 loc) · 918 Bytes
/
both.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
#!/usr/bin/env bash
set -exo pipefail
operation="$1"; shift
sequential="$([ "$1" = 'sequential' ] && echo 1 || echo 0)"
function sbtSequential() {
bash -c "cd scala-2 && sbt $1"
bash -c "cd scala-3 && sbt $1"
}
function sbtParallel() {
if [ "$sequential" = 1 ]; then
sbtSequential $1
return
fi
bash -c "cd scala-2 && sbt $1" &
bash -c "cd scala-3 && sbt $1" &
wait
}
function clean() {
sbtParallel clean
}
function compile() {
sbtParallel compile
}
function testCompile() {
sbtParallel Test/compile
}
function test() {
sbtParallel test
}
function generate() {
sbtParallel generate/run
}
function publish() {
sbtSequential publish
}
function publishLocal() {
sbtSequential publishLocal
}
function gitRelease() {
sbtSequential gitRelease
}
function mimaReport() {
sbtSequential mimaReportBinaryIssues
}
function docs() {
cd scala-2 && sbt docs/mdoc
}
$operation