File tree Expand file tree Collapse file tree 2 files changed +37
-2
lines changed Expand file tree Collapse file tree 2 files changed +37
-2
lines changed Original file line number Diff line number Diff line change
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
+ }
Original file line number Diff line number Diff line change @@ -16,8 +16,7 @@ install:
16
16
- cmd : SET PATH=C:\sbt\bin;%JAVA_HOME%\bin;%PATH%
17
17
18
18
build_script :
19
- - java -version
20
- - sbt "-Dproject.version=2.12.0" "show s3Upload::mappings"
19
+ - ps : .\admin\build.ps1
21
20
22
21
cache :
23
22
- C:\sbt\
You can’t perform that action at this time.
0 commit comments