Skip to content

Commit d204ae1

Browse files
authored
Re-enable appveyor (scalameta#986)
* Re-enable appveyor * Remove jvmopts. * Run only tests project. * Add back jvmopts but without comments. * Fix file separators in CliTest.
1 parent 32b48d4 commit d204ae1

File tree

5 files changed

+16
-10
lines changed

5 files changed

+16
-10
lines changed

.jvmopts

-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,5 @@
55
-XX:ReservedCodeCacheSize=250M
66
-XX:+TieredCompilation
77
-XX:-UseGCOverheadLimit
8-
# effectively adds GC to Perm space
98
-XX:+CMSClassUnloadingEnabled
10-
# must be enabled for CMSClassUnloadingEnabled to work
119
-XX:+UseConcMarkSweepGC

appveyor.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
version: '{build}'
22
os: Windows Server 2012
33
install:
4-
- cmd: choco install sbt -ia "INSTALLDIR=""C:\sbt"""
5-
- cmd: SET PATH=C:\sbt\bin;%JAVA_HOME%\bin;%PATH%
6-
- cmd: SET SBT_OPTS=-XX:MaxPermSize=2g -Xmx4g
4+
- ps: iex (new-object net.webclient).downloadstring('https://get.scoop.sh')
5+
- ps: scoop install sbt
76
environment:
87
CI_SCALA_VERSION: 2.12.2
98
build_script:
10-
- sbt update
9+
- sbt downloadIdea tests/compile
1110
test_script:
12-
- sbt ci-fast ci-sbt-scalafmt
11+
- sbt tests/test
1312
cache:
14-
- C:\sbt\ -> appveyor.yml
1513
- C:\Users\appveyor\.m2
1614
- C:\Users\appveyor\.ivy2
1715
- C:\Users\appveyor\.coursier
16+
- C:\Users\appveyor\scoop\cache
17+
- scalafmt-intellij\idea

readme.md

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ Head over to [the user docs][docs] for instructions on how to install scalafmt.
99

1010
### Quick help
1111

12+
- `sbt compile` on a clean machine will fail to compile the `scalafmt-intellij` project.
13+
- if you plan to develop the intellij plugin, run `downloadIdea` first to fetch the IntelliJ SDK (~600mb).
14+
- or, run `sbt test` or `sbt core/compile` (specific project).
1215
- Run all unit tests: `sbt test`
1316
- Run only formatting tests: `tests/testOnly *FormatTests`.
1417
- Write new formatting test: read [this doc](scalafmt-tests/src/test/resources/readme.md).

scalafmt-core/shared/src/main/scala/org/scalafmt/util/OsSpecific.scala

+4
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,8 @@ object OsSpecific {
99
def fixSeparatorsInPathPattern(unixSpecificPattern: String): String =
1010
if (isWindows) unixSpecificPattern.replace("/", """\\""")
1111
else unixSpecificPattern
12+
13+
implicit class XtensionStringAsFilename(string: String) {
14+
def asFilename: String = fixSeparatorsInPathPattern(string)
15+
}
1216
}

scalafmt-tests/src/test/scala/org/scalafmt/cli/CliTest.scala

+3-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import org.scalafmt.config.Config
1414
import org.scalafmt.config.ScalafmtConfig
1515
import org.scalafmt.util.AbsoluteFile
1616
import org.scalafmt.util.DiffAssertions
17+
import org.scalafmt.util.OsSpecific._
1718
import org.scalafmt.util.FileOps
1819
import org.scalatest.FunSuite
1920

@@ -233,7 +234,7 @@ class CliTest extends FunSuite with DiffAssertions {
233234
Array(
234235
input.path,
235236
"--exclude",
236-
"target/nested"
237+
"target/nested".asFilename
237238
))
238239
Cli.run(options)
239240
val obtained = dir2string(input)
@@ -242,7 +243,7 @@ class CliTest extends FunSuite with DiffAssertions {
242243

243244
test("scalafmt doesnotexist.scala throws error") {
244245
def check(filename: String): Unit = {
245-
val args = Array(s"$filename.scala")
246+
val args = Array(s"$filename.scala".asFilename)
246247
intercept[FileNotFoundException] {
247248
Cli.main(args)
248249
}

0 commit comments

Comments
 (0)