Skip to content

Commit

Permalink
Don't automatically bring in scalajs with sbt-twirl
Browse files Browse the repository at this point in the history
  • Loading branch information
gmethvin committed Aug 5, 2017
1 parent 76a1f64 commit 098f9db
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
5 changes: 3 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ lazy val plugin = project
name := "sbt-twirl",
organization := "com.typesafe.sbt",
libraryDependencies += "org.scalatest" %%% "scalatest" % scalatest % "test",
// Plugin for %%%
addSbtPlugin("org.scala-js" % "sbt-scalajs" % scalaJSVersion),

addSbtPlugin("org.scala-native" % "sbt-crossproject" % "0.2.0"),

resourceGenerators in Compile += generateVersionFile.taskValue,
scriptedDependencies := {
scriptedDependencies.value
Expand Down
7 changes: 2 additions & 5 deletions sbt-twirl/src/main/scala/play/twirl/sbt/SbtTwirl.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ object Import {
object SbtTwirl extends AutoPlugin {

import Import.TwirlKeys._
import sbt.KeyRanks.BSetting
import sbtcrossproject.CrossPlugin.autoImport._

val autoImport = Import

import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._

override def requires = sbt.plugins.JvmPlugin

override def trigger = noTrigger
Expand Down Expand Up @@ -74,10 +74,7 @@ object SbtTwirl extends AutoPlugin {
)

def dependencySettings = Def.settings(
// Task is undefined if not a ScalaJSPlugin
isScalaJSProject := (isScalaJSProject ?? false).value,
twirlVersion := readResourceProperty("twirl.version.properties", "twirl.api.version"),
// %%% will be the same as %% for normal projects
libraryDependencies += "com.typesafe.play" %%% "twirl-api" % twirlVersion.value
)

Expand Down

0 comments on commit 098f9db

Please sign in to comment.