Skip to content

Commit fd7c25f

Browse files
authored
Update examples project (#63)
1 parent 6334f13 commit fd7c25f

File tree

3 files changed

+23
-28
lines changed

3 files changed

+23
-28
lines changed

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@ See [https://pdal.io/java.html](https://pdal.io/java.html) for more info.
1313
## Using PDAL JNI with SBT
1414

1515
```scala
16-
// pdal is published to maven central, but you can use following repos in addition
17-
resolvers ++= Seq(
18-
Resolver.sonatypeRepo("releases"),
19-
Resolver.sonatypeRepo("snapshots") // for snaphots
20-
)
16+
// pdal is published to maven central, but you can use the following repos in addition
17+
resolvers ++=
18+
Resolver.sonatypeOssRepos("releases") ++
19+
Resolver.sonatypeOssRepos("snapshots") // for snaphots
2120

2221
// `<latest version>` refers to the version indicated by the badge above
2322
libraryDependencies ++= Seq(

examples/pdal-jni/build.sbt

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1+
val scala212 = "2.12.17"
2+
val scala213 = "2.13.10"
3+
val scala3 = "3.2.1"
4+
val scalaVersions = Seq(scala3, scala213, scala212)
5+
16
name := "pdal-jni"
27
version := "0.1.0-SNAPSHOT"
3-
scalaVersion := "2.13.6"
4-
crossScalaVersions := Seq("2.13.6", "2.12.14")
8+
scalaVersion := scala213
9+
crossScalaVersions := Seq(scala3, scala213, scala212)
510
organization := "com.azavea"
611
scalacOptions ++= Seq(
712
"-deprecation",
@@ -14,18 +19,15 @@ scalacOptions ++= Seq(
1419
"-feature"
1520
)
1621

17-
resolvers ++= Seq(
18-
Resolver.sonatypeRepo("releases"),
19-
Resolver.sonatypeRepo("snapshots")
20-
)
22+
resolvers ++= Resolver.sonatypeOssRepos("releases") ++ Resolver.sonatypeOssRepos("snapshots")
2123

2224
fork := true
2325

24-
val pdalVersion = "2.3.0"
26+
val pdalVersion = "2.4.0"
2527

2628
libraryDependencies ++= Seq(
2729
"io.pdal" %% "pdal" % pdalVersion,
2830
"io.pdal" %% "pdal-scala" % pdalVersion,
2931
"io.pdal" % "pdal-native" % pdalVersion,
30-
"org.scalatest" %% "scalatest" % "3.2.9" % Test
32+
"org.scalatest" %% "scalatest" % "3.2.14" % Test
3133
)

examples/pdal-jni/sbt

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@
3434

3535
set -o pipefail
3636

37-
declare -r sbt_release_version="1.5.5"
38-
declare -r sbt_unreleased_version="1.5.5"
37+
declare -r sbt_release_version="1.8.0"
38+
declare -r sbt_unreleased_version="1.8.0"
3939

40-
declare -r latest_213="2.13.6"
41-
declare -r latest_212="2.12.14"
40+
declare -r latest_213="2.13.10"
41+
declare -r latest_212="2.12.17"
4242
declare -r latest_211="2.11.12"
4343
declare -r latest_210="2.10.7"
4444
declare -r latest_29="2.9.3"
@@ -216,7 +216,8 @@ getJavaVersion() {
216216
# but on 9 and 10 it's 9.x.y and 10.x.y.
217217
if [[ "$str" =~ ^1\.([0-9]+)(\..*)?$ ]]; then
218218
echo "${BASH_REMATCH[1]}"
219-
elif [[ "$str" =~ ^([0-9]+)(\..*)?$ ]]; then
219+
# Fixes https://github.com/dwijnand/sbt-extras/issues/326
220+
elif [[ "$str" =~ ^([0-9]+)(\..*)?(-ea)?$ ]]; then
220221
echo "${BASH_REMATCH[1]}"
221222
elif [[ -n "$str" ]]; then
222223
echoerr "Can't parse java version from: $str"
@@ -252,7 +253,9 @@ is_apple_silicon() { [[ "$(uname -s)" == "Darwin" && "$(uname -m)" == "arm64" ]]
252253
# MaxPermSize critical on pre-8 JVMs but incurs noisy warning on 8+
253254
default_jvm_opts() {
254255
local -r v="$(java_version)"
255-
if [[ $v -ge 10 ]]; then
256+
if [[ $v -ge 17 ]]; then
257+
echo "$default_jvm_opts_common"
258+
elif [[ $v -ge 10 ]]; then
256259
if is_apple_silicon; then
257260
# As of Dec 2020, JVM for Apple Silicon (M1) doesn't support JVMCI
258261
echo "$default_jvm_opts_common"
@@ -385,12 +388,10 @@ usage() {
385388
set_sbt_version
386389
cat <<EOM
387390
Usage: $script_name [options]
388-
389391
Note that options which are passed along to sbt begin with -- whereas
390392
options to this runner use a single dash. Any sbt command can be scheduled
391393
to run first by prefixing the command with --, so --warn, --error and so on
392394
are not special.
393-
394395
-h | -help print this message
395396
-v verbose operation (this runner is chattier)
396397
-d, -w, -q aliases for --debug, --warn, --error (q means quiet)
@@ -408,15 +409,13 @@ are not special.
408409
-batch Disable interactive mode
409410
-prompt <expr> Set the sbt prompt; in expr, 's' is the State and 'e' is Extracted
410411
-script <file> Run the specified file as a scala script
411-
412412
# sbt version (default: sbt.version from $buildProps if present, otherwise $sbt_release_version)
413413
-sbt-version <version> use the specified version of sbt (default: $sbt_release_version)
414414
-sbt-force-latest force the use of the latest release of sbt: $sbt_release_version
415415
-sbt-dev use the latest pre-release version of sbt: $sbt_unreleased_version
416416
-sbt-jar <path> use the specified jar as the sbt launcher
417417
-sbt-launch-dir <path> directory to hold sbt launchers (default: $sbt_launch_dir)
418418
-sbt-launch-repo <url> repo url for downloading sbt launcher jar (default: $(url_base "$sbt_version"))
419-
420419
# scala version (default: as chosen by sbt)
421420
-28 use $latest_28
422421
-29 use $latest_29
@@ -427,10 +426,8 @@ are not special.
427426
-scala-home <path> use the scala build at the specified directory
428427
-scala-version <version> use the specified version of scala
429428
-binary-version <version> use the specified scala version when searching for dependencies
430-
431429
# java version (default: java from PATH, currently $(java -version 2>&1 | grep version))
432430
-java-home <path> alternate JAVA_HOME
433-
434431
# passing options to the jvm - note it does NOT use JAVA_OPTS due to pollution
435432
# The default set is used if JVM_OPTS is unset and no -jvm-opts file is found
436433
<default> $(default_jvm_opts)
@@ -440,14 +437,12 @@ are not special.
440437
-jvm-opts <path> file containing jvm args (if not given, .jvmopts in project root is used if present)
441438
-Dkey=val pass -Dkey=val directly to the jvm
442439
-J-X pass option -X directly to the jvm (-J is stripped)
443-
444440
# passing options to sbt, OR to this runner
445441
SBT_OPTS environment variable holding either the sbt args directly, or
446442
the reference to a file containing sbt args if given path is prepended by '@' (e.g. '@/etc/sbtopts')
447443
Note: "@"-file is overridden by local '.sbtopts' or '-sbt-opts' argument.
448444
-sbt-opts <path> file containing sbt args (if not given, .sbtopts in project root is used if present)
449445
-S-X add -X to sbt's scalacOptions (-S is stripped)
450-
451446
# passing options exclusively to this runner
452447
SBTX_OPTS environment variable holding either the sbt-extras args directly, or
453448
the reference to a file containing sbt-extras args if given path is prepended by '@' (e.g. '@/etc/sbtxopts')
@@ -600,7 +595,6 @@ fi
600595
$(pwd) doesn't appear to be an sbt project.
601596
If you want to start sbt anyway, run:
602597
$0 -sbt-create
603-
604598
EOM
605599
exit 1
606600
}

0 commit comments

Comments
 (0)