Skip to content

Commit c04d412

Browse files
committed
Update README.md, publish scripts and sbt plugins
1 parent e7ecc3c commit c04d412

File tree

4 files changed

+47
-44
lines changed

4 files changed

+47
-44
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ resolvers ++= Seq(
1616
)
1717

1818
libraryDependencies ++= Seq(
19-
"io.pdal" %% "pdal" % "1.7.0-RC4", // core library
20-
"io.pdal" % "pdal-native" % "1.7.0-RC4" // jni bindings
19+
"io.pdal" %% "pdal" % "1.8.0", // core library
20+
"io.pdal" % "pdal-native" % "1.8.0" // jni bindings
2121
)
2222
```
2323

@@ -39,12 +39,12 @@ Scala API to build pipeline expressions instead of writing a raw JSON.
3939

4040
```scala
4141
libraryDependencies ++= Seq(
42-
"io.pdal" %% "pdal-scala" % "1.7.0-RC4", // scala core library
43-
"io.pdal" % "pdal-native" % "1.7.0-RC4" // jni bindings
42+
"io.pdal" %% "pdal-scala" % "1.8.0", // scala core library
43+
"io.pdal" % "pdal-native" % "1.8.0" // jni bindings
4444
)
4545
```
4646

47-
Scala API covers PDAL 1.7.x but is compatible with PDAL >= 1.4.x, to use any custom DSL
47+
Scala API covers PDAL 1.8.x but is compatible with PDAL >= 1.4.x, to use any custom DSL
4848
that is not covered by the current Scala API you can use `RawExpr` type to build `Pipeline
4949
Expression`.
5050

project/plugins.sbt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.5")
1+
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.9")
22
addSbtPlugin("ch.jodersky" % "sbt-jni" % "1.3.2")
3-
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.0")
4-
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.3.1")
5-
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "3.0.1")
3+
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.2")
4+
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.4.0")
5+
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.2.0")

sbt

Lines changed: 34 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
set -o pipefail
88

9-
declare -r sbt_release_version="0.13.18"
10-
declare -r sbt_unreleased_version="0.13.18"
9+
declare -r sbt_release_version="1.2.8"
10+
declare -r sbt_unreleased_version="1.2.8"
1111

1212
declare -r latest_213="2.13.0-M5"
1313
declare -r latest_212="2.12.8"
@@ -43,11 +43,12 @@ declare -a extra_jvm_opts extra_sbt_opts
4343

4444
echoerr () { echo >&2 "$@"; }
4545
vlog () { [[ -n "$verbose" ]] && echoerr "$@"; }
46-
die () { echo "Aborting: $@" ; exit 1; }
46+
die () { echo "Aborting: $*" ; exit 1; }
4747

4848
setTrapExit () {
4949
# save stty and trap exit, to ensure echo is re-enabled if we are interrupted.
50-
export SBT_STTY="$(stty -g 2>/dev/null)"
50+
SBT_STTY="$(stty -g 2>/dev/null)"
51+
export SBT_STTY
5152

5253
# restore stty settings (echo in particular)
5354
onSbtRunnerExit() {
@@ -67,16 +68,18 @@ get_script_path () {
6768
local path="$1"
6869
[[ -L "$path" ]] || { echo "$path" ; return; }
6970

70-
local target="$(readlink "$path")"
71+
local -r target="$(readlink "$path")"
7172
if [[ "${target:0:1}" == "/" ]]; then
7273
echo "$target"
7374
else
7475
echo "${path%/*}/$target"
7576
fi
7677
}
7778

78-
declare -r script_path="$(get_script_path "$BASH_SOURCE")"
79-
declare -r script_name="${script_path##*/}"
79+
script_path="$(get_script_path "${BASH_SOURCE[0]}")"
80+
declare -r script_path
81+
script_name="${script_path##*/}"
82+
declare -r script_name
8083

8184
init_default_option_file () {
8285
local overriding_var="${!1}"
@@ -90,8 +93,8 @@ init_default_option_file () {
9093
echo "$default_file"
9194
}
9295

93-
declare sbt_opts_file="$(init_default_option_file SBT_OPTS .sbtopts)"
94-
declare jvm_opts_file="$(init_default_option_file JVM_OPTS .jvmopts)"
96+
sbt_opts_file="$(init_default_option_file SBT_OPTS .sbtopts)"
97+
jvm_opts_file="$(init_default_option_file JVM_OPTS .jvmopts)"
9598

9699
build_props_sbt () {
97100
[[ -r "$buildProps" ]] && \
@@ -142,9 +145,9 @@ addResidual () { vlog "[residual] arg = '$1'" ; residual_args+=("$1"); }
142145
addResolver () { addSbt "set resolvers += $1"; }
143146
addDebugger () { addJava "-Xdebug" ; addJava "-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=$1"; }
144147
setThisBuild () {
145-
vlog "[addBuild] args = '$@'"
148+
vlog "[addBuild] args = '$*'"
146149
local key="$1" && shift
147-
addSbt "set $key in ThisBuild := $@"
150+
addSbt "set $key in ThisBuild := $*"
148151
}
149152
setScalaVersion () {
150153
[[ "$1" == *"-SNAPSHOT" ]] && addResolver 'Resolver.sonatypeRepo("snapshots")'
@@ -159,7 +162,7 @@ setJavaHome () {
159162
}
160163

161164
getJavaVersion() {
162-
local str=$("$1" -version 2>&1 | grep -E -e '(java|openjdk) version' | awk '{ print $3 }' | tr -d '"')
165+
local -r str=$("$1" -version 2>&1 | grep -E -e '(java|openjdk) version' | awk '{ print $3 }' | tr -d '"')
163166

164167
# java -version on java8 says 1.8.x
165168
# but on 9 and 10 it's 9.x.y and 10.x.y.
@@ -191,14 +194,14 @@ checkJava() {
191194
}
192195

193196
java_version () {
194-
local version=$(getJavaVersion "$java_cmd")
197+
local -r version=$(getJavaVersion "$java_cmd")
195198
vlog "Detected Java version: $version"
196199
echo "$version"
197200
}
198201

199202
# MaxPermSize critical on pre-8 JVMs but incurs noisy warning on 8+
200203
default_jvm_opts () {
201-
local v="$(java_version)"
204+
local -r v="$(java_version)"
202205
if [[ $v -ge 8 ]]; then
203206
echo "$default_jvm_opts_common"
204207
else
@@ -240,11 +243,11 @@ execRunner () {
240243

241244
jar_url () { make_url "$1"; }
242245

243-
is_cygwin () [[ "$(uname -a)" == "CYGWIN"* ]]
246+
is_cygwin () { [[ "$(uname -a)" == "CYGWIN"* ]]; }
244247

245248
jar_file () {
246249
is_cygwin \
247-
&& echo "$(cygpath -w $sbt_launch_dir/"$1"/sbt-launch.jar)" \
250+
&& cygpath -w "$sbt_launch_dir/$1/sbt-launch.jar" \
248251
|| echo "$sbt_launch_dir/$1/sbt-launch.jar"
249252
}
250253

@@ -420,7 +423,7 @@ process_args "$@"
420423
readConfigFile() {
421424
local end=false
422425
until $end; do
423-
read || end=true
426+
read -r || end=true
424427
[[ $REPLY =~ ^# ]] || [[ -z $REPLY ]] || echo "$REPLY"
425428
done < "$1"
426429
}
@@ -429,10 +432,10 @@ readConfigFile() {
429432
# can supply args to this runner
430433
if [[ -r "$sbt_opts_file" ]]; then
431434
vlog "Using sbt options defined in file $sbt_opts_file"
432-
while read opt; do extra_sbt_opts+=("$opt"); done < <(readConfigFile "$sbt_opts_file")
435+
while read -r opt; do extra_sbt_opts+=("$opt"); done < <(readConfigFile "$sbt_opts_file")
433436
elif [[ -n "$SBT_OPTS" && ! ("$SBT_OPTS" =~ ^@.*) ]]; then
434437
vlog "Using sbt options defined in variable \$SBT_OPTS"
435-
extra_sbt_opts=( $SBT_OPTS )
438+
IFS=" " read -r -a extra_sbt_opts <<< "$SBT_OPTS"
436439
else
437440
vlog "No extra sbt options have been defined"
438441
fi
@@ -452,18 +455,18 @@ checkJava
452455
setTraceLevel() {
453456
case "$sbt_version" in
454457
"0.7."* | "0.10."* | "0.11."* ) echoerr "Cannot set trace level in sbt version $sbt_version" ;;
455-
*) setThisBuild traceLevel $trace_level ;;
458+
*) setThisBuild traceLevel "$trace_level" ;;
456459
esac
457460
}
458461

459462
# set scalacOptions if we were given any -S opts
460-
[[ ${#scalac_args[@]} -eq 0 ]] || addSbt "set scalacOptions in ThisBuild += \"${scalac_args[@]}\""
463+
[[ ${#scalac_args[@]} -eq 0 ]] || addSbt "set scalacOptions in ThisBuild += \"${scalac_args[*]}\""
461464

462465
[[ -n "$sbt_explicit_version" && -z "$sbt_new" ]] && addJava "-Dsbt.version=$sbt_explicit_version"
463466
vlog "Detected sbt version $sbt_version"
464467

465468
if [[ -n "$sbt_script" ]]; then
466-
residual_args=( $sbt_script ${residual_args[@]} )
469+
residual_args=( "$sbt_script" "${residual_args[@]}" )
467470
else
468471
# no args - alert them there's stuff in here
469472
(( argumentCount > 0 )) || {
@@ -484,6 +487,7 @@ EOM
484487
}
485488

486489
# pick up completion if present; todo
490+
# shellcheck disable=SC1091
487491
[[ -r .sbt_completion.sh ]] && source .sbt_completion.sh
488492

489493
# directory to store sbt launchers
@@ -518,13 +522,13 @@ fi
518522

519523
if [[ -r "$jvm_opts_file" ]]; then
520524
vlog "Using jvm options defined in file $jvm_opts_file"
521-
while read opt; do extra_jvm_opts+=("$opt"); done < <(readConfigFile "$jvm_opts_file")
525+
while read -r opt; do extra_jvm_opts+=("$opt"); done < <(readConfigFile "$jvm_opts_file")
522526
elif [[ -n "$JVM_OPTS" && ! ("$JVM_OPTS" =~ ^@.*) ]]; then
523527
vlog "Using jvm options defined in \$JVM_OPTS variable"
524-
extra_jvm_opts=( $JVM_OPTS )
528+
IFS=" " read -r -a extra_jvm_opts <<< "$JVM_OPTS"
525529
else
526530
vlog "Using default jvm options"
527-
extra_jvm_opts=( $(default_jvm_opts) )
531+
IFS=" " read -r -a extra_jvm_opts <<< "$(default_jvm_opts)"
528532
fi
529533

530534
# traceLevel is 0.12+
@@ -546,13 +550,12 @@ main () {
546550
# we're not going to print those lines anyway. We strip that bit of
547551
# line noise, but leave the other codes to preserve color.
548552
mainFiltered () {
549-
local ansiOverwrite='\r\x1BM\x1B[2K'
550-
local excludeRegex=$(egrep -v '^#|^$' ~/.sbtignore | paste -sd'|' -)
553+
local -r excludeRegex=$(grep -E -v '^#|^$' ~/.sbtignore | paste -sd'|' -)
551554

552555
echoLine () {
553-
local line="$1"
554-
local line1="$(echo "$line" | sed 's/\r\x1BM\x1B\[2K//g')" # This strips the OverwriteLine code.
555-
local line2="$(echo "$line1" | sed 's/\x1B\[[0-9;]*[JKmsu]//g')" # This strips all codes - we test regexes against this.
556+
local -r line="$1"
557+
local -r line1="${line//\r\x1BM\x1B\[2K//g}" # This strips the OverwriteLine code.
558+
local -r line2="${line1//\x1B\[[0-9;]*[JKmsu]//g}" # This strips all codes - we test regexes against this.
556559

557560
if [[ $line2 =~ $excludeRegex ]]; then
558561
[[ -n $debugUs ]] && echo "[X] $line1"
@@ -569,7 +572,7 @@ mainFiltered () {
569572
# Obviously this is super ad hoc but I don't know how to improve on it. Testing whether
570573
# stdin is a terminal is useless because most of my use cases for this filtering are
571574
# exactly when I'm at a terminal, running sbt non-interactively.
572-
shouldFilter () { [[ -f ~/.sbtignore ]] && ! egrep -q '\b(shell|console|consoleProject)\b' <<<"${residual_args[@]}"; }
575+
shouldFilter () { [[ -f ~/.sbtignore ]] && ! grep -E -q '\b(shell|console|consoleProject)\b' <<<"${residual_args[@]}"; }
573576

574577
# run sbt
575578
if shouldFilter; then mainFiltered; else main; fi

scripts/merge-native.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ done
1717
export PDAL_VERSION_SUFFIX=${PDAL_VERSION_SUFFIX-"-SNAPSHOT"}
1818

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

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

26-
jar -cvf pdal-native-1.7.0${PDAL_VERSION_SUFFIX}.jar -C tmp .
26+
jar -cvf pdal-native-1.8.0${PDAL_VERSION_SUFFIX}.jar -C tmp .
2727

2828
cd ./tmp
2929

0 commit comments

Comments
 (0)