|
| 1 | +import sbt.Keys._ |
| 2 | +import org.scalajs.sbtplugin.cross.CrossProject |
| 3 | + |
| 4 | +val commonSettings: Seq[Setting[_]] = Seq( |
| 5 | + version := "0.0.1-SNAPSHOT", |
| 6 | + organization := "org.scala-js", |
| 7 | + scalaVersion := "2.11.8", |
| 8 | + scalacOptions ++= Seq("-deprecation", "-feature", "-Xfatal-warnings"), |
| 9 | + |
| 10 | + homepage := Some(url("http://scala-js.org/")), |
| 11 | + licenses += ("BSD New", |
| 12 | + url("https://github.com/scala-js/scala-js-java-logging/blob/master/LICENSE")), |
| 13 | + scmInfo := Some(ScmInfo( |
| 14 | + url("https://github.com/scala-js/scala-js-java-logging"), |
| 15 | + "scm:git:[email protected]:scala-js/scala-js-java-logging.git", |
| 16 | + Some( "scm:git:[email protected]:scala-js/scala-js-java-logging.git"))) |
| 17 | +) |
| 18 | + |
| 19 | +lazy val root: Project = project.in(file(".")). |
| 20 | + enablePlugins(ScalaJSPlugin). |
| 21 | + settings(commonSettings). |
| 22 | + settings( |
| 23 | + name := "scalajs-java-logging", |
| 24 | + |
| 25 | + mappings in (Compile, packageBin) ~= { |
| 26 | + _.filter(!_._2.endsWith(".class")) |
| 27 | + }, |
| 28 | + exportJars := true, |
| 29 | + |
| 30 | + publishMavenStyle := true, |
| 31 | + publishTo := { |
| 32 | + val nexus = "https://oss.sonatype.org/" |
| 33 | + if (isSnapshot.value) |
| 34 | + Some("snapshots" at nexus + "content/repositories/snapshots") |
| 35 | + else |
| 36 | + Some("releases" at nexus + "service/local/staging/deploy/maven2") |
| 37 | + }, |
| 38 | + pomExtra := ( |
| 39 | + <developers> |
| 40 | + <developer> |
| 41 | + <id>sjrd</id> |
| 42 | + <name>Sébastien Doeraene</name> |
| 43 | + <url>https://github.com/sjrd/</url> |
| 44 | + </developer> |
| 45 | + <developer> |
| 46 | + <id>gzm0</id> |
| 47 | + <name>Tobias Schlatter</name> |
| 48 | + <url>https://github.com/gzm0/</url> |
| 49 | + </developer> |
| 50 | + <developer> |
| 51 | + <id>nicolasstucki</id> |
| 52 | + <name>Nicolas Stucki</name> |
| 53 | + <url>https://github.com/nicolasstucki/</url> |
| 54 | + </developer> |
| 55 | + </developers> |
| 56 | + ), |
| 57 | + pomIncludeRepository := { _ => false } |
| 58 | + ) |
| 59 | + |
| 60 | +lazy val testSuite = CrossProject( |
| 61 | + jvmId = "testSuiteJVM", |
| 62 | + jsId = "testSuite", |
| 63 | + base = file("testSuite"), |
| 64 | + crossType = CrossType.Full |
| 65 | +). |
| 66 | + jsConfigure(_.enablePlugins(ScalaJSJUnitPlugin)). |
| 67 | + settings(commonSettings: _*). |
| 68 | + settings( |
| 69 | + testOptions += |
| 70 | + Tests.Argument(TestFramework("com.novocode.junit.JUnitFramework"), "-v", "-a") |
| 71 | + ). |
| 72 | + jsSettings( |
| 73 | + name := "java.logging testSuite on JS" |
| 74 | + ). |
| 75 | + jsConfigure(_.dependsOn(root)). |
| 76 | + jvmSettings( |
| 77 | + name := "java.logging testSuite on JVM", |
| 78 | + libraryDependencies += |
| 79 | + "com.novocode" % "junit-interface" % "0.9" % "test" |
| 80 | + ) |
| 81 | + |
| 82 | +lazy val testSuiteJS = testSuite.js |
| 83 | +lazy val testSuiteJVM = testSuite.jvm |
0 commit comments