Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#27 Add a scripted test for checking crossproject setup #52

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
}