@@ -7,13 +7,6 @@ Function checkExit() {
7
7
}
8
8
}
9
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
10
Function ensureVersion () {
18
11
$verPat = " ^[0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z0-9-]+)?$"
19
12
if ($env: version -notmatch $verPat ) {
@@ -22,8 +15,28 @@ Function ensureVersion() {
22
15
}
23
16
}
24
17
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
+
25
37
if ($env: APPVEYOR_FORCED_BUILD -eq ' true' ) {
26
38
ensureVersion
39
+ clearIvyCache
27
40
if ($env: mode -eq ' release' ) {
28
41
echo " Running a release for $env: version "
29
42
$repositoriesFile = " $env: APPVEYOR_BUILD_FOLDER \conf\repositories"
@@ -34,8 +47,10 @@ if ($env:APPVEYOR_FORCED_BUILD -eq 'true') {
34
47
Exit 1
35
48
}
36
49
} else {
50
+ $env: version = " 2.12.4"
51
+ clearIvyCache
37
52
# By default, test building the packages (but don't uplaod)
38
53
# 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'
40
55
checkExit
41
56
}
0 commit comments