Skip to content

Make project up-to-date #77

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: CI

on:
pull_request:
paths:
- '**.scala'
- '**.java'
- '**.sbt'
- '.scalafmt.conf'
- '.github/workflows/test.yml'
- 'project/build.properties'
push:
branches:
- master
paths:
- '**.scala'
- '**.java'
- '**.sbt'
- '.scalafmt.conf'
- '.github/workflows/test.yml'
- 'project/build.properties'

jobs:
code_format:
name: Code format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: scalafmt
run: ./sbt scalafmtCheckAll
test_2_12:
name: Scala 2.12
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Scala 2.12 test
run: ./sbt "++2.12; test"
- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
if: always() # always run even if the previous step fails
with:
report_paths: '**/target/test-reports/TEST-*.xml'
check_name: Test Report Scala 2.12
test_2_13:
name: Scala 2.13
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Scala 2.13 test
run: ./sbt "++2.13; test"
- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
if: always() # always run even if the previous step fails
with:
report_paths: '**/target/test-reports/TEST-*.xml'
check_name: Test Report Scala 2.13
test_3:
name: Scala 3
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Scala 3 test
run: ./sbt "++3; test"
- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
if: always() # always run even if the previous step fails
with:
report_paths: '**/target/test-reports/TEST-*.xml'
check_name: Test Report Scala 3
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ larray/src/test/resources/log-test.properties

# IntelliJ specific
.idea*

.bsp
7 changes: 7 additions & 0 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version = 3.6.1
project.layout = StandardConvention
runner.dialect = scala213source3
maxColumn = 120
style = defaultWithAlign
optIn.breaksInsideChains = true
docstrings.blankFirstLine = yes
235 changes: 105 additions & 130 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,159 +1,134 @@
sonatypeProfileName := "org.xerial"
import xerial.sbt.Sonatype._

Global / onChangedBuildSource := ReloadOnSourceChanges

import ReleaseTransformations._
sonatypeProfileName := "org.xerial"

val SCALA_VERSION = "2.12.4"
val CROSS_SCALA_VERSIONS = Seq(SCALA_VERSION, "2.11.11")
scalaVersion in ThisBuild := SCALA_VERSION
val CROSS_SCALA_VERSIONS = Seq("2.12.17", "2.13.10", "3.2.1")
ThisBuild / scalaVersion := "3.2.1"

val buildSettings = Defaults.coreDefaultSettings ++ Seq(
organization := "org.xerial.larray",
organizationName := "xerial.org",
organizationHomepage := Some(new URL("http://xerial.org")),
publishMavenStyle := true,
publishArtifact in Test := false,
pomIncludeRepository := { _ => false },
scalaVersion := SCALA_VERSION,
crossScalaVersions := CROSS_SCALA_VERSIONS,
logBuffered in Test := false,
parallelExecution := true,
parallelExecution in Test := false,
javacOptions in Compile ++= Seq("-Xlint:unchecked"),
javacOptions in(Compile, doc) := Seq(
"-locale", "en_US",
"-sourcepath", baseDirectory.value.getAbsolutePath,
"-doctitle", s"LArray ${version.value} API"
val buildSettings = Seq(
organization := "org.xerial.larray",
organizationName := "xerial.org",
publishMavenStyle := true,
Test / publishArtifact := false,
crossScalaVersions := CROSS_SCALA_VERSIONS,
Test / logBuffered := false,
parallelExecution := true,
Test / parallelExecution := false,
Compile / javacOptions ++= Seq("-Xlint:unchecked"),
Compile / doc / javacOptions := Seq(
"-locale",
"en_US",
"-sourcepath",
baseDirectory.value.getAbsolutePath,
"-doctitle",
s"LArray ${version.value} API"
),
scalacOptions ++= Seq("-encoding", "UTF-8", "-unchecked", "-deprecation", "-feature"),
scalacOptions in(Compile, doc) ++= Seq("-sourcepath", baseDirectory.value.getAbsolutePath,
"-doc-source-url", "https://github.com/xerial/larray/tree/develop/€{FILE_PATH}.scala",
"-doc-title", "LArray API",
"-doc-version", version.value,
Compile / doc / scalacOptions ++= Seq(
"-sourcepath",
baseDirectory.value.getAbsolutePath,
"-doc-source-url",
"https://github.com/xerial/larray/tree/develop/€{FILE_PATH}.scala",
"-doc-title",
"LArray API",
"-doc-version",
version.value,
"-diagrams"
),
testOptions in Test += Tests.Argument(TestFrameworks.ScalaTest, "-u", s"${target.value / "test-reports"}", "-o"),
libraryDependencies ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, major)) if major <= 12 =>
Seq()
case _ =>
Seq("org.scala-lang.modules" %% "scala-parallel-collections" % "1.0.4")
}
} ++
Seq(
"org.scala-lang.modules" %% "scala-collection-compat" % "2.8.1",
"org.wvlet.airframe" %% "airspec" % "22.11.4" % "test"
),
testFrameworks += new TestFramework("wvlet.airspec.Framework"),
crossPaths := true,
licenses += ("Apache-2.0", url("https://www.apache.org/licenses/LICENSE-2.0.html")),
homepage := Some(url("https://github.com/xerial/larray")),
pomExtra := {
<scm>
<connection>scm:git:github.com/xerial/larray.git</connection>
<developerConnection>scm:git:git@github.com:xerial/larray.git</developerConnection>
<url>github.com/xerial/larray.git</url>
</scm>
<properties>
<scala.version>
{SCALA_VERSION}
</scala.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<developers>
<developer>
<id>leo</id>
<name>Taro L. Saito</name>
<url>http://xerial.org/leo</url>
</developer>
</developers>
},
releaseTagName := { (version in ThisBuild).value },
releaseCrossBuild := true,
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
ReleaseStep(action = Command.process("publishSigned", _), enableCrossBuild = true),
setNextVersion,
commitNextVersion,
ReleaseStep(action = Command.process("sonatypeReleaseAll", _), enableCrossBuild = true),
pushChanges
),
publishTo := Some(
if (isSnapshot.value)
Opts.resolver.sonatypeSnapshots
else
Opts.resolver.sonatypeStaging
)
sonatypeProjectHosting := Some(GitHubHosting("xerial", "larray", "leo@xerial.org")),
publishTo := sonatypePublishToBundle.value
)

lazy val root = Project(
id = "larray-root",
base = file("."),
settings = buildSettings ++ Seq(
publish := {},
publishLocal := {},
lazy val root = project
.in(file("."))
.settings(buildSettings)
.settings(
name := "larray-root",
publish := {},
publishLocal := {},
publishArtifact := false
)
) aggregate(larrayScala, larrayBuffer, larrayMMap)
.aggregate(larrayScala, larrayBuffer, larrayMMap)

val snappy = "org.xerial.snappy" % "snappy-java" % "1.1.4"
val junit = "junit" % "junit" % "4.11" % "test"
val slf4j = "org.slf4j" % "slf4j-api" % "1.7.25"
val slf4jSimple = "org.slf4j" % "slf4j-simple" % "1.7.25"
val snappy = "org.xerial.snappy" % "snappy-java" % "1.1.4"
val junit = "junit" % "junit" % "4.11" % "test"
val slf4j = "org.slf4j" % "slf4j-api" % "1.7.25"
val slf4jSimple = "org.slf4j" % "slf4j-simple" % "1.7.25"

val scope = "test->test;compile->compile"

lazy val larrayScala = Project(
id = "larray",
base = file("larray"),
settings = buildSettings ++ SbtMultiJvm.multiJvmSettings ++
Seq(
description := "LArray: A Large off-heap arrays for Scala/Java",
logBuffered in MultiJvm := false,
jvmOptions in MultiJvm ++= Seq("-Xmx128M"),
compile in MultiJvm := {(compile in MultiJvm) triggeredBy (compile in Test)}.value,
executeTests in Test := {
val testResults: Tests.Output = (executeTests in Test).value
val multiJvmTestResults: Tests.Output = (executeTests in MultiJvm).value
val results = testResults.events ++ multiJvmTestResults.events
lazy val larrayScala =
project
.in(file("larray"))
.settings(buildSettings)
.enablePlugins(MultiJvmPlugin)
.configs(MultiJvm)
.settings(
name := "larray",
description := "LArray: A Large off-heap arrays for Scala/Java",
MultiJvm / logBuffered := false,
MultiJvm / jvmOptions ++= Seq("-Xmx128M"),
MultiJvm / compile := { (MultiJvm / compile) triggeredBy (Test / compile) }.value,
Test / executeTests := {
val testResults: Tests.Output = (Test / executeTests).value
val multiJvmTestResults: Tests.Output = (MultiJvm / executeTests).value
val results = testResults.events ++ multiJvmTestResults.events
Tests.Output(
Tests.overall(Seq(testResults.overall, multiJvmTestResults.overall)),
results,
testResults.summaries ++ multiJvmTestResults.summaries)
testResults.summaries ++ multiJvmTestResults.summaries
)
},
libraryDependencies ++= Seq(
// Add dependent jars here
"org.wvlet" %% "wvlet-log" % "1.1",
snappy % "test",
"org.wvlet.airframe" %% "airframe-log" % "22.11.4",
snappy % "test",
junit,
"org.iq80.snappy" % "snappy" % "0.3" % "test",
"com.novocode" % "junit-interface" % "0.11" % "test",
"org.scalatest" %% "scalatest" % "3.0.1" % "test",
"org.scalacheck" %% "scalacheck" % "1.13.4" % "test",
"com.typesafe.akka" %% "akka-testkit" % "[2.3.14, 2.5)" % "test",
"com.typesafe.akka" %% "akka-multi-node-testkit" % "[2.3.14, 2.5)" % "test"
"org.iq80.snappy" % "snappy" % "0.3" % "test",
"com.github.sbt" % "junit-interface" % "0.13.3" % "test",
"org.scalatest" %% "scalatest" % "3.2.14" % "test",
"org.scalacheck" %% "scalacheck" % "1.15.4" % "test",
"com.typesafe.akka" %% "akka-testkit" % "2.7.0" % "test",
"com.typesafe.akka" %% "akka-multi-node-testkit" % "2.7.0" % "test"
)
)
) dependsOn(larrayBuffer % scope, larrayMMap) configs (MultiJvm)
).dependsOn(larrayBuffer % scope)

lazy val larrayBuffer = Project(
id = "larray-buffer",
base = file("larray-buffer"),
settings = buildSettings ++ Seq(
description := "LArray off-heap buffer library",
crossPaths := false,
autoScalaLibrary := false,
libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest" % "3.0.1" % "test",
"org.wvlet" %% "wvlet-log" % "1.1" % "test"
)
lazy val larrayBuffer = project
.in(file("larray-buffer"))
.settings(buildSettings)
.settings(
name := "larray-buffer",
description := "LArray off-heap buffer library",
crossPaths := false,
autoScalaLibrary := false
)
)

lazy val larrayMMap = Project(
id = "larray-mmap",
base = file("larray-mmap"),
settings = buildSettings ++
Seq(
description := "LArray mmap implementation",
crossPaths := false,
autoScalaLibrary := false,
libraryDependencies ++= Seq(
snappy % "test",
junit
)
lazy val larrayMMap = project
.in(file("larray-mmap"))
.settings(buildSettings)
.settings(
description := "LArray mmap implementation",
crossPaths := false,
autoScalaLibrary := false,
libraryDependencies ++= Seq(
snappy % "test",
junit
)
) dependsOn (larrayBuffer % scope)
).dependsOn(larrayBuffer % scope)
Loading