Skip to content

Commit 131bf2c

Browse files
committed
Add Scala 2.13.16 support
- update build.sbt and github actions - update release candidate, sonarcloud DAFFODIL-2152
1 parent 7028bec commit 131bf2c

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

.github/workflows/main.yml

+8-3
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
matrix:
4141
java_distribution: [ temurin ]
4242
java_version: [ 8, 11, 17, 21 ]
43-
scala_version: [ 2.12.20 ]
43+
scala_version: [ 2.13.16, 2.12.20 ]
4444
os: [ ubuntu-22.04, windows-2022, macos-14 ]
4545
exclude:
4646
# only run macos on java 17
@@ -90,7 +90,7 @@ jobs:
9090
SONARSCAN: ${{
9191
matrix.os == 'ubuntu-22.04' &&
9292
matrix.java_version == '17' &&
93-
matrix.scala_version == '2.12.20' &&
93+
matrix.scala_version == '2.13.16' &&
9494
github.event_name == 'push' &&
9595
github.repository == 'apache/daffodil' &&
9696
github.ref == 'refs/heads/main'
@@ -215,6 +215,11 @@ jobs:
215215
- name: Prepare for SonarCloud Scan
216216
if: ${{ env.SONARSCAN == 'true' }}
217217
run: |
218+
SCALA_VERSION=${{ matrix.scala_version }}
219+
SCALA_BINARY_VERSION=$(echo "$SCALA_VERSION" | cut -d. -f1,2)
220+
# NOTE: This is needed by .sonar-project.properties so it can
221+
# have the right reportPath per version
222+
echo "SCALA_BINARY_VERSION=$SCALA_BINARY_VERSION" >> $GITHUB_ENV
218223
$SBT coverageReport
219224
find . -name scoverage.xml -exec sed -i 's#/home/runner/work/daffodil/daffodil#/github/workspace#g' {} +
220225
@@ -236,7 +241,7 @@ jobs:
236241
matrix:
237242
java_distribution: [ temurin ]
238243
java_version: [ 17 ]
239-
scala_version: [ 2.12.20 ]
244+
scala_version: [ 2.13.16 ]
240245
os: [ ubuntu-22.04 ]
241246
runs-on: ${{ matrix.os }}
242247
env:

.sonar-project.properties

+2-1
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,5 @@ sonar.java.test.binaries=target/**/test-classes
3535
sonar.java.libraries=../lib_managed/jars/**/*.jar
3636
sonar.java.test.libraries=../lib_managed/jars/**/*.jar
3737

38-
sonar.scala.coverage.reportPaths=target/scala-2.12/scoverage-report/scoverage.xml
38+
# SCALA_BINARY_VERSION (major.minor) must be provided externally
39+
sonar.scala.coverage.reportPaths=target/scala-${SCALA_BINARY_VERSION}/scoverage-report/scoverage.xml

build.sbt

+2-2
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,8 @@ val minSupportedJavaVersion: String =
238238
lazy val commonSettings = Seq(
239239
organization := "org.apache.daffodil",
240240
version := "4.0.0-SNAPSHOT",
241-
scalaVersion := "2.12.20",
242-
crossScalaVersions := Seq("2.12.20"),
241+
scalaVersion := "2.13.16",
242+
crossScalaVersions := Seq("2.13.16", "2.12.20"),
243243
scalacOptions ++= buildScalacOptions(scalaVersion.value),
244244
Test / scalacOptions ++= buildTestScalacOptions(scalaVersion.value),
245245
Compile / compile / javacOptions ++= buildJavacOptions(),

containers/release-candidate/src/daffodil-release-candidate

+2-1
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ pushd $REPO_ROOT/$DAFFODIL_CODE_REPO &> /dev/null
234234
case $PROJECT_REPO in
235235
"daffodil" | "daffodil-sbt")
236236
VERSION=$(grep 'version :=' build.sbt | cut -d\" -f2)
237+
SCALA_BINARY_VERSION=$(grep 'scalaVersion :=' build.sbt | cut -d\" -f2 | cut -d. -f1,2)
237238
;;
238239
"daffodil-vscode")
239240
VERSION=$(grep '"version"' package.json | cut -d\" -f4)
@@ -316,7 +317,7 @@ case $PROJECT_REPO in
316317
rm -rf $DAFFODIL_DOCS_DIR
317318
mkdir -p $DAFFODIL_DOCS_DIR/{javadoc,scaladoc}/
318319
cp -R target/javaunidoc/* $DAFFODIL_DOCS_DIR/javadoc/
319-
cp -R target/scala-2.12/unidoc/* $DAFFODIL_DOCS_DIR/scaladoc/
320+
cp -R target/scala-$SCALA_BINARY_VERSION/unidoc/* $DAFFODIL_DOCS_DIR/scaladoc/
320321
cp target/tunables.md $DAFFODIL_SITE_DIR/site/
321322

322323
echo "Installing Site Tutorials..."

0 commit comments

Comments
 (0)