Skip to content

Commit

Permalink
Merge pull request scalacenter#1090 from ckipp01/sbt
Browse files Browse the repository at this point in the history
Update sbt and coursier
  • Loading branch information
olafurpg committed Apr 14, 2020
2 parents 4851c4b + ac9d7a6 commit 74f427c
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 17 deletions.
6 changes: 4 additions & 2 deletions build.sbt
Expand Up @@ -4,7 +4,7 @@ inThisBuild(
onLoadMessage := s"Welcome to scalafix ${version.value}",
scalaVersion := scala212,
crossScalaVersions := List(scala212, scala211),
fork.in(Test, test) := true
fork := true
)
)

Expand Down Expand Up @@ -169,7 +169,8 @@ lazy val unit = project
.in(file("scalafix-tests/unit"))
.settings(
noPublish,
fork := false,
// Change working directory to match when `fork := false`.
baseDirectory.in(Test) := baseDirectory.in(ThisBuild).value,
javaOptions := Nil,
buildInfoPackage := "scalafix.tests",
buildInfoObject := "BuildInfo",
Expand Down Expand Up @@ -251,6 +252,7 @@ lazy val docs = project
.in(file("scalafix-docs"))
.settings(
noMima,
baseDirectory.in(run) := baseDirectory.in(ThisBuild).value,
skip in publish := true,
moduleName := "scalafix-docs",
scalaVersion := scala212,
Expand Down
7 changes: 4 additions & 3 deletions project/Dependencies.scala
Expand Up @@ -8,6 +8,7 @@ object Dependencies {
def scala211 = "2.11.12"
def scala212 = "2.12.11"
def scala213 = "2.13.1"
def coursierV = "2.0.0-RC5-6"
val currentScalaVersion = scala212

val jgit = "org.eclipse.jgit" % "org.eclipse.jgit" % "5.6.0.201912101111-r"
Expand All @@ -25,7 +26,7 @@ object Dependencies {

def testsDeps = List(
// integration property tests
"io.get-coursier" %% "coursier" % "2.0.0-RC5-6",
"io.get-coursier" %% "coursier" % coursierV,
"org.scala-lang.modules" %% "scala-xml" % "1.2.0",
"org.typelevel" %% "cats-core" % "2.0.0",
"com.typesafe.slick" %% "slick" % "3.3.2",
Expand All @@ -34,7 +35,7 @@ object Dependencies {
)

def coursierDeps = Seq(
"io.get-coursier" %% "coursier" % coursier.util.Properties.version,
"io.get-coursier" %% "coursier-cache" % coursier.util.Properties.version
"io.get-coursier" %% "coursier" % coursierV,
"io.get-coursier" %% "coursier-cache" % coursierV
)
}
8 changes: 3 additions & 5 deletions project/ScalafixBuild.scala
Expand Up @@ -32,9 +32,7 @@ object ScalafixBuild extends AutoPlugin with GhpagesKeys {
lazy val isFullCrossVersion = Seq(
crossVersion := CrossVersion.full
)
lazy val isScala213 = Def.setting {
scalaVersion.value.startsWith("2.13")
}
lazy val isScala213 = Def.setting { scalaVersion.value.startsWith("2.13") }
lazy val warnUnusedImports = Def.setting {
if (isScala213.value) "-Ywarn-unused:imports"
else "-Ywarn-unused-import"
Expand All @@ -59,7 +57,7 @@ object ScalafixBuild extends AutoPlugin with GhpagesKeys {
name,
version,
stableVersion,
"coursier" -> coursier.util.Properties.version,
"coursier" -> coursierV,
"nightly" -> version.value,
"scalameta" -> scalametaV,
scalaVersion,
Expand Down Expand Up @@ -155,7 +153,7 @@ object ScalafixBuild extends AutoPlugin with GhpagesKeys {
"stableVersion" -> stableVersion.value,
"scalametaVersion" -> scalametaV,
"supportedScalaVersions" -> supportedScalaVersions,
"coursierVersion" -> coursier.util.Properties.version
"coursierVersion" -> coursierV
)
),
fork in tut := true
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
@@ -1 +1 @@
sbt.version=1.2.8
sbt.version=1.3.9
3 changes: 0 additions & 3 deletions project/plugins.sbt
@@ -1,8 +1,5 @@
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.2")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.9.0")
addSbtPlugin(
"io.get-coursier" % "sbt-coursier" % coursier.util.Properties.version
)
addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.6.3")
addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.4.0")
// exclude is a workaround for https://github.com/sbt/sbt-assembly/issues/236#issuecomment-294452474
Expand Down
1 change: 0 additions & 1 deletion project/project/plugins.sbt
@@ -1,3 +1,2 @@
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.23")
addSbtPlugin("io.get-coursier" % "sbt-coursier" % "2.0.0-RC3-3")
unmanagedSources.in(Compile) += baseDirectory.value / ".." / "Dependencies.scala"
Binary file modified sbt
Binary file not shown.
9 changes: 8 additions & 1 deletion scalafix-docs/src/main/scala/scalafix/docs/PatchDocs.scala
@@ -1,5 +1,7 @@
package scalafix.docs

import java.nio.file.Paths
import java.io.File
import org.typelevel.paiges.Doc
import scala.meta.inputs.Input
import scala.meta.interactive.InteractiveSemanticdb
Expand Down Expand Up @@ -101,7 +103,12 @@ object PatchDocs {
"-Ywarn-unused",
"-P:semanticdb:synthetics:on"
)
lazy val compiler = InteractiveSemanticdb.newCompiler(scalacOptions)
lazy val classpath = ClasspathOps
.getURLs(this.getClass().getClassLoader())
.map(p => Paths.get(p.toURI()))
.mkString(File.pathSeparator)
lazy val compiler =
InteractiveSemanticdb.newCompiler(classpath, scalacOptions)
lazy val symtab =
GlobalSymbolTable(ClasspathOps.thisClasspath, includeJdk = true)
lazy val scalafixSymtab = new Symtab { self =>
Expand Down
Expand Up @@ -82,7 +82,7 @@ class ScalafixImplSuite extends FunSuite with DiffAssertions {
}

test("error") {
val cl = new URLClassLoader(Array())
val cl = new URLClassLoader(Array(), null)
val ex = intercept[ScalafixException] {
i.Scalafix.classloadInstance(cl)
}
Expand Down

0 comments on commit 74f427c

Please sign in to comment.