Skip to content

Commit cbf1e81

Browse files
authored
Update PDAL deps, make the build cross publish across 2.13, 2.12 and 2.11 (#24)
* Update PDAL deps, make the build cross publish across 2.13, 2.12 and 2.11
1 parent d55799b commit cbf1e81

34 files changed

+1065
-482
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ README.html
3333

3434
*.sublime-workspace
3535

36+
# VSCode files
37+
.vscode
38+
3639
# Test data files #
3740

3841
java/data

.sbtopts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22
-J-Xss512M
33
-Djava.awt.headless=true
44
-Dsun.io.serialization.extendedDebugInfo=true
5+
-Dsbt.color=always
6+
-Dsbt.supershell=false

.travis.yml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,29 @@ sudo: false
33
matrix:
44
include:
55
- os: linux
6-
jdk: oraclejdk8
6+
jdk: openjdk8
77
language: scala
88
scala:
9-
- 2.11.12
9+
- 2.13.1
1010
before_install:
11-
- docker pull daunnc/pdal-debian:1.8.0
11+
- docker pull daunnc/pdal-debian:2.0.0
1212
services:
1313
- docker
1414

1515
- os: linux
16-
jdk: oraclejdk8
16+
jdk: openjdk8
1717
language: scala
1818
scala:
19-
- 2.12.8
19+
- 2.12.10
2020
before_install:
21-
- docker pull daunnc/pdal-debian:1.8.0
21+
- docker pull daunnc/pdal-debian:2.0.0
2222
services:
2323
- docker
2424

2525
- os: osx
26+
osx_image: xcode9.3
2627
scala:
27-
- 2.11.12
28+
- 2.13.1
2829
compiler:
2930
- gcc
3031
- clang
@@ -33,8 +34,9 @@ matrix:
3334
- brew install pdal || true # to make travis happy
3435

3536
- os: osx
37+
osx_image: xcode9.3
3638
scala:
37-
- 2.12.8
39+
- 2.12.10
3840
compiler:
3941
- gcc
4042
- clang
@@ -47,8 +49,11 @@ addons:
4749

4850
cache:
4951
directories:
50-
- $HOME/.ivy2
52+
- $HOME/.m2
53+
- $HOME/.ivy2/cache
5154
- $HOME/.sbt
55+
- $HOME/.cache
56+
- $HOME/.cache/coursier
5257
- $HOME/Library/Caches/Homebrew
5358

5459
script:

.travis/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ else
99
-v $TRAVIS_BUILD_DIR:/pdal-java \
1010
-e TRAVIS_SCALA_VERSION=$TRAVIS_SCALA_VERSION \
1111
-e TRAVIS_COMMIT=$TRAVIS_COMMIT \
12-
-e TRAVIS_JDK_VERSION=$TRAVIS_JDK_VERSION daunnc/pdal-debian:1.8.0 /bin/bash -c "cd /pdal-java; .travis/test-all.sh"
12+
-e TRAVIS_JDK_VERSION=$TRAVIS_JDK_VERSION daunnc/pdal-debian:2.0.0 /bin/bash -c "cd /pdal-java; .travis/test-all.sh"
1313
fi

.travis/test-all.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
if [ `echo $TRAVIS_SCALA_VERSION | cut -f1-2 -d "."` = "2.11" ]; then
3+
if [[ `echo $TRAVIS_SCALA_VERSION | cut -f1-2 -d "."` = "2.13" ]]; then
44
.travis/test.sh;
55
else
66
.travis/test-212.sh;

.travis/test.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
./sbt "project core-scala" test || { exit 1; }
55

66
cd examples/pdal-jni
7-
./sbt "-211" "runMain com.azavea.Main" || { exit 1; }
8-
./sbt "-211" "runMain com.azavea.MainScala" || { exit 1; }
7+
./sbt "runMain com.azavea.Main" || { exit 1; }
8+
./sbt "runMain com.azavea.MainScala" || { exit 1; }
99
cd ~-

HOWTORELEASE.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ Release Process
2626
- Publishing snaphots:
2727
Snapshot can be published without PGP sign, it is published to a snapshot repo and allows immediate snaphot updates.
2828
To publish everything in a local repo use command:
29-
- ./scripts/publish-local.sh (publishes scala 2.11 version)
29+
- ./scripts/publish-local.sh (publishes scala 2.13 version)
3030
- ./scripts/publish-local-212.sh (publishes scala 2.12 version)
31+
- ./scripts/publish-local-211.sh (publishes scala 2.11 version)
3132
- ./scripts/publish-local-native.sh (publishes native dependencies)
3233
To publish everything into sonatype snapshot repo use:
3334
- ./scripts/publish-all.sh

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Build Status](https://api.travis-ci.org/PDAL/java.svg)](http://travis-ci.org/PDAL/java) [![Join the chat at https://gitter.im/PDAL/PDAL](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/PDAL/PDAL?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.pdal/pdal/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.pdal/pdal)
44

5-
Java bindings to use PDAL on JVM (supports PDAL >= 1.4).
5+
Java bindings to use PDAL on JVM (supports PDAL >= 2.0).
66
Mac users can experience some issues with bindings that were build against a different PDAL version,
77
so try to use a consistent PDAL version.
88

@@ -18,16 +18,16 @@ resolvers ++= Seq(
1818
)
1919

2020
libraryDependencies ++= Seq(
21-
"io.pdal" %% "pdal" % "1.9.0", // core library
22-
"io.pdal" % "pdal-native" % "1.9.0" // jni bindings
21+
"io.pdal" %% "pdal" % "2.0.0", // core library
22+
"io.pdal" % "pdal-native" % "2.0.0" // jni bindings
2323
)
2424
```
2525

2626
It's required to have native JNI binary in `java.library.path`:
2727

2828
```scala
2929
// Mac OS X example with manual JNI installation
30-
// cp -f native/target/resource_managed/main/native/x86_64-darwin/libpdaljni.1.4.dylib /usr/local/lib/libpdaljni.1.4.dylib
30+
// cp -f native/target/resource_managed/main/native/x86_64-darwin/libpdaljni.2.0.dylib /usr/local/lib/libpdaljni.2.0.dylib
3131
// place built binary into /usr/local/lib, and pass java.library.path to your JVM
3232
javaOptions += "-Djava.library.path=/usr/local/lib"
3333
```
@@ -41,8 +41,8 @@ Scala API to build pipeline expressions instead of writing a raw JSON.
4141

4242
```scala
4343
libraryDependencies ++= Seq(
44-
"io.pdal" %% "pdal-scala" % "1.9.0", // scala core library
45-
"io.pdal" % "pdal-native" % "1.9.0" // jni bindings
44+
"io.pdal" %% "pdal-scala" % "2.0.0", // scala core library
45+
"io.pdal" % "pdal-native" % "2.0.0" // jni bindings
4646
)
4747
```
4848

build.sbt

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

33
lazy val commonSettings = Seq(
4-
version := "1.9.1" + Environment.versionSuffix,
5-
scalaVersion := "2.11.12",
6-
crossScalaVersions := Seq("2.12.8", "2.11.12"),
4+
version := "2.0.0" + Environment.versionSuffix,
5+
scalaVersion := "2.13.1",
6+
crossScalaVersions := Seq("2.13.1", "2.12.10", "2.11.12"),
77
organization := "io.pdal",
88
description := "PDAL JNI bindings",
99
licenses := Seq("BSD" -> url("https://github.com/PDAL/PDAL/blob/master/LICENSE.txt")),
@@ -20,13 +20,13 @@ lazy val commonSettings = Seq(
2020
"-language:existentials",
2121
"-feature"
2222
),
23-
test in assembly := {},
23+
assembly / test := {},
2424
shellPrompt := { s => Project.extract(s).currentProject.id + " > " },
2525
commands ++= Seq(
2626
Commands.processJavastyleCommand("publish"),
2727
Commands.processJavastyleCommand("publishSigned")
2828
),
29-
publishArtifact in Test := false,
29+
Test / publishArtifact := false,
3030
publishTo := {
3131
val nexus = "https://oss.sonatype.org/"
3232
if (isSnapshot.value)
@@ -47,8 +47,8 @@ lazy val commonSettings = Seq(
4747
</developer>
4848
</developers>
4949
),
50-
PgpKeys.useGpg in Global := true,
51-
PgpKeys.gpgCommand in Global := "gpg"
50+
Global / PgpKeys.useGpg := true,
51+
Global / PgpKeys.gpgCommand := "gpg"
5252
)
5353

5454
lazy val root = (project in file("."))
@@ -58,12 +58,12 @@ lazy val root = (project in file("."))
5858
lazy val `core-scala` = project
5959
.settings(commonSettings: _*)
6060
.settings(name := "pdal-scala")
61-
.settings(target in javah := (sourceDirectory in nativeCompile in native).value / "include")
61+
.settings(javah / target := (native / nativeCompile / sourceDirectory).value / "include")
6262
.settings(libraryDependencies ++= Seq(
63-
Dependencies.circeCore,
64-
Dependencies.circeGeneric,
65-
Dependencies.circeGenericExtras,
66-
Dependencies.circeParser,
63+
Dependencies.circe("core").value,
64+
Dependencies.circe("generic").value,
65+
Dependencies.circe("generic-extras").value,
66+
Dependencies.circe("parser").value,
6767
Dependencies.jtsCore,
6868
Dependencies.scalaTest % Test
6969
))
@@ -74,15 +74,15 @@ lazy val `core-scala` = project
7474
lazy val core = project
7575
.settings(commonSettings: _*)
7676
.settings(name := "pdal")
77-
.settings(target in javah := (sourceDirectory in nativeCompile in native).value / "include")
77+
.settings(javah / target := (native / nativeCompile / sourceDirectory).value / "include")
7878
.settings(libraryDependencies += Dependencies.scalaTest % Test)
7979
.dependsOn(Environment.dependOnNative(native % Runtime): _*)
8080

8181
lazy val native = project
8282
.settings(commonSettings: _*)
8383
.settings(crossPaths := false)
8484
.settings(name := "pdal-native")
85-
.settings(sourceDirectory in nativeCompile := sourceDirectory.value)
85+
.settings(nativeCompile / sourceDirectory := sourceDirectory.value)
8686
.settings(artifactName := { (sv: ScalaVersion, module: ModuleID, artifact: Artifact) =>
8787
artifact.name + "-" + nativePlatform.value + "-" + module.revision + "." + artifact.extension
8888
})

core-scala/src/test/scala/io/pdal/pipeline/PipelineExpressionsSpec.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ import io.circe._
2020
import io.circe.syntax._
2121
import io.circe.parser._
2222

23-
import org.scalatest._
23+
import org.scalatest.BeforeAndAfterAll
24+
import org.scalatest.funspec.AnyFunSpec
25+
import org.scalatest.matchers.should.Matchers
2426

25-
class PipelineExpressionsSpec extends FunSpec with Matchers with BeforeAndAfterAll {
27+
class PipelineExpressionsSpec extends AnyFunSpec with Matchers with BeforeAndAfterAll {
2628
describe("Pipeline Expressions spec") {
2729
it("should print a correct json, using DSL") {
2830
val expected =

0 commit comments

Comments
 (0)