Skip to content

Commit 766855b

Browse files
authored
[WIP] PDAL 2.3.0 (#57)
* Upd dependencies and CI * Modify Docker images * Add snapshots release * Adjust the release process
1 parent 1e9b279 commit 766855b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+807
-878
lines changed

.github/workflows/actions.yml

Lines changed: 0 additions & 100 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches: ['**']
6+
push:
7+
branches: ['master']
8+
tags: [v*]
9+
release:
10+
types: [published]
11+
12+
jobs:
13+
linux:
14+
runs-on: ubuntu-latest
15+
container:
16+
image: daunnc/pdal-ubuntu:2.3.0
17+
18+
steps:
19+
- uses: actions/checkout@v2
20+
with:
21+
fetch-depth: 0
22+
- uses: coursier/cache-action@v6
23+
- uses: olafurpg/setup-scala@v11
24+
with:
25+
java-version: [email protected]
26+
27+
- name: Check formatting
28+
run: sbt scalafmtCheckAll
29+
30+
- name: Build project
31+
run: sbt +test
32+
33+
macos:
34+
runs-on: macos-latest
35+
36+
steps:
37+
- uses: actions/checkout@v2
38+
with:
39+
fetch-depth: 0
40+
- uses: coursier/cache-action@v6
41+
- uses: olafurpg/setup-scala@v11
42+
with:
43+
java-version: [email protected]
44+
45+
- name: Cache Homebrew
46+
uses: actions/cache@v2
47+
with:
48+
path: ~/Library/Caches/Homebrew
49+
key: ${{ runner.os }}-homebrew
50+
51+
- name: Install PDAL
52+
run: |
53+
brew update && \
54+
brew install pdal || true
55+
56+
- name: Check formatting
57+
run: sbt scalafmtCheckAll
58+
59+
- name: Build project
60+
run: sbt +test
61+
62+
- uses: actions/upload-artifact@v2
63+
with:
64+
name: macos
65+
path: native/target/native/x86_64-darwin/bin
66+
67+
publish:
68+
runs-on: ubuntu-latest
69+
needs: [linux, macos]
70+
container:
71+
image: daunnc/pdal-ubuntu:2.3.0
72+
if: github.event_name != 'pull_request'
73+
env:
74+
PDAL_DEPEND_ON_NATIVE: "false"
75+
76+
steps:
77+
- uses: actions/checkout@v2
78+
with:
79+
fetch-depth: 0
80+
- uses: coursier/cache-action@v6
81+
- uses: olafurpg/setup-scala@v11
82+
with:
83+
java-version: [email protected]
84+
85+
- uses: actions/download-artifact@v2
86+
with:
87+
name: macos
88+
path: native/target/native/x86_64-darwin/bin
89+
90+
- name: Release
91+
run: sbt ci-release
92+
env:
93+
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
94+
PGP_SECRET: ${{ secrets.PGP_SECRET }}
95+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
96+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
97+
if: ${{ env.SONATYPE_PASSWORD != '' && env.SONATYPE_USERNAME != '' }}

.scalafmt.conf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version=3.0.0-RC6
2+
runner.dialect = scala3
3+
align.openParenCallSite = true
4+
align.openParenDefnSite = true
5+
maxColumn = 120
6+
continuationIndent.defnSite = 2
7+
assumeStandardLibraryStripMargin = true
8+
danglingParentheses.preset = true
9+
rewrite.rules = [AvoidInfix, SortImports, RedundantParens, SortModifiers]
10+
docstrings = JavaDoc
11+
newlines.afterCurlyLambda = preserve
12+
docstrings.style = Asterisk
13+
docstrings.oneline = unfold

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# PDAL Java bindings
22

3-
[![PDAL Java CI](https://github.com/PDAL/java/workflows/PDAL%20Java%20CI/badge.svg)](https://github.com/PDAL/java/actions) [![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://search.maven.org/search?q=g:io.pdal)
3+
[![CI](https://github.com/PDAL/java/workflows/CI/badge.svg)](https://github.com/PDAL/java/actions) [![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://img.shields.io/maven-central/v/io.pdal/pdal_2.13)](https://search.maven.org/search?q=g:io.pdal) [![Snapshots](https://img.shields.io/nexus/s/https/oss.sonatype.org/io.pdal/pdal_2.13)](https://oss.sonatype.org/content/repositories/snapshots/io/pdal/)
44

55
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,

build.sbt

Lines changed: 37 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
name := "pdal-jni"
22

3+
val scalaVersions = Seq("3.0.1", "2.13.6", "2.12.14")
4+
35
lazy val commonSettings = Seq(
4-
version := "2.2.1" + Environment.versionSuffix,
5-
scalaVersion := "2.13.6",
6-
crossScalaVersions := Seq("2.13.6", "2.12.14", "2.11.12"),
6+
scalaVersion := scalaVersions.head,
7+
crossScalaVersions := scalaVersions,
78
organization := "io.pdal",
89
description := "PDAL JNI bindings",
910
licenses := Seq("BSD" -> url("https://github.com/PDAL/PDAL/blob/master/LICENSE.txt")),
1011
homepage := Some(url("https://www.pdal.io")),
12+
versionScheme := Some("semver-spec"),
1113
publishMavenStyle := true,
1214
pomIncludeRepository := { _ => false },
1315
scalacOptions ++= Seq(
@@ -20,62 +22,53 @@ lazy val commonSettings = Seq(
2022
"-language:existentials",
2123
"-feature"
2224
),
23-
assembly / test := {},
2425
shellPrompt := { s => Project.extract(s).currentProject.id + " > " },
25-
commands ++= Seq(
26-
Commands.processJavastyleCommand("publish"),
27-
Commands.processJavastyleCommand("publishSigned")
28-
),
2926
Test / publishArtifact := false,
30-
publishTo := {
31-
val nexus = "https://oss.sonatype.org/"
32-
if (isSnapshot.value)
33-
Some("snapshots" at nexus + "content/repositories/snapshots")
34-
else
35-
Some("releases" at nexus + "service/local/staging/deploy/maven2")
36-
},
37-
pomExtra := (
38-
<scm>
39-
<url>git@github.com:PDAL/PDAL.git</url>
40-
<connection>scm:git:git@github.com:PDAL/PDAL.git</connection>
41-
</scm>
42-
<developers>
43-
<developer>
44-
<id>pomadchin</id>
45-
<name>Grigory Pomadchin</name>
46-
<url>https://github.com/pomadchin/</url>
47-
</developer>
48-
</developers>
49-
),
50-
Global / PgpKeys.useGpg := true,
51-
Global / PgpKeys.gpgCommand := "gpg"
27+
developers := List(
28+
Developer(
29+
"pomadchin",
30+
"Grigory Pomadchin",
31+
"@pomadchin",
32+
url("https://github.com/pomadchin")
33+
)
34+
)
5235
)
5336

5437
lazy val root = (project in file("."))
5538
.settings(commonSettings: _*)
39+
.settings(
40+
scalaVersion := scalaVersions.head,
41+
crossScalaVersions := Nil,
42+
publish := {},
43+
publishLocal := {}
44+
)
5645
.aggregate(`core-scala`, core, native)
5746

5847
lazy val `core-scala` = project
5948
.settings(commonSettings: _*)
6049
.settings(Dependencies.macroSettings)
6150
.settings(Dependencies.licenseSettings)
51+
.settings(scalaVersion := "2.13.6", crossScalaVersions := Seq("2.13.6", "2.12.14"))
6252
.settings(name := "pdal-scala")
6353
.settings(javah / target := (native / nativeCompile / sourceDirectory).value / "include")
64-
.settings(libraryDependencies ++= Seq(
65-
Dependencies.circe("core").value,
66-
Dependencies.circe("generic").value,
67-
Dependencies.circe("generic-extras").value,
68-
Dependencies.circe("parser").value,
69-
Dependencies.jtsCore,
70-
Dependencies.scalaTest % Test
71-
))
54+
.settings(
55+
libraryDependencies ++= Seq(
56+
Dependencies.circe("core"),
57+
Dependencies.circe("generic"),
58+
Dependencies.circe("generic-extras"),
59+
Dependencies.circe("parser"),
60+
Dependencies.jtsCore,
61+
Dependencies.scalaTest % Test
62+
)
63+
)
7264
.dependsOn(core)
7365
.dependsOn(Environment.dependOnNative(native % Runtime): _*)
7466

7567
lazy val core = project
7668
.settings(commonSettings: _*)
7769
.settings(name := "pdal")
7870
.settings(javah / target := (native / nativeCompile / sourceDirectory).value / "include")
71+
.settings(sbtJniCoreScope := Compile)
7972
.settings(libraryDependencies += Dependencies.scalaTest % Test)
8073
.dependsOn(Environment.dependOnNative(native % Runtime): _*)
8174

@@ -84,6 +77,12 @@ lazy val native = project
8477
.settings(crossPaths := false)
8578
.settings(name := "pdal-native")
8679
.settings(nativeCompile / sourceDirectory := sourceDirectory.value)
80+
.settings(
81+
Compile / unmanagedPlatformDependentNativeDirectories := Seq(
82+
"x86_64-linux" -> target.value / "native/x86_64-linux/bin/",
83+
"x86_64-darwin" -> target.value / "native/x86_64-darwin/bin/"
84+
)
85+
)
8786
.settings(artifactName := { (sv: ScalaVersion, module: ModuleID, artifact: Artifact) =>
8887
artifact.name + "-" + nativePlatform.value + "-" + module.revision + "." + artifact.extension
8988
})

core-scala/src/main/scala/io/pdal/pipeline/ExprType.scala

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ object ExprType {
3737

3838
def fromName(name: String): ExprType =
3939
Try(FilterTypes.fromName(name))
40-
.getOrElse(Try(ReaderTypes.fromName(name))
41-
.getOrElse(Try(WriterTypes.fromName(name))
42-
.getOrElse(throw new Exception(s"ExprType $name is not supported."))))
40+
.getOrElse(
41+
Try(ReaderTypes.fromName(name))
42+
.getOrElse(
43+
Try(WriterTypes.fromName(name))
44+
.getOrElse(throw new Exception(s"ExprType $name is not supported."))
45+
)
46+
)
4347
}

0 commit comments

Comments
 (0)