Skip to content

Commit

Permalink
sbt#27 Add a scripted test for checking crossproject setup
Browse files Browse the repository at this point in the history
  • Loading branch information
2m committed Feb 26, 2018
1 parent 2005bdf commit 079def1
Show file tree
Hide file tree
Showing 11 changed files with 54 additions and 4 deletions.
2 changes: 0 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
lazy val commonSettings = Seq(
git.baseVersion in ThisBuild := "0.4.1-SNAPSHOT",
organization in ThisBuild := "com.eed3si9n"
)

lazy val root = (project in file(".")).
enablePlugins(GitVersioning).
settings(commonSettings: _*).
settings(
sbtPlugin := true,
Expand Down
1 change: 0 additions & 1 deletion project/bintray.sbt

This file was deleted.

1 change: 0 additions & 1 deletion project/git.sbt

This file was deleted.

3 changes: 3 additions & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "2.1.0")
addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.3")

libraryDependencies += "org.scala-sbt" % "scripted-plugin" % sbtVersion.value
18 changes: 18 additions & 0 deletions src/sbt-test/unidoc/crossproject/build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import sbtcrossproject.{crossProject, CrossType}

lazy val a = project

lazy val x = crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Full)

lazy val xJs = x.js
lazy val xJvm = x.jvm

lazy val root = project.in(file("."))
.settings(
unidocProjectFilter in (ScalaUnidoc, unidoc) := {
inAnyProject -- inProjects(xJs)
}
)
.enablePlugins(ScalaUnidocPlugin)
.aggregate(a, xJs, xJvm)
1 change: 1 addition & 0 deletions src/sbt-test/unidoc/crossproject/project/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sbt.version=1.1.1
5 changes: 5 additions & 0 deletions src/sbt-test/unidoc/crossproject/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.22")
addSbtPlugin("org.portable-scala" % "sbt-crossproject" % "0.3.1")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "0.3.1")

addSbtPlugin("com.eed3si9n" % "sbt-unidoc" % System.getProperty("plugin.version"))
5 changes: 5 additions & 0 deletions src/sbt-test/unidoc/crossproject/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
> unidoc

$ exists target/scala-2.12/unidoc/crossproject/index.html
$ exists target/scala-2.12/unidoc/crossproject/Logger.html
$ exists target/scala-2.12/unidoc/crossproject/LoggerImpl.html
12 changes: 12 additions & 0 deletions src/sbt-test/unidoc/crossproject/x/js/src/main/scala/Logger.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package crossproject

import scala.scalajs.js.Dynamic.global

class LoggerImpl extends Logger {
def log(s: String) = {
val document = global.document
val newP = document.createElement("p")
newP.innerHTML = "s"
document.appendChild(newP)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package crossproject

class LoggerImpl extends Logger {
def log(s: String) = println(s)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package crossproject

trait Logger {
def log(s: String)
}

0 comments on commit 079def1

Please sign in to comment.