diff --git a/build.sbt b/build.sbt index f2e02b1..535215a 100644 --- a/build.sbt +++ b/build.sbt @@ -1,8 +1,9 @@ +val sjsxVersion = "0.3.0-SNAPSHOT" lazy val commonSettings = Seq( organization := "de.surfice", version := "0.1-SNAPSHOT", - scalaVersion := "2.11.7", + scalaVersion := "2.11.8", scalacOptions ++= Seq("-deprecation","-unchecked","-feature","-language:implicitConversions","-Xlint"), autoCompilerPlugins := true, //addCompilerPlugin("com.lihaoyi" %% "acyclic" % "0.1.2"), @@ -25,12 +26,12 @@ lazy val angulate2 = project.in(file(".")). settings(publishingSettings: _*). settings( name := "angulate2", - addCompilerPlugin("org.scalamacros" % "paradise" % "2.0.1" cross CrossVersion.full), + addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full), libraryDependencies ++= Seq( "org.scala-lang" % "scala-reflect" % scalaVersion.value, "org.scala-js" %%% "scalajs-dom" % "0.8.0", - //"de.surfice" %%% "smacrotools-sjs" % "0.1-SNAPSHOT", - "de.surfice" %%% "sjsx" % "0.2-SNAPSHOT", + "de.surfice" %%% "smacrotools-sjs" % "0.1-SNAPSHOT", + "de.surfice" %%% "sjsx" % sjsxVersion, //"be.doeraene" %%% "scalajs-jquery" % "0.8.0" % "provided", "de.surfice" %%% "scalajs-rxjs" % "0.1-SNAPSHOT" ) @@ -45,8 +46,7 @@ lazy val plugin = project. description := "sbt plugin for angulate2 (Angular2 bindings for Scala.js)", sbtPlugin := true, scalaVersion := "2.10.5", - //addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.5"), - addSbtPlugin("de.surfice" % "sbt-sjsx" % "0.2-SNAPSHOT"), + addSbtPlugin("de.surfice" % "sbt-sjsx" % sjsxVersion), sourceGenerators in Compile += Def.task { val file = (sourceManaged in Compile).value / "Version.scala" IO.write(file, diff --git a/plugin/src/main/scala/de/surfice/angulate2/sbtplugin/Angulate2Plugin.scala b/plugin/src/main/scala/de/surfice/angulate2/sbtplugin/Angulate2Plugin.scala index 346265f..7adf654 100644 --- a/plugin/src/main/scala/de/surfice/angulate2/sbtplugin/Angulate2Plugin.scala +++ b/plugin/src/main/scala/de/surfice/angulate2/sbtplugin/Angulate2Plugin.scala @@ -15,7 +15,7 @@ import sjsx.sbtplugin.SJSXPlugin object Angulate2Plugin extends sbt.AutoPlugin { - import SJSXPlugin._ + import SJSXPlugin.autoImport._ override def requires = ScalaJSPlugin && SJSXPlugin @@ -23,10 +23,10 @@ object Angulate2Plugin extends sbt.AutoPlugin { override def projectSettings = Seq( ngBootstrap := None, - addCompilerPlugin("org.scalamacros" % "paradise" % "2.0.1" cross CrossVersion.full), + addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full), libraryDependencies += DepBuilder.toScalaJSGroupID("de.surfice") %%% "angulate2" % Version.angulateVersion, - SJSXPlugin.sjsxSnippets <++= (ngBootstrap map boostrap), - SJSXPlugin.sjsxDeps <++= ngBootstrap map ( d => if(d.isDefined) Seq(SJSXDependency("ng.platform.browser","angular2/platform/browser")) else Nil ) + sjsxSnippets <++= (ngBootstrap map boostrap), + sjsxDeps <++= ngBootstrap map ( d => if(d.isDefined) Seq(SJSXDependency("ng.platform.browser","angular2/platform/browser")) else Nil ) ) private def boostrap(comp: Option[String]): Seq[SJSXSnippet] = comp map {comp => diff --git a/src/main/scala/angulate2/core/annotations.scala b/src/main/scala/angulate2/core/annotations.scala index 577595f..951b771 100644 --- a/src/main/scala/angulate2/core/annotations.scala +++ b/src/main/scala/angulate2/core/annotations.scala @@ -13,4 +13,9 @@ import scala.scalajs.js.annotation.JSName @JSName("ng.core.Component") @js.native @SJSXRequire("angular2/core","ng.core") -class Component(config: js.Object) extends js.Object +class Component(options: js.Object) extends js.Object + +@JSName("ng.core.Injectable") +@js.native +@SJSXRequire("angular2/core","ng.core") +class Injectable(options: js.Object) extends js.Object diff --git a/src/main/scala/angulate2/router/RouteConfig.scala b/src/main/scala/angulate2/router/RouteConfig.scala index c88b3d4..04ea55c 100644 --- a/src/main/scala/angulate2/router/RouteConfig.scala +++ b/src/main/scala/angulate2/router/RouteConfig.scala @@ -5,10 +5,13 @@ // Distributed under the MIT License (see included LICENSE file) package angulate2.router +import sjsx.SJSXRequire + import scala.annotation.StaticAnnotation import scala.scalajs.js import scala.scalajs.js.annotation.JSName +@SJSXRequire("angular2/router","ng.router") class RouteConfig(defs: RouteDefinition*) extends StaticAnnotation object RouteConfig { diff --git a/src/main/scala/angulate2/router/dependencies.scala b/src/main/scala/angulate2/router/dependencies.scala index 769b970..7666d85 100644 --- a/src/main/scala/angulate2/router/dependencies.scala +++ b/src/main/scala/angulate2/router/dependencies.scala @@ -5,6 +5,10 @@ // Distributed under the MIT License (see included LICENSE file) package angulate2.router +import sjsx.SJSXRequire + +import scala.scalajs.js.annotation.JSName + /** * This trait serves as token to inject all directives required for the router service. */ @@ -13,6 +17,8 @@ trait ROUTER_DIRECTIVES /** * This trait serves as token to inject all dependencies required for the router service. */ +@SJSXRequire("angular2/core","ng.router") +@JSName("ng.router.ROUTER_PROVIDERS") trait ROUTER_PROVIDERS /**