Skip to content

Commit

Permalink
Migrated to sbt 1.x.x with cross building.
Browse files Browse the repository at this point in the history
  • Loading branch information
Asamsig committed May 19, 2018
1 parent d0b034e commit 61cdc56
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 16 deletions.
10 changes: 5 additions & 5 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ lazy val root = (project in file("."))
.settings(
version in ThisBuild := "0.4.0",
organization in ThisBuild := "com.github.battermann",
scalaVersion := "2.10.6",
crossSbtVersions := List("0.13.17", "1.1.5"),
sbtPlugin := true,
name := "sbt-json",
mavenPublishingSettings,
Expand All @@ -19,11 +19,11 @@ lazy val root = (project in file("."))
libraryDependencies += compilerPlugin(
"org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full),
libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.1",
libraryDependencies += "com.typesafe.play" %% "play-json" % "2.6.0",
libraryDependencies += "org.typelevel" %% "cats-core" % "1.0.0-MF",
libraryDependencies += "com.lihaoyi" % "pprint_2.10" % "0.5.3",
libraryDependencies += "com.typesafe.play" %% "play-json" % "2.6.7",
libraryDependencies += "org.typelevel" %% "cats-core" % "1.1.0",
libraryDependencies += "com.lihaoyi" %% "pprint" % "0.5.3",
libraryDependencies ++= Seq(
"com.chuusai" %% "shapeless" % "2.3.2",
"com.chuusai" %% "shapeless" % "2.3.3",
compilerPlugin(
"org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full)
)
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=0.13.16
sbt.version=1.1.5
7 changes: 4 additions & 3 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "1.1")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.0")
addSbtPlugin("org.lyranthe.sbt" % "partial-unification" % "1.1.0")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "2.3")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.0")
addSbtPlugin("org.lyranthe.sbt" % "partial-unification" % "1.1.0")
addSbtPlugin("io.get-coursier" % "sbt-coursier" % "1.0.1")
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import json2caseclass.model.Types.{
}
import json2caseclass.model._
import play.api.libs.json._
import scala.language.existentials

object SchemaExtractor {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ import json2caseclass.model.Types.{ErrorOr, ErrorRWSOr}

object ? {
def <~[A](x: Either[CaseClassGenerationFailure, A]): ErrorRWSOr[A] =
ReaderWriterStateT.lift[ErrorOr, Environment, Unit, Int, A](x)
ReaderWriterStateT.liftF[ErrorOr, Environment, Unit, Int, A](x)
}
4 changes: 2 additions & 2 deletions src/main/scala/sbtjson/SbtJsonPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ object SbtJsonPlugin extends AutoPlugin {
packageNameForJsonModels := "jsonmodels",
scalaSourceDir := sourceManaged.value / "compiled_json",
printJsonModels := {

val sLog = streams.value.log
val optionals = toOptionalsMap(jsonOptionals.value)
val env = Config(
jsValueFilter = jsValueFilter.value,
Expand All @@ -173,7 +173,7 @@ object SbtJsonPlugin extends AutoPlugin {
)
} yield fromFiles ++ fromUrls

result.fold(err => streams.value.log.error(mkMessage(err)), _.foreach(s => streams.value.log.info(s._2)))
result.fold(err => sLog.error(mkMessage(err)), _.foreach(s => sLog.info(s._2)))
},
generateJsonModels := {

Expand Down
4 changes: 2 additions & 2 deletions test-project/build.sbt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
enablePlugins(SbtJsonPlugin)
name := "test-project"
scalaVersion := "2.12.2"
scalaVersion := "2.12.6"

libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.1"
libraryDependencies += "com.typesafe.play" %% "play-json" % "2.6.0"
libraryDependencies += "com.typesafe.play" %% "play-json" % "2.6.7"
// jsonUrls += "https://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1&mkt=en-US"
jsValueFilter := allJsValues.exceptNullValues.exceptEmptyArrays
jsonInterpreter := plainCaseClasses.withPlayJsonFormats
Expand Down
2 changes: 1 addition & 1 deletion test-project/project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=0.13.16
sbt.version=1.1.5
2 changes: 1 addition & 1 deletion test-project/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
lazy val root = Project("plugins", file(".")) dependsOn sbtJson

lazy val sbtJson = file("..").getAbsoluteFile.toURI
lazy val sbtJson = ClasspathDependency(RootProject(file("..").getAbsoluteFile.toURI), None)

0 comments on commit 61cdc56

Please sign in to comment.