Skip to content

Scala 2.12 #11

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

Merged
merged 1 commit into from
Dec 19, 2016
Merged
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
Scala 2.12
  • Loading branch information
Starzu committed Dec 19, 2016
commit e0b1bda4f86b89d4e39c5983da3b94b8fc7da0b6
23 changes: 21 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
language: scala
dist: trusty

jdk: oraclejdk8
scala:
- 2.11.8
- 2.12.1

before_script:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- sleep 3 # give xvfb some time to start
# Instal google-chrome
- export CHROME_BIN=/usr/bin/google-chrome
- sudo apt-get update
- sudo apt-get install -y libappindicator1 fonts-liberation
- wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
- sudo dpkg -i google-chrome*.deb
# Install Selenium chromedriver
- wget http://chromedriver.storage.googleapis.com/2.25/chromedriver_linux64.zip
- unzip chromedriver_linux64.zip -d selenium-bin
- export PATH=$PWD/selenium-bin:$PATH

script:
- sbt ++$TRAVIS_SCALA_VERSION test
- cd example && sbt ++$TRAVIS_SCALA_VERSION compile
- sbt ++$TRAVIS_SCALA_VERSION "set (jsEnv in Test := new org.scalajs.jsenv.selenium.SeleniumJSEnv(org.scalajs.jsenv.selenium.Chrome))" test
- sbt ++$TRAVIS_SCALA_VERSION publishLocal
# - cd example && sbt ++$TRAVIS_SCALA_VERSION compile
16 changes: 10 additions & 6 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@

name := "udash-jquery"

version := "1.0.0"
version := "1.0.1"
organization := "io.udash"
scalaVersion := "2.11.8"
scalaVersion := "2.12.1"
crossScalaVersions := Seq("2.11.8", "2.12.1")
scalacOptions in ThisBuild ++= Seq(
"-feature",
"-deprecation",
Expand All @@ -15,14 +17,16 @@ scalacOptions in ThisBuild ++= Seq(
"-Xlint:_,-missing-interpolator,-adapted-args"
)

jsEnv in Test := new org.scalajs.jsenv.selenium.SeleniumJSEnv(org.scalajs.jsenv.selenium.Firefox)

libraryDependencies ++= Seq(
"org.scala-js" %%% "scalajs-dom" % "0.9.0",
"org.scalatest" %%% "scalatest" % "3.0.0-M15" % Test,
"com.lihaoyi" %%% "scalatags" % "0.5.4" % Test
"org.scala-js" %%% "scalajs-dom" % "0.9.1",
"org.scalatest" %%% "scalatest" % "3.0.1" % Test,
"com.lihaoyi" %%% "scalatags" % "0.6.2" % Test
)

jsDependencies +=
"org.webjars" % "jquery" % "2.2.3" / "2.2.3/jquery.js" minified "2.2.3/jquery.min.js"
"org.webjars" % "jquery" % "2.2.4" / "2.2.4/jquery.js" minified "2.2.4/jquery.min.js"

requiresDOM in Test := true
persistLauncher in Test := false
Expand Down
8 changes: 1 addition & 7 deletions example/build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name := "jquery-demo"

version in ThisBuild := "1.0.0-SNAPSHOT"
version in ThisBuild := "1.0.1-SNAPSHOT"
scalaVersion in ThisBuild := "2.11.8"
organization in ThisBuild := "io.udash"
crossPaths in ThisBuild := false
Expand All @@ -16,12 +16,6 @@ scalacOptions in ThisBuild ++= Seq(
"-Xlint:_,-missing-interpolator,-adapted-args"
)

//TODO: remove it after scala-js-jquery 1.0 release
externalResolvers in ThisBuild := Seq(
DefaultMavenRepository,
Resolver.file("local", file(System.getProperty("user.home") + "/.ivy2/local"))(Resolver.ivyStylePatterns)
)

val generatedDir = file("generated")
val `jquery-demo` = project.in(file(".")).enablePlugins(ScalaJSPlugin)
.settings(
Expand Down
4 changes: 2 additions & 2 deletions example/project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._
import sbt._

object Dependencies extends Build {
val udashCoreVersion = "0.1.1"
val udashJQueryVersion = "1.0.0"
val udashCoreVersion = "0.4.0"
val udashJQueryVersion = "1.0.1"

val deps = Def.setting(Seq[ModuleID](
"io.udash" %%% "udash-core-frontend" % udashCoreVersion,
Expand Down
2 changes: 1 addition & 1 deletion example/project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version = 0.13.11
sbt.version = 0.13.13
2 changes: 1 addition & 1 deletion example/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
logLevel := Level.Warn
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.8")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.13")
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,9 @@ import org.scalajs.dom.Element

object ErrorViewPresenter extends DefaultViewPresenterFactory[IndexState.type](() => new ErrorView)

class ErrorView extends View {
class ErrorView extends FinalView {
import scalatags.JsDom.all._

private val content = h3(
"URL not found!"
).render

override def getTemplate: Element = content

override def renderChild(view: View): Unit = {}
override def getTemplate: Modifier =
h3("URL not found!")
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ package io.udash.demos.jquery.views
import io.udash._
import org.scalajs.dom.{Element, Event}

abstract class FunctionView extends View {
abstract class FunctionView extends FinalView {
import scalatags.JsDom.all._

protected val content: Element
protected val script: () => Any

override def getTemplate: Element = {
override def getTemplate: Modifier =
div(
content,
button(
Expand All @@ -18,8 +18,5 @@ abstract class FunctionView extends View {
false
})
)("Run script")
).render
}

override def renderChild(view: View): Unit = {}
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import org.scalajs.dom.Element

object IndexViewPresenter extends DefaultViewPresenterFactory[IndexState.type](() => new IndexView)

class IndexView extends View {
class IndexView extends FinalView {
import Context._

import scalatags.JsDom.all._
Expand All @@ -29,9 +29,7 @@ class IndexView extends View {
li(a(href := OnOneOffState.url)(".on() & .one() & .off()")),
li(a(href := OffsetPositionState.url)(".offset() & .position()"))
)
).render
)

override def getTemplate: Element = content

override def renderChild(view: View): Unit = {}
override def getTemplate: Modifier = content
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ class RootView extends View {
private val content = div(
a(href := IndexState.url)(h1("jquery-demo")),
child
).render
)

override def getTemplate: Element = content
override def getTemplate: Modifier = content

override def renderChild(view: View): Unit = {
import io.udash.wrappers.jquery._
val newChild = view.getTemplate
jQ(child).replaceWith(newChild)
child = newChild

jQ(child).children().remove()
view.getTemplate.applyTo(child)
}
}
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version = 0.13.11
sbt.version = 0.13.13
4 changes: 3 additions & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
logLevel := Level.Warn

addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.9")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.13")

libraryDependencies += "org.scala-js" %% "scalajs-env-selenium" % "0.1.3"