Skip to content
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

Add a JDK11 and JDK12 build to the Travis matrix #1953

Merged
merged 10 commits into from
Jul 21, 2019
21 changes: 8 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,34 @@
language: scala

dist: trusty

sudo: false

scala:
- 2.11.11
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like 2.11.12 is a thing?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy to version bump that later but this has been languishing awhile, let's not hold it up.

- 2.12.6

- 2.12.8
cache:
directories:
- '$HOME/node_modules'
- $HOME/.ivy2

services:
- mongodb

jdk:
- oraclejdk8

- openjdk8
matrix:
include:
- scala: 2.12.8
jdk: openjdk11
- scala: 2.12.8
jdk: openjdk12
script: ./travis.sh

branches:
only:
- master
- /^release-branch-.*$/

node_js:
- "4.1"

before_script:
- "cd web/webkit"
- "npm install"
- "cd -"

notifications:
webhooks:
urls:
Expand Down
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ homepage in ThisBuild := Some(url("http://www.liftweb.net"))
licenses in ThisBuild += ("Apache License, Version 2.0", url("http://www.apache.org/licenses/LICENSE-2.0.txt"))
startYear in ThisBuild := Some(2006)
organizationName in ThisBuild := "WorldWide Conferencing, LLC"
scalaVersion in ThisBuild := "2.12.6"
crossScalaVersions in ThisBuild := Seq("2.12.6", "2.11.11")
scalaVersion in ThisBuild := "2.12.8"
crossScalaVersions in ThisBuild := Seq("2.12.8", "2.11.11")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto re: 2.11.12.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy to version bump that later but this has been languishing awhile, let's not hold it up.


libraryDependencies in ThisBuild ++= Seq(specs2, specs2Matchers, specs2Mock, scalacheck, scalatest)

Expand Down
12 changes: 6 additions & 6 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ object Dependencies {
lazy val jetty6 = "org.mortbay.jetty" % "jetty" % "6.1.26" % "test"
lazy val jwebunit = "net.sourceforge.jwebunit" % "jwebunit-htmlunit-plugin" % "2.5" % "test"
lazy val mockito_all = "org.mockito" % "mockito-all" % "1.9.0" % "test"
lazy val scalacheck = "org.specs2" %% "specs2-scalacheck" % "3.8.6" % "test"
lazy val specs2 = "org.specs2" %% "specs2-core" % "3.8.6" % "test"
lazy val specs2Prov = "org.specs2" %% "specs2-core" % "3.8.6" % "provided"
lazy val specs2Matchers = "org.specs2" %% "specs2-matcher-extra" % "3.8.6" % "test"
lazy val specs2MatchersProv = "org.specs2" %% "specs2-matcher-extra" % "3.8.6" % "provided"
lazy val specs2Mock = "org.specs2" %% "specs2-mock" % "3.8.6" % "test"
lazy val scalacheck = "org.specs2" %% "specs2-scalacheck" % "3.8.9" % "test"
lazy val specs2 = "org.specs2" %% "specs2-core" % "3.8.9" % "test"
lazy val specs2Prov = "org.specs2" %% "specs2-core" % "3.8.9" % "provided"
lazy val specs2Matchers = "org.specs2" %% "specs2-matcher-extra" % "3.8.9" % "test"
lazy val specs2MatchersProv = "org.specs2" %% "specs2-matcher-extra" % "3.8.9" % "provided"
lazy val specs2Mock = "org.specs2" %% "specs2-mock" % "3.8.9" % "test"
lazy val scalatest = "org.scalatest" %% "scalatest" % "3.0.1" % "test"
lazy val junit = "junit" % "junit" % "4.8.2" % "test"
}
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class HtmlNormalizerSpec extends Specification with XmlMatchers with Mockito {
true
)

List("testJs1",
List("testJs1",
"testJs2",
"testJs3",
"testJs4",
Expand Down Expand Up @@ -153,7 +153,7 @@ class HtmlNormalizerSpec extends Specification with XmlMatchers with Mockito {

js.toJsCmd must be matching("""(?s)\Qlift.onEvent("lift-event-js-\E[^"]+\Q","event",function(event) {doStuff;});
|lift.onEvent("hello","event",function(event) {doStuff2;});
|lift.onEvent("lift-event-js-\E[^"]+\Q","event",function(event) {doStuff3;});\E""".stripMargin('|').lines.mkString("\n").r
|lift.onEvent("lift-event-js-\E[^"]+\Q","event",function(event) {doStuff3;});\E""".stripMargin('|').linesIterator.mkString("\n").r
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This turns out to be because of this guy: scala/bug#11125

A note from that issue:

note that it isn't safe to rely on the compiler to catch bad uses of .lines, you want to search your source code and find all of them

yes, often the compiler will catch it, e.g. s.lines.toVector fails to compile because Java's Stream doesn't have toVector

but more devious is something like s.lines.filter(...) == .... Java's Stream has filter, and == isn't type-safe, so if you're lucky you'll get a "are unrelated: they will most likely never compare equal" warning ... if you're lucky... and if you're lucky enough to spot the warning in your code's big pile of warnings it already generates that you tune out now...

I guess a Scalafix rewrite could help here, and wouldn't have false positives if you are using .lines method on something other than a String

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oy vey.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I just realized this probably means we've got to hunt all uses of lines down. ffffff

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels like I can pick this particular issue up in the 2.13 PR, since I think that'll catch issues? Not sure.

)
}

Expand All @@ -179,7 +179,7 @@ class HtmlNormalizerSpec extends Specification with XmlMatchers with Mockito {
js.toJsCmd must be matching("""(?s)\Qlift.onEvent("lift-event-js-\E[^"]+\Q","click",function(event) {doStuff; event.preventDefault();});
|lift.onEvent("hello","submit",function(event) {doStuff2; event.preventDefault();});
|lift.onEvent("hello2","click",function(event) {doStuff3; event.preventDefault();});
|lift.onEvent("lift-event-js-\E[^"]+\Q","submit",function(event) {/doStuff4; event.preventDefault();});\E""".stripMargin('|').lines.mkString("\n").r
|lift.onEvent("lift-event-js-\E[^"]+\Q","submit",function(event) {/doStuff4; event.preventDefault();});\E""".stripMargin('|').linesIterator.mkString("\n").r
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ object LiftJavaScriptSpec extends Specification {
}

def formatjs(line:String):String = formatjs(line :: Nil)
def formatjs(lines:List[String]):String = lines.map { _.stripMargin.lines.toList match {
def formatjs(lines:List[String]):String = lines.map { _.stripMargin.linesIterator.toList match {
case init :+ last => (init.map(_ + " ") :+ last).mkString
case Nil => ""
}}.mkString("\n")
Expand Down