Skip to content

Commit f43f15d

Browse files
authored
Plugins update & minor improvements (#78)
* Plugins update * publish scripts update and README.md * Add LogLevel None support
1 parent 00a5994 commit f43f15d

11 files changed

+30
-13
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,5 @@ java/data
5757
java/*.dylib
5858
java/*.so
5959
java/*dll
60+
61+
*.log

.scalafmt.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version=3.7.17
1+
version = 3.7.17
22
runner.dialect = scala3
33
align.openParenCallSite = true
44
align.openParenDefnSite = true

native/src/JavaPipeline.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include <pdal/XMLSchema.hpp>
3737
#endif
3838

39+
using pdal::LogLevel;
3940
using pdal::LogPtr;
4041
using pdal::MetadataNode;
4142
using pdal::PointId;
@@ -227,8 +228,8 @@ void PipelineExecutor::setLogStream(std::ostream& strm)
227228

228229
void PipelineExecutor::setLogLevel(int level)
229230
{
230-
if (level < 0 || level > 8)
231-
throw java_error("log level must be between 0 and 8!");
231+
if (level < static_cast<int>(LogLevel::Error) || level > static_cast<int>(LogLevel::None))
232+
throw java_error("log level must be between 0 and 9!");
232233

233234
m_logLevel = static_cast<pdal::LogLevel>(level);
234235
setLogStream(m_logStream);

project/plugins.sbt

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
addSbtPlugin("com.github.sbt" % "sbt-jni" % "1.6.0")
1+
addSbtPlugin("com.github.sbt" % "sbt-jni" % "1.7.0")
22
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.6.4")
3-
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.9.0")
4-
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.11")
5-
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.0")
3+
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.10.0")
4+
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12")
5+
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2")

scripts/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# PDAL Java publish scripts
2+
3+
This is a set of not well maintained scripts that were used to publish PDAL from a Mac laptop.
4+
Crosscompilation idea in this case is to build linux binaries in a docker conatiner, mac binaries locally, pack all the outputs into the jar.
5+
6+
Similar result is achieved via CI at this point.

scripts/crosscompile-linux.sh

100644100755
+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ docker run -it --rm \
66
-v $HOME/.ivy2:/root/.ivy2 \
77
-v $HOME/.sbt:/root/.sbt \
88
-v $HOME/.coursier/cache:/root/.cache/coursier \
9-
daunnc/pdal-ubuntu:2.6.0 bash -c "cd ./pdal-java; ./sbt native/compile"
9+
daunnc/pdal-ubuntu:2.6.0 bash -c "cd ./pdal-java; sbt native/compile"

scripts/docker/2.6.0/ubuntu/Dockerfile

+9-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,15 @@ RUN set -ex && \
1010
ENV JAVA_HOME /usr/lib/jvm/java-1.8.0-openjdk-amd6
1111
RUN update-alternatives --set java `update-alternatives --list java | grep java-8`
1212

13-
RUN apt-get -y install bash gcc g++ cmake wget unzip gpg software-properties-common
13+
RUN apt-get update && apt-get -y install bash gcc g++ cmake wget unzip gpg software-properties-common
14+
15+
# Install SBT
16+
RUN apt-get install -y curl gnupg && \
17+
echo 'deb https://repo.scala-sbt.org/scalasbt/debian all main' | tee /etc/apt/sources.list.d/sbt.list && \
18+
echo 'deb https://repo.scala-sbt.org/scalasbt/debian /' | tee /etc/apt/sources.list.d/sbt_old.list && \
19+
curl -sL 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823' | apt-key add - && \
20+
apt-get update && \
21+
apt-get install -y sbt
1422

1523
RUN ln -s /opt/conda/envs/pdal/include/pdal /usr/include/pdal && \
1624
ln -s /usr/include /usr/lib/include && \

scripts/publish-local-native.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env bash
22

33
./scripts/crosscompile-linux.sh && \
4-
./sbt native/publishLocal
4+
sbt native/publishLocal

scripts/publish-local.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/usr/bin/env bash
22

3-
PDAL_DEPEND_ON_NATIVE=false ./sbt ";+core/publishLocal;+core-scala/publishLocal"
3+
PDAL_DEPEND_ON_NATIVE=false sbt ";+core/publishLocal;+core-scala/publishLocal"

scripts/publish-native.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env bash
22

33
./scripts/crosscompile-linux.sh && \
4-
./sbt native/publishSigned
4+
sbt native/publishSigned

scripts/publish.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/usr/bin/env bash
22

3-
PDAL_DEPEND_ON_NATIVE=false ./sbt ";+core;publishSigned;+core-scala/publishSigned"
3+
PDAL_DEPEND_ON_NATIVE=false sbt ";+core;publishSigned;+core-scala/publishSigned"

0 commit comments

Comments
 (0)