Skip to content

Commit 0952eba

Browse files
committed
AppVeyor script
1 parent 37eb5db commit 0952eba

File tree

2 files changed

+37
-2
lines changed

2 files changed

+37
-2
lines changed

admin/build.ps1

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
$ErrorActionPreference = "Stop"
2+
3+
Function checkExit() {
4+
if (-not $?) {
5+
echo "Last command failed."
6+
Exit 1
7+
}
8+
}
9+
10+
# oh boy. i don't (want to) fully understand, but executing commands and redirecting is difficult.
11+
# - https://mnaoumov.wordpress.com/2015/01/11/execution-of-external-commands-in-powershell-done-right/
12+
# - https://stackoverflow.com/a/35980675/248998
13+
# letting cmd do the redirect avoids confusing powershell.
14+
& cmd /c 'java -version' '2>&1'
15+
checkExit
16+
17+
Function ensureVersion() {
18+
$verPat="^[0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z0-9-]+)?$"
19+
if ($env:version -notmatch $verPat) {
20+
echo "Not a valid Scala version: '$env:version'"
21+
Exit 1
22+
}
23+
}
24+
25+
if ($env:APPVEYOR_FORCED_BUILD -eq 'true') {
26+
ensureVersion
27+
if ($env:mode -eq 'release') {
28+
echo "Running a release for $env:version"
29+
} else {
30+
echo "Unknown mode: '$env:mode'"
31+
}
32+
} else {
33+
# By default, test building the packages (but don't uplaod)
34+
& sbt "-Dproject.version=2.12.0" "show s3Upload::mappings"
35+
checkExit
36+
}

appveyor.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ install:
1616
- cmd: SET PATH=C:\sbt\bin;%JAVA_HOME%\bin;%PATH%
1717

1818
build_script:
19-
- java -version
20-
- sbt "-Dproject.version=2.12.0" "show s3Upload::mappings"
19+
- ps: .\admin\build.ps1
2120

2221
cache:
2322
- C:\sbt\

0 commit comments

Comments
 (0)