Skip to content

Commit 97c1db5

Browse files
authored
PDAL 2.2.0 Update (#47)
* Upd up to PDAL 2.2.0
1 parent 7400722 commit 97c1db5

File tree

16 files changed

+148
-43
lines changed

16 files changed

+148
-43
lines changed

.github/workflows/actions.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ jobs:
99
strategy:
1010
matrix:
1111
os: [ubuntu-latest]
12-
scala: [2.13.2, 2.12.10]
12+
scala: [2.13.3, 2.12.12]
1313

1414
container:
15-
image: daunnc/pdal-ubuntu:2.1.0
15+
image: daunnc/pdal-ubuntu:2.2.0
1616

1717
steps:
1818
- name: Checkout
@@ -50,7 +50,7 @@ jobs:
5050
strategy:
5151
matrix:
5252
os: [macos-latest]
53-
scala: [2.13.2, 2.12.10]
53+
scala: [2.13.3, 2.12.12]
5454

5555
steps:
5656
- name: Checkout

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,12 @@ README.html
3535

3636
# VSCode files
3737
.vscode
38+
.history
3839

3940
# Metals
4041
.metals
42+
.bloop
43+
metals.sbt
4144

4245
# Test data files #
4346

.sbtopts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
-J-Xmx2G
2-
-J-Xss512M
2+
-J-Xss4M
33
-Djava.awt.headless=true
44
-Dsun.io.serialization.extendedDebugInfo=true
55
-Dsbt.color=always

build.sbt

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name := "pdal-jni"
22

33
lazy val commonSettings = Seq(
4-
version := "2.1.7" + Environment.versionSuffix,
5-
scalaVersion := "2.13.2",
6-
crossScalaVersions := Seq("2.13.2", "2.12.10", "2.11.12"),
4+
version := "2.2.0" + Environment.versionSuffix,
5+
scalaVersion := "2.13.3",
6+
crossScalaVersions := Seq("2.13.3", "2.12.12", "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")),

core/src/main/scala/io/pdal/Pipeline.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class Pipeline(val json: String) extends Native {
5050
@native def getLog(): String
5151
}
5252

53-
@nativeLoader("pdaljni.2.1")
53+
@nativeLoader("pdaljni.2.2")
5454
object Pipeline {
5555
def apply(json: String): Pipeline = { val p = new Pipeline(json); p.initialize(); p }
5656
}

examples/pdal-jni/build.sbt

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name := "pdal-jni"
22
version := "0.1.0-SNAPSHOT"
3-
scalaVersion := "2.13.2"
4-
crossScalaVersions := Seq("2.13.2", "2.12.10", "2.11.12")
3+
scalaVersion := "2.13.3"
4+
crossScalaVersions := Seq("2.13.3", "2.12.12", "2.11.12")
55
organization := "com.azavea"
66
scalacOptions ++= Seq(
77
"-deprecation",
@@ -21,11 +21,11 @@ resolvers ++= Seq(
2121

2222
fork := true
2323

24-
val pdalVersion = "2.1.6"
24+
val pdalVersion = "2.2.0"
2525

2626
libraryDependencies ++= Seq(
2727
"io.pdal" %% "pdal" % pdalVersion,
2828
"io.pdal" %% "pdal-scala" % pdalVersion,
2929
"io.pdal" % "pdal-native" % pdalVersion,
30-
"org.scalatest" %% "scalatest" % "3.1.1" % Test
30+
"org.scalatest" %% "scalatest" % "3.2.2" % Test
3131
)

examples/pdal-jni/sbt

+52-4
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,42 @@
33
# A more capable sbt runner, coincidentally also called sbt.
44
# Author: Paul Phillips <[email protected]>
55
# https://github.com/paulp/sbt-extras
6+
#
7+
# Generated from http://www.opensource.org/licenses/bsd-license.php
8+
# Copyright (c) 2011, Paul Phillips. All rights reserved.
9+
#
10+
# Redistribution and use in source and binary forms, with or without
11+
# modification, are permitted provided that the following conditions are
12+
# met:
13+
#
14+
# * Redistributions of source code must retain the above copyright
15+
# notice, this list of conditions and the following disclaimer.
16+
# * Redistributions in binary form must reproduce the above copyright
17+
# notice, this list of conditions and the following disclaimer in the
18+
# documentation and/or other materials provided with the distribution.
19+
# * Neither the name of the author nor the names of its contributors
20+
# may be used to endorse or promote products derived from this software
21+
# without specific prior written permission.
22+
#
23+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24+
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25+
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26+
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27+
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28+
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
29+
# TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
30+
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
31+
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
32+
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33+
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
634

735
set -o pipefail
836

9-
declare -r sbt_release_version="1.3.10"
10-
declare -r sbt_unreleased_version="1.3.10"
37+
declare -r sbt_release_version="1.3.13"
38+
declare -r sbt_unreleased_version="1.4.0-RC1"
1139

12-
declare -r latest_213="2.13.2"
13-
declare -r latest_212="2.12.10"
40+
declare -r latest_213="2.13.3"
41+
declare -r latest_212="2.12.12"
1442
declare -r latest_211="2.11.12"
1543
declare -r latest_210="2.10.7"
1644
declare -r latest_29="2.9.3"
@@ -99,6 +127,7 @@ init_default_option_file() {
99127
}
100128

101129
sbt_opts_file="$(init_default_option_file SBT_OPTS .sbtopts)"
130+
sbtx_opts_file="$(init_default_option_file SBTX_OPTS .sbtxopts)"
102131
jvm_opts_file="$(init_default_option_file JVM_OPTS .jvmopts)"
103132

104133
build_props_sbt() {
@@ -411,6 +440,12 @@ are not special.
411440
Note: "@"-file is overridden by local '.sbtopts' or '-sbt-opts' argument.
412441
-sbt-opts <path> file containing sbt args (if not given, .sbtopts in project root is used if present)
413442
-S-X add -X to sbt's scalacOptions (-S is stripped)
443+
444+
# passing options exclusively to this runner
445+
SBTX_OPTS environment variable holding either the sbt-extras args directly, or
446+
the reference to a file containing sbt-extras args if given path is prepended by '@' (e.g. '@/etc/sbtxopts')
447+
Note: "@"-file is overridden by local '.sbtxopts' or '-sbtx-opts' argument.
448+
-sbtx-opts <path> file containing sbt-extras args (if not given, .sbtxopts in project root is used if present)
414449
EOM
415450
exit 0
416451
}
@@ -467,6 +502,7 @@ process_args() {
467502
-scala-home) require_arg path "$1" "$2" && setThisBuild scalaHome "_root_.scala.Some(file(\"$2\"))" && shift 2 ;;
468503
-java-home) require_arg path "$1" "$2" && setJavaHome "$2" && shift 2 ;;
469504
-sbt-opts) require_arg path "$1" "$2" && sbt_opts_file="$2" && shift 2 ;;
505+
-sbtx-opts) require_arg path "$1" "$2" && sbtx_opts_file="$2" && shift 2 ;;
470506
-jvm-opts) require_arg path "$1" "$2" && jvm_opts_file="$2" && shift 2 ;;
471507

472508
-D*) addJava "$1" && shift ;;
@@ -504,6 +540,18 @@ else
504540
vlog "No extra sbt options have been defined"
505541
fi
506542

543+
# if there are file/environment sbtx_opts, process again so we
544+
# can supply args to this runner
545+
if [[ -r "$sbtx_opts_file" ]]; then
546+
vlog "Using sbt options defined in file $sbtx_opts_file"
547+
while read -r opt; do extra_sbt_opts+=("$opt"); done < <(readConfigFile "$sbtx_opts_file")
548+
elif [[ -n "$SBTX_OPTS" && ! ("$SBTX_OPTS" =~ ^@.*) ]]; then
549+
vlog "Using sbt options defined in variable \$SBTX_OPTS"
550+
IFS=" " read -r -a extra_sbt_opts <<<"$SBTX_OPTS"
551+
else
552+
vlog "No extra sbt options have been defined"
553+
fi
554+
507555
[[ -n "${extra_sbt_opts[*]}" ]] && process_args "${extra_sbt_opts[@]}"
508556

509557
# reset "$@" to the residual args

native/src/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ set(MAKE_COLOR_MAKEFILE ON)
99

1010
project (pdaljni)
1111
set(PROJECT_VERSION_MAJOR 2)
12-
set(PROJECT_VERSION_MINOR 1)
12+
set(PROJECT_VERSION_MINOR 2)
1313
set(PROJECT_VERSION_PATCH 0)
1414

1515
set(PDAL_LIB_NAME pdalcpp)

native/src/JavaExceptions.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@
3131
* OF SUCH DAMAGE.
3232
****************************************************************************/
3333

34-
#pragma once
35-
3634
#include "JavaExceptions.hpp"
3735

3836
jstring throwInitializationException(JNIEnv *env, const char *message)

project/Dependencies.scala

+6-11
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ object Dependencies {
2020
}
2121

2222
def circe(module: String) = Def.setting {
23-
"io.circe" %% s"circe-$module" % ver("0.11.2", "0.12.2").value
23+
"io.circe" %% s"circe-$module" % ver("0.11.2", "0.13.0").value
2424
}
2525

2626
lazy val macroSettings: Seq[Setting[_]] = Seq(
@@ -34,21 +34,16 @@ object Dependencies {
3434
lazy val licenseSettings: Seq[Setting[_]] = Seq(
3535
headerLicense := Some(HeaderLicense.ALv2(java.time.Year.now.getValue.toString, "Azavea")),
3636
headerMappings := Map(
37-
FileType.scala -> CommentStyle.cStyleBlockComment.copy(commentCreator = new CommentCreator() {
38-
val Pattern = "(?s).*?(\\d{4}(-\\d{4})?).*".r
39-
def findYear(header: String): Option[String] = header match {
40-
case Pattern(years, _) => Some(years)
41-
case _ => None
42-
}
43-
def apply(text: String, existingText: Option[String]): String = {
37+
FileType.scala -> CommentStyle.cStyleBlockComment.copy(
38+
commentCreator = { (text, existingText) => {
4439
// preserve year of old headers
4540
val newText = CommentStyle.cStyleBlockComment.commentCreator.apply(text, existingText)
4641
existingText.flatMap(_ => existingText.map(_.trim)).getOrElse(newText)
47-
}
48-
})
42+
} }
43+
)
4944
)
5045
)
5146

5247
val jtsCore = "org.locationtech.jts" % "jts-core" % "1.16.1"
53-
val scalaTest = "org.scalatest" %% "scalatest" % "3.1.1"
48+
val scalaTest = "org.scalatest" %% "scalatest" % "3.2.2"
5449
}

project/build.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=1.3.10
1+
sbt.version=1.3.13

project/plugins.sbt

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.10")
2-
addSbtPlugin("ch.jodersky" % "sbt-jni" % "1.3.4")
1+
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.15.0")
2+
addSbtPlugin("ch.jodersky" % "sbt-jni" % "1.4.1")
33
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.0.1")
4-
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.5.0")
5-
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.4.0")
4+
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.5.1")
5+
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.5.0")

sbt

+52-4
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,42 @@
33
# A more capable sbt runner, coincidentally also called sbt.
44
# Author: Paul Phillips <[email protected]>
55
# https://github.com/paulp/sbt-extras
6+
#
7+
# Generated from http://www.opensource.org/licenses/bsd-license.php
8+
# Copyright (c) 2011, Paul Phillips. All rights reserved.
9+
#
10+
# Redistribution and use in source and binary forms, with or without
11+
# modification, are permitted provided that the following conditions are
12+
# met:
13+
#
14+
# * Redistributions of source code must retain the above copyright
15+
# notice, this list of conditions and the following disclaimer.
16+
# * Redistributions in binary form must reproduce the above copyright
17+
# notice, this list of conditions and the following disclaimer in the
18+
# documentation and/or other materials provided with the distribution.
19+
# * Neither the name of the author nor the names of its contributors
20+
# may be used to endorse or promote products derived from this software
21+
# without specific prior written permission.
22+
#
23+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24+
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25+
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26+
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27+
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28+
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
29+
# TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
30+
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
31+
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
32+
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33+
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
634

735
set -o pipefail
836

9-
declare -r sbt_release_version="1.3.10"
10-
declare -r sbt_unreleased_version="1.3.10"
37+
declare -r sbt_release_version="1.3.13"
38+
declare -r sbt_unreleased_version="1.4.0-RC1"
1139

12-
declare -r latest_213="2.13.2"
13-
declare -r latest_212="2.12.10"
40+
declare -r latest_213="2.13.3"
41+
declare -r latest_212="2.12.12"
1442
declare -r latest_211="2.11.12"
1543
declare -r latest_210="2.10.7"
1644
declare -r latest_29="2.9.3"
@@ -99,6 +127,7 @@ init_default_option_file() {
99127
}
100128

101129
sbt_opts_file="$(init_default_option_file SBT_OPTS .sbtopts)"
130+
sbtx_opts_file="$(init_default_option_file SBTX_OPTS .sbtxopts)"
102131
jvm_opts_file="$(init_default_option_file JVM_OPTS .jvmopts)"
103132

104133
build_props_sbt() {
@@ -411,6 +440,12 @@ are not special.
411440
Note: "@"-file is overridden by local '.sbtopts' or '-sbt-opts' argument.
412441
-sbt-opts <path> file containing sbt args (if not given, .sbtopts in project root is used if present)
413442
-S-X add -X to sbt's scalacOptions (-S is stripped)
443+
444+
# passing options exclusively to this runner
445+
SBTX_OPTS environment variable holding either the sbt-extras args directly, or
446+
the reference to a file containing sbt-extras args if given path is prepended by '@' (e.g. '@/etc/sbtxopts')
447+
Note: "@"-file is overridden by local '.sbtxopts' or '-sbtx-opts' argument.
448+
-sbtx-opts <path> file containing sbt-extras args (if not given, .sbtxopts in project root is used if present)
414449
EOM
415450
exit 0
416451
}
@@ -467,6 +502,7 @@ process_args() {
467502
-scala-home) require_arg path "$1" "$2" && setThisBuild scalaHome "_root_.scala.Some(file(\"$2\"))" && shift 2 ;;
468503
-java-home) require_arg path "$1" "$2" && setJavaHome "$2" && shift 2 ;;
469504
-sbt-opts) require_arg path "$1" "$2" && sbt_opts_file="$2" && shift 2 ;;
505+
-sbtx-opts) require_arg path "$1" "$2" && sbtx_opts_file="$2" && shift 2 ;;
470506
-jvm-opts) require_arg path "$1" "$2" && jvm_opts_file="$2" && shift 2 ;;
471507

472508
-D*) addJava "$1" && shift ;;
@@ -504,6 +540,18 @@ else
504540
vlog "No extra sbt options have been defined"
505541
fi
506542

543+
# if there are file/environment sbtx_opts, process again so we
544+
# can supply args to this runner
545+
if [[ -r "$sbtx_opts_file" ]]; then
546+
vlog "Using sbt options defined in file $sbtx_opts_file"
547+
while read -r opt; do extra_sbt_opts+=("$opt"); done < <(readConfigFile "$sbtx_opts_file")
548+
elif [[ -n "$SBTX_OPTS" && ! ("$SBTX_OPTS" =~ ^@.*) ]]; then
549+
vlog "Using sbt options defined in variable \$SBTX_OPTS"
550+
IFS=" " read -r -a extra_sbt_opts <<<"$SBTX_OPTS"
551+
else
552+
vlog "No extra sbt options have been defined"
553+
fi
554+
507555
[[ -n "${extra_sbt_opts[*]}" ]] && process_args "${extra_sbt_opts[@]}"
508556

509557
# reset "$@" to the residual args

scripts/crosscompile.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ docker run -it --rm \
2222
-v $HOME/.ivy2:/root/.ivy2 \
2323
-v $HOME/.sbt:/root/.sbt \
2424
-v $HOME/.coursier/cache:/root/.cache/coursier \
25-
daunnc/pdal-ubuntu:2.1.0 bash -c "cd ./pdal-java; ./scripts/pack-native.sh --suffix=${PDAL_VERSION_SUFFIX}"
25+
daunnc/pdal-ubuntu:2.2.0 bash -c "cd ./pdal-java; ./scripts/pack-native.sh --suffix=${PDAL_VERSION_SUFFIX}"
2626

2727
# docker run -it --rm \
2828
# -v $PWD:/workdir \
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM daunnc/pdal:2.2.0
2+
LABEL Grigory Pomadchin <[email protected]>
3+
4+
RUN set -ex && \
5+
apt update -y && \
6+
apt install \
7+
openjdk-8-jdk \
8+
ca-certificates-java -y
9+
10+
ENV JAVA_HOME /usr/lib/jvm/java-1.8.0-openjdk-amd6
11+
RUN update-alternatives --set java `update-alternatives --list java | grep java-8`
12+
13+
RUN apt-get -y install bash gcc g++ cmake wget

scripts/merge-native.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ done
1717
export PDAL_VERSION_SUFFIX=${PDAL_VERSION_SUFFIX-"-SNAPSHOT"}
1818

1919
cd ./native/target
20-
rm -f ./pdal-native-2.1.7${PDAL_VERSION_SUFFIX}.jar
20+
rm -f ./pdal-native-2.2.0${PDAL_VERSION_SUFFIX}.jar
2121
rm -rf ./tmp; mkdir -p ./tmp
2222

23-
cd tmp; jar -xf ../pdal-native-x86_64-darwin-2.1.7${PDAL_VERSION_SUFFIX}.jar; cd ~-
24-
cd tmp; jar -xf ../pdal-native-x86_64-linux-2.1.7${PDAL_VERSION_SUFFIX}.jar; cd ~-
23+
cd tmp; jar -xf ../pdal-native-x86_64-darwin-2.2.0${PDAL_VERSION_SUFFIX}.jar; cd ~-
24+
cd tmp; jar -xf ../pdal-native-x86_64-linux-2.2.0${PDAL_VERSION_SUFFIX}.jar; cd ~-
2525

2626
jar -cvf pdal-native-2.1.6${PDAL_VERSION_SUFFIX}.jar -C tmp .
2727

0 commit comments

Comments
 (0)