Skip to content
This repository has been archived by the owner on Apr 23, 2019. It is now read-only.

Commit

Permalink
Upgrade branch 2.7.x using TemplateControl (#65)
Browse files Browse the repository at this point in the history
```
Updated with template-control on 2018-11-16T14:25:16.065Z
  **build.sbt:
    libraryDependencies += "org.scalatestplus.play" %% "scalatestplus-play" % "4.0.0-RC1" % Test
  **/plugins.sbt:
    addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.7.0-RC3")
  **build.gradle:
    def playVersion = "2.7.0-RC3"
  **build.gradle:
        playTest "org.scalatestplus.play:scalatestplus-play_$scalaVersion:4.0.0-RC1"
  .travis.yml:
    - openjdk10
  .travis.yml:
          jdk: openjdk10

```
  • Loading branch information
octonato committed Nov 28, 2018
1 parent 185fc81 commit a775fe5
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 56 deletions.
46 changes: 18 additions & 28 deletions .travis.yml
@@ -1,47 +1,37 @@
language: scala
scala:
# When updating Scala versions, also check the excludes
# in build matrix below.
- 2.11.12
- 2.12.6
- 2.12.7
jdk:
- oraclejdk8
- oraclejdk9
- oraclejdk10
- oraclejdk11
- oraclejdk8
- openjdk11
env:
matrix:
- SCRIPT=scripts/test-sbt
- SCRIPT=scripts/test-gradle
script:
- $SCRIPT
- $SCRIPT
cache:
directories:
- "$HOME/.ivy2/cache"
- "$HOME/.gradle/caches"
- "$HOME/.ivy2/cache"
- "$HOME/.gradle/caches"
before_cache:
- rm -rf $HOME/.ivy2/cache/com.typesafe.play/*
- rm -rf $HOME/.ivy2/cache/scala_*/sbt_*/com.typesafe.play/*
- find $HOME/.ivy2/cache -name "ivydata-*.properties" -print0 | xargs -n10 -0 rm
- rm -rf $HOME/.ivy2/cache/com.typesafe.play/*
- rm -rf $HOME/.ivy2/cache/scala_*/sbt_*/com.typesafe.play/*
- find $HOME/.ivy2/cache -name "ivydata-*.properties" -print0 | xargs -n10 -0 rm

# Exclude some combinations from build matrix. See:
# https://docs.travis-ci.com/user/customizing-the-build/#Build-Matrix
matrix:
exclude:
- scala: 2.11.12
jdk: oraclejdk9
- scala: 2.11.12
jdk: oraclejdk10
- scala: 2.11.12
jdk: oraclejdk11
fast_finish: true
allow_failures:
# We should allow failures here since Java 11 removed some modules including
# java.xml.bind which we are adding when running with Java 9+. For more details
# see http://openjdk.java.net/jeps/320
#
# Play already has a fix for that, but it needs to be backported and released
# for 2.6.x: https://github.com/playframework/playframework/pull/8382
- jdk: oraclejdk11
# Current release of Gradle still does not supports Play 2.7.x releases
# As soon as there is a release of Gradle that fixes that, we can then
# remove this allowed failure.
- env: SCRIPT=scripts/test-gradle
# Java 11 is still not fully supported. It is good that we are already
# testing our sample applications to better discover possible problems
# but we can allow failures here too.
- jdk: openjdk11

# See https://blog.travis-ci.com/2014-03-13-slack-notifications/
# created with travis encrypt command line tool
Expand Down
8 changes: 4 additions & 4 deletions app/controllers/ScalaTicker.scala
Expand Up @@ -12,14 +12,14 @@ trait ScalaTicker {

def stringSource: Source[String, _] = {
val df: DateTimeFormatter = DateTimeFormatter.ofPattern("HH mm ss")
val tickSource = Source.tick(0 millis, 100 millis, "TICK")
val s = tickSource.map((tick) => df.format(ZonedDateTime.now()))
val tickSource = Source.tick(0.millis, 100.millis, "TICK")
val s = tickSource.map(_ => df.format(ZonedDateTime.now()))
s
}

def jsonSource: Source[JsValue, _] = {
val tickSource = Source.tick(0 millis, 100 millis, "TICK")
val s = tickSource.map((tick) => Json.toJson(ZonedDateTime.now))
val tickSource = Source.tick(0.millis, 100.millis, "TICK")
val s = tickSource.map(_ => Json.toJson(ZonedDateTime.now))
s
}

Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Expand Up @@ -3,7 +3,7 @@ plugins {
id 'idea'
}

def playVersion = "2.6.20"
def playVersion = "2.7.0-RC3"
def scalaVersion = System.getProperty("scala.binary.version", /* default = */ "2.12")

model {
Expand All @@ -26,7 +26,7 @@ dependencies {
play "com.typesafe.play:play-logback_$scalaVersion:$playVersion"

playTest "com.typesafe.play:play-ahc-ws_$scalaVersion:$playVersion"
playTest "org.scalatestplus.play:scalatestplus-play_$scalaVersion:3.1.2"
playTest "org.scalatestplus.play:scalatestplus-play_$scalaVersion:4.0.0-RC1"
}

repositories {
Expand Down
12 changes: 8 additions & 4 deletions build.sbt
Expand Up @@ -2,13 +2,17 @@ name := "play-scala-streaming-example"

version := "2.6.x"

scalaVersion := "2.12.6"

crossScalaVersions := Seq("2.11.12", "2.12.4")
scalaVersion := "2.12.7"

lazy val root = (project in file(".")).enablePlugins(PlayScala)

libraryDependencies += guice

libraryDependencies += ws % Test
libraryDependencies += "org.scalatestplus.play" %% "scalatestplus-play" % "3.1.2" % Test
libraryDependencies += "org.scalatestplus.play" %% "scalatestplus-play" % "4.0.0-RC1" % Test

scalacOptions ++= Seq(
"-feature",
"-deprecation",
"-Xfatal-warnings"
)
7 changes: 7 additions & 0 deletions conf/application.conf
Expand Up @@ -6,3 +6,10 @@ play.filters.headers {
frameOptions = "SAMEORIGIN"
contentSecurityPolicy = "connect-src 'self'"
}

play.filters.enabled += play.filters.csp.CSPFilter

play.filters.csp.directives {
connect-src = "'self'"
default-src = "'self'"
}
2 changes: 1 addition & 1 deletion project/plugins.sbt
@@ -1,2 +1,2 @@
// Use the Play sbt plugin for Play projects
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.6.20")
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.7.0-RC3")
13 changes: 0 additions & 13 deletions scripts/script-helper

This file was deleted.

5 changes: 3 additions & 2 deletions scripts/test-gradle
@@ -1,13 +1,14 @@
#!/usr/bin/env bash

. "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/script-helper"
set -e
set -o pipefail

# Using cut because TRAVIS_SCALA_VERSION is the full Scala
# version (for example 2.12.4), but Gradle expects just the
# binary version (for example 2.12)
scala_binary_version=$(echo $TRAVIS_SCALA_VERSION | cut -c1-4)

echo "+------------------------------+"
echo "| Executing tests using Gradle |"
echo "| Executing tests using Gradle |"
echo "+------------------------------+"
./gradlew -Dscala.binary.version=$scala_binary_version check -i --stacktrace
5 changes: 3 additions & 2 deletions scripts/test-sbt
@@ -1,8 +1,9 @@
#!/usr/bin/env bash

. "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/script-helper"
set -e
set -o pipefail

echo "+----------------------------+"
echo "| Executing tests using sbt |"
echo "| Executing tests using sbt |"
echo "+----------------------------+"
sbt ++$TRAVIS_SCALA_VERSION test

0 comments on commit a775fe5

Please sign in to comment.