Skip to content

Commit 2407b30

Browse files
authored
SBT2 as a primary build tool for the project (#119)
* SBT2 as a primary build tool for the project * Scala 3 upd
1 parent 96bc741 commit 2407b30

9 files changed

Lines changed: 39 additions & 37 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
include:
2020
- os: macos-latest
2121
arch: arm64
22-
java: [11]
22+
java: [17]
2323
distribution: [temurin]
2424
pdal: [2.10.2]
2525
runs-on: ${{ matrix.os }}
@@ -86,7 +86,7 @@ jobs:
8686
strategy:
8787
matrix:
8888
os: [ubuntu-latest]
89-
java: [11]
89+
java: [17]
9090
distribution: [temurin]
9191
pdal: [2.10.2]
9292
runs-on: ${{ matrix.os }}

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ If you would like to use your own bindings, it is necessary to set `java.library
4343

4444
```scala
4545
// macOS X example with manual JNI installation
46-
// cp -f native/target/resource_managed/main/native/arm64-darwin/libpdaljni.2.10.dylib /usr/local/lib/libpdaljni.2.10.dylib
46+
// cp -f target/out/jvm/u/pdal-native/resource_managed/main/native/arm64-darwin/libpdaljni.2.10.dylib /usr/local/lib/libpdaljni.2.10.dylib
4747
// place built binary into /usr/local/lib, and pass java.library.path to your JVM
4848
javaOptions += "-Djava.library.path=/usr/local/lib"
4949
```

‎build.sbt‎

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
name := "pdal-jni"
22

3-
val scala212 = "2.12.20"
4-
val scala213 = "2.13.16"
5-
val scala3 = "3.7.1"
6-
val scalaVersions = Seq(scala3, scala213, scala212)
3+
val scala212 = "2.12.21"
4+
val scala213 = "2.13.18"
5+
val scala3 = "3.9.0"
6+
val scalaVersions = Seq(scala213, scala3, scala212)
77

88
lazy val commonSettings = Seq(
99
scalaVersion := scalaVersions.head,
1010
crossScalaVersions := scalaVersions,
1111
organization := "io.pdal",
1212
description := "PDAL JNI bindings",
13-
licenses := Seq("BSD" -> url("https://github.com/PDAL/PDAL/blob/master/LICENSE.txt")),
14-
homepage := Some(url("https://www.pdal.io")),
13+
licenses := Seq("BSD" -> uri("https://github.com/PDAL/PDAL/blob/master/LICENSE.txt")),
14+
homepage := Some(uri("https://www.pdal.io")),
1515
versionScheme := Some("semver-spec"),
1616
scalacOptions ++= Seq(
1717
"-deprecation",
@@ -31,13 +31,13 @@ lazy val commonSettings = Seq(
3131
"pomadchin",
3232
"Grigory Pomadchin",
3333
"@pomadchin",
34-
url("https://github.com/pomadchin")
34+
uri("https://github.com/pomadchin")
3535
)
3636
)
3737
)
3838

3939
lazy val root = (project in file("."))
40-
.settings(commonSettings: _*)
40+
.settings(commonSettings*)
4141
.settings(
4242
scalaVersion := scalaVersions.head,
4343
crossScalaVersions := Nil,
@@ -47,7 +47,7 @@ lazy val root = (project in file("."))
4747
.aggregate(`core-scala`, core, native)
4848

4949
lazy val `core-scala` = project
50-
.settings(commonSettings: _*)
50+
.settings(commonSettings*)
5151
.settings(Dependencies.macroSettings)
5252
.settings(Dependencies.licenseSettings)
5353
.settings(scalaVersion := scala213, crossScalaVersions := Seq(scala213, scala212))
@@ -64,10 +64,10 @@ lazy val `core-scala` = project
6464
)
6565
)
6666
.dependsOn(core)
67-
.dependsOn(Environment.dependOnNative(native % Runtime): _*)
67+
.dependsOn(Environment.dependOnNative(native % Runtime)*)
6868

6969
lazy val core = project
70-
.settings(commonSettings: _*)
70+
.settings(commonSettings*)
7171
.settings(name := "pdal")
7272
.settings(javah / target := (native / nativeCompile / sourceDirectory).value / "include")
7373
.settings(sbtJniCoreScope := Compile)
@@ -77,18 +77,20 @@ lazy val core = project
7777
Dependencies.circe("parser") % Test
7878
)
7979
)
80-
.dependsOn(Environment.dependOnNative(native % Runtime): _*)
80+
.dependsOn(Environment.dependOnNative(native % Runtime)*)
8181

8282
lazy val native = project
83-
.settings(commonSettings: _*)
83+
.settings(commonSettings*)
8484
.settings(crossPaths := false)
8585
.settings(name := "pdal-native")
8686
.settings(nativeCompile / sourceDirectory := sourceDirectory.value)
87+
// keep native binaries at native/target/native/<platform> (sbt 2 moved target under target/out)
88+
.settings(nativeCompile / target := baseDirectory.value / "target" / "native" / nativePlatform.value)
8789
.settings(
8890
Compile / unmanagedPlatformDependentNativeDirectories := Seq(
89-
"x86_64-linux" -> target.value / "native/x86_64-linux/bin/",
90-
"x86_64-darwin" -> target.value / "native/x86_64-darwin/bin/",
91-
"arm64-darwin" -> target.value / "native/arm64-darwin/bin/"
91+
"x86_64-linux" -> baseDirectory.value / "target/native/x86_64-linux/bin/",
92+
"x86_64-darwin" -> baseDirectory.value / "target/native/x86_64-darwin/bin/",
93+
"arm64-darwin" -> baseDirectory.value / "target/native/arm64-darwin/bin/"
9294
)
9395
)
9496
.settings(artifactName := { (sv: ScalaVersion, module: ModuleID, artifact: Artifact) =>

‎examples/pdal-jni/build.sbt‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
val scala212 = "2.12.20"
2-
val scala213 = "2.13.16"
3-
val scala3 = "3.7.1"
1+
val scala212 = "2.12.21"
2+
val scala213 = "2.13.18"
3+
val scala3 = "3.9.0"
44
val scalaVersions = Seq(scala3, scala213, scala212)
55

66
name := "pdal-jni"
@@ -29,5 +29,5 @@ libraryDependencies ++= Seq(
2929
"io.pdal" %% "pdal" % pdalVersion,
3030
"io.pdal" %% "pdal-scala" % pdalVersion,
3131
"io.pdal" % "pdal-native" % pdalVersion,
32-
"org.scalatest" %% "scalatest" % "3.2.19" % Test
32+
"org.scalatest" %% "scalatest" % "3.2.20" % Test
3333
)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=1.11.2
1+
sbt.version=2.0.11
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.6.4")
1+
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.7.1")

‎project/Dependencies.scala‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import sbt._
22
import sbt.Keys._
33

4-
import de.heikoseeberger.sbtheader.{CommentStyle, FileType}
5-
import de.heikoseeberger.sbtheader.HeaderPlugin.autoImport.{headerLicense, headerMappings, HeaderLicense}
4+
import sbtheader.{CommentStyle, FileType}
5+
import sbtheader.HeaderPlugin.autoImport.{headerLicense, headerMappings, HeaderLicense}
66

77
object Version {
88
val jts = "1.20.0"
9-
val scalaTest = "3.2.19"
10-
val circe = "0.14.14"
9+
val scalaTest = "3.2.20"
10+
val circe = "0.14.17"
1111
val circeExtras = "0.14.4"
1212
}
1313

@@ -18,7 +18,7 @@ object Dependencies {
1818
case _ => false
1919
}
2020

21-
lazy val macroSettings: Seq[Setting[_]] = Seq(
21+
lazy val macroSettings: Seq[Setting[?]] = Seq(
2222
libraryDependencies ++= (
2323
if (priorTo213(scalaVersion.value))
2424
Seq(compilerPlugin(("org.scalamacros" %% "paradise" % "2.1.1").cross(CrossVersion.full)))
@@ -27,7 +27,7 @@ object Dependencies {
2727
scalacOptions ++= (if (priorTo213(scalaVersion.value)) Nil else Seq("-Ymacro-annotations"))
2828
)
2929

30-
lazy val licenseSettings: Seq[Setting[_]] = Seq(
30+
lazy val licenseSettings: Seq[Setting[?]] = Seq(
3131
headerLicense := Some(HeaderLicense.ALv2(java.time.Year.now.getValue.toString, "Azavea")),
3232
headerMappings := Map(
3333
FileType.scala -> CommentStyle.cStyleBlockComment.copy(

‎project/build.properties‎

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

‎project/plugins.sbt‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
addSbtPlugin("com.github.sbt" % "sbt-jni" % "1.7.0")
2-
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.6.4")
3-
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.10.0")
4-
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.11.1")
5-
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2")
1+
addSbtPlugin("com.github.sbt" % "sbt-jni" % "1.8.0")
2+
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.7.1")
3+
addSbtPlugin("com.github.sbt" % "sbt-header" % "5.11.0")
4+
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.12.1")
5+
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.6.2")

0 commit comments

Comments
 (0)