Skip to content

Commit 5f6a377

Browse files
authored
Publish native runtime, fix JSDOM CI setup... (#471)
* Publish native runtime * Formatting * Add Native to CI matrix * Add JSDOM to CI matrix * Fix JSDOM CI
1 parent 965a035 commit 5f6a377

File tree

4 files changed

+43
-6
lines changed

4 files changed

+43
-6
lines changed

.github/workflows/ci.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ jobs:
3838
distribution: 'temurin'
3939
java-version: ${{ matrix.java }}
4040

41-
- name: Install JSDOM
42-
run: npm install
43-
4441
- name: run tests
4542
run: sbt ++${{ matrix.scala.version }} plugin/test
4643

@@ -51,7 +48,7 @@ jobs:
5148
matrix:
5249
os: [ 'ubuntu-latest', 'windows-latest' ]
5350
java: ['8', '17' ]
54-
module: ['runtime', 'runtimeJS', 'reporter', 'domain', 'serializer']
51+
module: ['runtime', 'runtimeJS', 'runtimeJSDOMTest', 'runtimeNative', 'reporter', 'domain', 'serializer']
5552
steps:
5653
- name: checkout the repo
5754
uses: actions/checkout@v3
@@ -64,6 +61,10 @@ jobs:
6461
distribution: 'temurin'
6562
java-version: ${{ matrix.java }}
6663

64+
- name: Install JSDOM
65+
run: npm install
66+
if: matrix.module == 'runtimeJSDOMTest'
67+
6768
- name: run tests
6869
run: sbt +${{ matrix.module }}/test
6970

build.sbt

+2-1
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ lazy val root = Project("scalac-scoverage", file("."))
9999
plugin,
100100
runtime.jvm,
101101
runtime.js,
102+
runtime.native,
102103
runtimeJSDOMTest,
103104
reporter,
104105
domain,
@@ -109,7 +110,7 @@ lazy val root = Project("scalac-scoverage", file("."))
109110
lazy val runtime = CrossProject(
110111
"runtime",
111112
file("runtime")
112-
)(JVMPlatform, JSPlatform)
113+
)(JVMPlatform, JSPlatform, NativePlatform)
113114
.crossType(CrossType.Full)
114115
.withoutSuffixFor(JVMPlatform)
115116
.settings(

project/plugins.sbt

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.10.0")
2-
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.1.0")
2+
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.2.0")
3+
4+
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.4")
5+
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.2.0")
6+
37
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.10")
48

59
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6")
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package scoverage
2+
3+
import java.io.{File => SupportFile}
4+
import java.io.{FileFilter => SupportFileFilter}
5+
import java.io.{FileWriter => SupportFileWriter}
6+
7+
import scala.collection.mutable.HashMap
8+
import scala.io.{Source => SupportSource}
9+
10+
object Platform {
11+
type ThreadSafeMap[A, B] = HashMap[A, B]
12+
lazy val ThreadSafeMap = HashMap
13+
14+
type File = SupportFile
15+
type FileWriter = SupportFileWriter
16+
type FileFilter = SupportFileFilter
17+
18+
lazy val Source = SupportSource
19+
20+
def insecureRandomUUID() = {
21+
import scala.util.Random
22+
var msb = Random.nextLong()
23+
var lsb = Random.nextLong()
24+
msb &= 0xffffffffffff0fffL // clear version
25+
msb |= 0x0000000000004000L // set to version 4
26+
lsb &= 0x3fffffffffffffffL // clear variant
27+
lsb |= 0x8000000000000000L // set to IETF variant
28+
new java.util.UUID(msb, lsb)
29+
}
30+
31+
}

0 commit comments

Comments
 (0)