This is an automated email from the ASF dual-hosted git repository.

markusthoemmes pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openwhisk.git


The following commit(s) were added to refs/heads/master by this push:
     new 0edfcc8  Allow build to use either Scala 2.12 or 2.13 and test that in 
CI. (#4867)
0edfcc8 is described below

commit 0edfcc86b19207ef773d0b0eb1fe9fb275500f49
Author: Markus Thömmes <markusthoem...@me.com>
AuthorDate: Fri Mar 27 09:02:10 2020 +0100

    Allow build to use either Scala 2.12 or 2.13 and test that in CI. (#4867)
    
    Running a build with the `OW_SCALA_VERSION` environment variable set now 
allows you to switch between building with 2.12 and 2.13 to allow for a smooth 
migration in downstream systems to 2.13 and to allow us to try it out "in the 
wild" more easily.
---
 .travis.yml     |  3 +++
 settings.gradle | 25 ++++++++++++++++++++-----
 2 files changed, 23 insertions(+), 5 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 7d9cfd6..1e45b61 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -71,6 +71,9 @@ install:
 jobs:
   include:
     - script:
+        - TERM=dumb OW_SCALA_VERSION=2.13 ./gradlew :tests:compileTestScala
+      name: "Scala 2.13 compilation"
+    - script:
         - ./tools/travis/runUnitTests.sh
         - ./tools/travis/checkAndUploadLogs.sh unit db
       name: "Unit Tests"
diff --git a/settings.gradle b/settings.gradle
index 501293f..df0ee97 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -34,11 +34,26 @@ include 'tools:admin'
 
 rootProject.name = 'openwhisk'
 
-gradle.ext.scala = [
-    version: '2.12.10',
-    depVersion: '2.12',
-    compileFlags: ['-feature', '-unchecked', '-deprecation', 
'-Xfatal-warnings', '-Ywarn-unused-import']
-]
+
+def scalaVersion = System.getenv().getOrDefault('OW_SCALA_VERSION', '2.12')
+
+if (scalaVersion == '2.12') {
+    println("Build using Scala 2.12")
+    gradle.ext.scala = [
+            version     : '2.12.10',
+            depVersion  : '2.12',
+            compileFlags: ['-feature', '-unchecked', '-deprecation', 
'-Xfatal-warnings', '-Ywarn-unused-import']
+    ]
+} else {
+    println("Build using Scala 2.13")
+    gradle.ext.scala = [
+            version     : '2.13.1',
+            depVersion  : '2.13',
+            // We can't use fatal warnings yet because there are deprecated 
things in 2.13 that are not fixable
+            // in 2.12.
+            compileFlags: ['-feature', '-unchecked', '-deprecation']
+    ]
+}
 
 gradle.ext.scalafmt = [
     version: '1.5.0',

Reply via email to