Skip to content

Commit

Permalink
Upgrade to sjsx-0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
jokade committed Jun 21, 2016
1 parent 67bfc13 commit c581f20
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 11 deletions.
12 changes: 6 additions & 6 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -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"),
Expand All @@ -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"
)
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ import sjsx.sbtplugin.SJSXPlugin


object Angulate2Plugin extends sbt.AutoPlugin {
import SJSXPlugin._
import SJSXPlugin.autoImport._

override def requires = ScalaJSPlugin && SJSXPlugin

lazy val ngBootstrap = settingKey[Option[String]]("Name of the Component to bootstrap")

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 =>
Expand Down
7 changes: 6 additions & 1 deletion src/main/scala/angulate2/core/annotations.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions src/main/scala/angulate2/router/RouteConfig.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 6 additions & 0 deletions src/main/scala/angulate2/router/dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand All @@ -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

/**
Expand Down

0 comments on commit c581f20

Please sign in to comment.