This is an automated email from the ASF dual-hosted git repository.
nkruber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink-training.git
The following commit(s) were added to refs/heads/master by this push:
new 65cde79 [FLINK-24022] Change how to enable Scala and use in CI
65cde79 is described below
commit 65cde7910e5bff6283eef7ea536fde3ea5d4c9d4
Author: Nico Kruber <[email protected]>
AuthorDate: Fri Aug 27 12:23:50 2021 +0200
[FLINK-24022] Change how to enable Scala and use in CI
---
.travis.yml | 2 +-
README.md | 14 +++++++-------
build.gradle | 4 +++-
gradle.properties | 3 +++
4 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 41126f9..cc4e815 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -4,7 +4,7 @@ jdk:
- openjdk11
script:
- - ./gradlew build --scan --stacktrace
+ - ./gradlew build --scan --stacktrace -Porg.gradle.project.enable_scala=true
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
diff --git a/README.md b/README.md
index 9c60124..5d40526 100644
--- a/README.md
+++ b/README.md
@@ -111,14 +111,14 @@ If you are in China, we recommend configuring the Maven
repository to use a mirr
The exercises in this project are also available in Scala but due to a couple
of reported problems from non-Scala users, we decided to disable these by
-default. You can re-enable all Scala exercises and solutions by uncommenting
-this section in our [`build.gradle`](build.gradle) file:
+default. You can re-enable all Scala exercises and solutions adapting the
+[`gradle.properties`](gradle.properties) file like this:
-```groovy
-subprojects {
- //...
- apply plugin: 'scala' // optional; uncomment if needed
-}
+```properties
+#...
+
+# Scala exercises can be enabled by setting this to true
+org.gradle.project.enable_scala = true
```
You can also selectively apply this plugin in a single subproject if desired.
diff --git a/build.gradle b/build.gradle
index 3117591..93323ee 100644
--- a/build.gradle
+++ b/build.gradle
@@ -43,7 +43,9 @@ allprojects {
subprojects {
apply plugin: 'java'
- // apply plugin: 'scala' // optional; uncomment if needed
+ if (project.properties['org.gradle.project.enable_scala'] == 'true') {
+ apply plugin: 'scala'
+ }
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'checkstyle'
apply plugin: 'eclipse'
diff --git a/gradle.properties b/gradle.properties
index 09a00db..6be414c 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,2 +1,5 @@
org.gradle.caching = true
org.gradle.parallel = true
+
+# Scala exercises can be enabled by setting this to true
+org.gradle.project.enable_scala = false