0
這裏的依賴是一個https://github.com/jducoeur/bootstrap-datepicker-scalajs文件build.sbt:申報JS在SBT
import SonatypeKeys._
sonatypeSettings
lazy val root = project.in(file(".")).
enablePlugins(ScalaJSPlugin)
name := "Scala.js facade for bootstrap-datepicker"
normalizedName := "bootstrap-datepicker-facade"
version := "0.3"
organization := "org.querki"
scalaVersion := "2.11.6"
crossScalaVersions := Seq("2.10.4", "2.11.5")
libraryDependencies ++= Seq(
"org.querki" %%% "querki-jsext" % "0.5",
"org.scala-js" %%% "scalajs-dom" % "0.8.0",
"org.querki" %%% "jquery-facade" % "0.6"
)
jsDependencies += "org.webjars" % "bootstrap" % "3.3.4"/"bootstrap.js" minified "bootstrap.min.js" dependsOn "jquery.js"
jsDependencies += "org.webjars" % "bootstrap-datepicker" % "1.4.0"/"bootstrap-datepicker.js" minified "bootstrap-datepicker.min.js" dependsOn "bootstrap.js"
jsDependencies in Test += RuntimeDOM
homepage := Some(url("http://www.querki.net/"))
licenses += ("MIT License", url("http://www.opensource.org/licenses/mit-license.php"))
scmInfo := Some(ScmInfo(
url("https://github.com/jducoeur/bootstrap-datepicker-scalajs"),
"scm:git:[email protected]:jducoeur/bootstrap-datepicker-scalajs.git",
Some("scm:git:[email protected]:jducoeur/bootstrap-datepicker-scalajs.git")))
publishMavenStyle := true
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value)
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
}
pomExtra := (
<developers>
<developer>
<id>jducoeur</id>
<name>Mark Waks</name>
<url>https://github.com/jducoeur/</url>
</developer>
</developers>
)
pomIncludeRepository := { _ => false }
它定義了兩個JS的依賴關係:引導和引導,日期選擇器。由於bootstrap-datepicker已經依賴於bootstrap,我們能不能僅僅聲明bootstrap-datepicker?
只是一個額外注:Scala.js庫可包括附加jsDependencies。在上面,你會注意到jsDependency for Bootstrap取決於jquery.js。這是指jsDependency爲的jquery.js,這是從jQuery的門面libraryDependency回升。外牆發佈他們需要的jsDependencies是很常見的。 –