Skip to content

Commit

Permalink
Plugins update & minor improvements (#78)
Browse files Browse the repository at this point in the history
* Plugins update

* publish scripts update and README.md

* Add LogLevel None support
  • Loading branch information
pomadchin authored Jan 19, 2024
1 parent 00a5994 commit f43f15d
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 13 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,5 @@ java/data
java/*.dylib
java/*.so
java/*dll

*.log
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version=3.7.17
version = 3.7.17
runner.dialect = scala3
align.openParenCallSite = true
align.openParenDefnSite = true
Expand Down
5 changes: 3 additions & 2 deletions native/src/JavaPipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <pdal/XMLSchema.hpp>
#endif

using pdal::LogLevel;
using pdal::LogPtr;
using pdal::MetadataNode;
using pdal::PointId;
Expand Down Expand Up @@ -227,8 +228,8 @@ void PipelineExecutor::setLogStream(std::ostream& strm)

void PipelineExecutor::setLogLevel(int level)
{
if (level < 0 || level > 8)
throw java_error("log level must be between 0 and 8!");
if (level < static_cast<int>(LogLevel::Error) || level > static_cast<int>(LogLevel::None))
throw java_error("log level must be between 0 and 9!");

m_logLevel = static_cast<pdal::LogLevel>(level);
setLogStream(m_logStream);
Expand Down
8 changes: 4 additions & 4 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
addSbtPlugin("com.github.sbt" % "sbt-jni" % "1.6.0")
addSbtPlugin("com.github.sbt" % "sbt-jni" % "1.7.0")
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.6.4")
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.9.0")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.11")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.0")
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.10.0")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2")
6 changes: 6 additions & 0 deletions scripts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# PDAL Java publish scripts

This is a set of not well maintained scripts that were used to publish PDAL from a Mac laptop.
Crosscompilation idea in this case is to build linux binaries in a docker conatiner, mac binaries locally, pack all the outputs into the jar.

Similar result is achieved via CI at this point.
2 changes: 1 addition & 1 deletion scripts/crosscompile-linux.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ docker run -it --rm \
-v $HOME/.ivy2:/root/.ivy2 \
-v $HOME/.sbt:/root/.sbt \
-v $HOME/.coursier/cache:/root/.cache/coursier \
daunnc/pdal-ubuntu:2.6.0 bash -c "cd ./pdal-java; ./sbt native/compile"
daunnc/pdal-ubuntu:2.6.0 bash -c "cd ./pdal-java; sbt native/compile"
10 changes: 9 additions & 1 deletion scripts/docker/2.6.0/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@ RUN set -ex && \
ENV JAVA_HOME /usr/lib/jvm/java-1.8.0-openjdk-amd6
RUN update-alternatives --set java `update-alternatives --list java | grep java-8`

RUN apt-get -y install bash gcc g++ cmake wget unzip gpg software-properties-common
RUN apt-get update && apt-get -y install bash gcc g++ cmake wget unzip gpg software-properties-common

# Install SBT
RUN apt-get install -y curl gnupg && \
echo 'deb https://repo.scala-sbt.org/scalasbt/debian all main' | tee /etc/apt/sources.list.d/sbt.list && \
echo 'deb https://repo.scala-sbt.org/scalasbt/debian /' | tee /etc/apt/sources.list.d/sbt_old.list && \
curl -sL 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823' | apt-key add - && \
apt-get update && \
apt-get install -y sbt

RUN ln -s /opt/conda/envs/pdal/include/pdal /usr/include/pdal && \
ln -s /usr/include /usr/lib/include && \
Expand Down
2 changes: 1 addition & 1 deletion scripts/publish-local-native.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash

./scripts/crosscompile-linux.sh && \
./sbt native/publishLocal
sbt native/publishLocal
2 changes: 1 addition & 1 deletion scripts/publish-local.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash

PDAL_DEPEND_ON_NATIVE=false ./sbt ";+core/publishLocal;+core-scala/publishLocal"
PDAL_DEPEND_ON_NATIVE=false sbt ";+core/publishLocal;+core-scala/publishLocal"
2 changes: 1 addition & 1 deletion scripts/publish-native.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash

./scripts/crosscompile-linux.sh && \
./sbt native/publishSigned
sbt native/publishSigned
2 changes: 1 addition & 1 deletion scripts/publish.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash

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

0 comments on commit f43f15d

Please sign in to comment.