Skip to content

Commit 35b97ae

Browse files
authored
Merge pull request #50 from aml-org/java21-2024
W-14661042 - Java21 support related changes
2 parents 37f15dd + 0e0aa0e commit 35b97ae

File tree

13 files changed

+39
-16
lines changed

13 files changed

+39
-16
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
FROM ghcr.io/aml-org/amf-ci-tools-base-image:1.3.4
1+
FROM ghcr.io/aml-org/amf-ci-tools-base-image:1.4.0

Jenkinsfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pipeline {
2929
BUILD_NUMBER = "${env.BUILD_NUMBER}"
3030
BRANCH_NAME = "${env.BRANCH_NAME}"
3131
NPM_TOKEN = credentials('npm-mulesoft')
32-
CURRENT_VERSION = sh(script:"cat dependencies.properties | grep \"version\" | cut -d '=' -f 2", returnStdout: true)
32+
CURRENT_VERSION = sh(script: "cat dependencies.properties | grep \"version\" | cut -d '=' -f 2", returnStdout: true)
3333
}
3434
stages {
3535
stage('Test') {
@@ -57,7 +57,9 @@ pipeline {
5757
}
5858
stage('Publish') {
5959
when {
60-
branch 'master'
60+
anyOf {
61+
branch 'master'
62+
}
6163
}
6264
steps {
6365
wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'XTerm']) {

build.sbt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import sbtcrossproject.CrossPlugin.autoImport.crossProject
22
import sbtsonar.SonarPlugin.autoImport.sonarProperties
33

4-
ThisBuild / version := getVersion(2, 0)
4+
ThisBuild / version := getVersion(2, 1)
55
ThisBuild / scalacOptions ++= Seq("-feature")
6-
ThisBuild / scalaVersion := "2.12.15"
6+
ThisBuild / scalaVersion := "2.12.20"
77

88
lazy val common = crossProject(JSPlatform, JVMPlatform)
99
.in(file("."))
@@ -20,7 +20,8 @@ lazy val common = crossProject(JSPlatform, JVMPlatform)
2020
)
2121
.jvmSettings(libraryDependencies += "org.scala-js" %% "scalajs-stubs" % "1.1.0" % "provided")
2222
.jsSettings(
23-
scalaJSLinkerConfig ~= { _.withModuleKind(ModuleKind.CommonJSModule) }
23+
libraryDependencies += "org.scala-js" %%% "scalajs-java-securerandom" % "1.0.0",
24+
scalaJSLinkerConfig ~= { _.withModuleKind(ModuleKind.CommonJSModule) }
2425
)
2526
.settings(AutomaticModuleName.settings("org.mulesoft.common"))
2627

js/src/main/scala/org/mulesoft/common/io/JsBaseFile.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
package org.mulesoft.common.io
22

33
import java.io.IOException
4-
54
import org.mulesoft.common.js.SysError
65

7-
import scala.concurrent.Promise
6+
import scala.concurrent.{ExecutionContext, Promise}
87
/**
98
* Base File for JS implementation
109
*/
1110
private[io] abstract class JsBaseFile(val fileSystem: JsServerFileSystem, val path: String) extends File {
11+
12+
override val global: ExecutionContext = scala.scalajs.concurrent.JSExecutionContext.queue
13+
1214
private val prefixLength = fileSystem.prefixLength(path)
1315

1416
override def parent: String = {
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
package org.mulesoft.common.io
22

3+
import scala.concurrent.ExecutionContext
4+
35
/**
46
* IO Tests
57
*/
68
class JsAsyncIoTest extends IoAsyncTest {
9+
10+
override implicit val executionContext: ExecutionContext = scala.scalajs.concurrent.JSExecutionContext.queue
11+
712
def fs: FileSystem = Fs
813
}

jvm/src/main/scala/org/mulesoft/common/io/JvmAsyncFile.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import scala.concurrent.{ExecutionContext, Future}
66
* Implementation of a AsyncFile for the JVM
77
* * @todo better handling of errors, Real async mode
88
*/
9-
protected class JvmAsyncFile(private val syncFile: JvmSyncFile) extends AsyncFile {
9+
protected class JvmAsyncFile(private val syncFile: JvmSyncFile) extends AsyncFile with JvmBaseFile {
1010

1111
val path: String = syncFile.path
1212
val fileSystem: FileSystem = syncFile.fileSystem
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package org.mulesoft.common.io
2+
3+
import scala.concurrent.ExecutionContext
4+
5+
trait JvmBaseFile extends File {
6+
7+
override val global: ExecutionContext = scala.concurrent.ExecutionContext.Implicits.global
8+
9+
}

jvm/src/main/scala/org/mulesoft/common/io/JvmSyncFile.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import scala.concurrent.ExecutionContext
77
/**
88
* Implementation of a SyncFile for the JVM
99
*/
10-
protected class JvmSyncFile(val fileSystem: FileSystem, val path: String) extends SyncFile {
10+
protected class JvmSyncFile(val fileSystem: FileSystem, val path: String) extends SyncFile with JvmBaseFile {
1111

1212
private val file = new JFile(path)
1313

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
package org.mulesoft.common.io
22

3+
import scala.concurrent.ExecutionContext
4+
35
/**
46
* IO Tests
57
*/
68
class JvmAsyncIoTest extends IoAsyncTest {
9+
10+
override implicit val executionContext: ExecutionContext = ExecutionContext.Implicits.global
11+
712
def fs: FileSystem = Fs
813

914
}

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=1.7.3
1+
sbt.version=1.10.4

0 commit comments

Comments
 (0)