Skip to content

Commit

Permalink
[#90] Another (final?) workaround for #84
Browse files Browse the repository at this point in the history
  • Loading branch information
holograph committed Jan 9, 2017
1 parent fa735f0 commit ab972c2
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ def noFatalWarningsOn( task: sbt.TaskKey[_] = compile, configuration: sbt.Config
( scalacOptions in ( Compile, compile ) ).value filterNot { _ == "-Xfatal-warnings" }
}

// Necessary to work around scala/scala-dev#275 (see wix/accord#84)
def providedScalaCompiler =
libraryDependencies <+= scalaVersion { "org.scala-lang" % "scala-compiler" % _ % "provided" }

lazy val compileOptions = Seq(
scalaVersion := "2.11.1",
crossScalaVersions := ( Helpers.javaVersion match {
Expand All @@ -54,7 +58,7 @@ lazy val compileOptions = Seq(
"-Xfatal-warnings"
),
noFatalWarningsOn( task = doc ) // Warnings aren't considered fatal on document generation
)
) ++ providedScalaCompiler

lazy val baseSettings =
publishSettings ++
Expand All @@ -69,10 +73,6 @@ lazy val baseSettings =

lazy val noPublish = Seq( publish := {}, publishLocal := {}, publishArtifact := false )

// Necessary to work around scala/scala-dev#275 (see wix/accord#84)
def providedScalaCompiler =
libraryDependencies <+= scalaVersion { "org.scala-lang" % "scala-compiler" % _ % "provided" }

// Projects --

lazy val api =
Expand Down Expand Up @@ -145,7 +145,6 @@ lazy val core =

libraryDependencies += "org.scalamacros" %% "resetallattrs" % "1.0.0",
libraryDependencies <+= scalaVersion( "org.scala-lang" % "scala-reflect" % _ % "provided" ),
libraryDependencies <+= scalaVersion( "org.scala-lang" % "scala-compiler" % _ % "provided" ),

description :=
"Accord is a validation library written in and for Scala. Its chief aim is to provide a composable, " +
Expand All @@ -163,15 +162,15 @@ lazy val java8 =
.settings( Seq(
name := "accord-java8",
description := "Adds native Accord combinators for Java 8 features"
) ++ baseSettings ++ providedScalaCompiler :_* )
) ++ baseSettings :_* )
.jsSettings(
// This library is still not complete (e.g. LocalDateTime isn't implemented); Scala.js support
// for this module is consequently currently disabled.
libraryDependencies += "org.scala-js" %%% "scalajs-java-time" % "0.2.0"
)

lazy val java8JVM = java8.jvm
//lazy val java8JS = java8.js
//lazy val java8JS = java8.js // Disabled until scalajs-java-time comes along. See comment above

lazy val joda =
Project(
Expand All @@ -191,15 +190,15 @@ lazy val spring3 =
Project(
id = "spring3",
base = file ( "spring3" ),
settings = baseSettings ++ providedScalaCompiler
settings = baseSettings
)
.dependsOn( apiJVM, scalatestJVM % "test->compile", coreJVM % "test->compile" )

lazy val examples =
Project(
id = "examples",
base = file( "examples" ),
settings = baseSettings ++ noPublish ++ providedScalaCompiler ++ Seq(
settings = baseSettings ++ noPublish ++ Seq(
name := "accord-examples",
description := "Sample projects for the Accord validation library.",
noFatalWarningsOn( configuration = Compile )
Expand Down

0 comments on commit ab972c2

Please sign in to comment.