@@ -7,13 +7,6 @@ Function checkExit() {
77 }
88}
99
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-
1710Function ensureVersion () {
1811 $verPat = " ^[0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z0-9-]+)?$"
1912 if ($env: version -notmatch $verPat ) {
@@ -22,8 +15,28 @@ Function ensureVersion() {
2215 }
2316}
2417
18+ Function clearIvyCache () {
19+ if (test-path C:\Users\appveyor\.ivy2\cache\org.scala- lang) {
20+ remove-item - force - recurse C:\Users\appveyor\.ivy2\cache\org.scala- lang
21+ }
22+ if (test-path C:\Users\appveyor\.ivy2) {
23+ get-childitem - path C:\Users\appveyor\.ivy2 - recurse - include " *compiler-interface*$env: version *" | remove-item - force - recurse
24+ }
25+ if (test-path C:\Users\appveyor\.sbt) {
26+ get-childitem - path C:\Users\appveyor\.sbt - recurse - include " *compiler-interface*$env: version *" | remove-item - force - recurse
27+ }
28+ }
29+
30+ # oh boy. i don't (want to) fully understand, but executing commands and redirecting is difficult.
31+ # - https://mnaoumov.wordpress.com/2015/01/11/execution-of-external-commands-in-powershell-done-right/
32+ # - https://stackoverflow.com/a/35980675/248998
33+ # letting cmd do the redirect avoids confusing powershell.
34+ & cmd / c ' java -version' ' 2>&1'
35+ checkExit
36+
2537if ($env: APPVEYOR_FORCED_BUILD -eq ' true' ) {
2638 ensureVersion
39+ clearIvyCache
2740 if ($env: mode -eq ' release' ) {
2841 echo " Running a release for $env: version "
2942 $repositoriesFile = " $env: APPVEYOR_BUILD_FOLDER \conf\repositories"
@@ -34,8 +47,10 @@ if ($env:APPVEYOR_FORCED_BUILD -eq 'true') {
3447 Exit 1
3548 }
3649} else {
50+ $env: version = " 2.12.4"
51+ clearIvyCache
3752 # By default, test building the packages (but don't uplaod)
3853 # Need to redirect stderr, otherwise any error output (like jvm warning) fails the build (ErrorActionPreference)
39- & cmd / c ' sbt "-Dproject.version=2.12.4" " show s3Upload::mappings"' ' 2>&1'
54+ & cmd / c " sbt "" -Dproject.version=$ env: version "" "" show s3Upload::mappings"" " ' 2>&1'
4055 checkExit
4156}
0 commit comments