From 40d041e3444cb1e097d441af9202d3858a09d805 Mon Sep 17 00:00:00 2001 From: Jochen Topf Date: Sat, 9 Jan 2021 09:47:02 +0100 Subject: [PATCH 1/3] Revert "Delete obsolete Ant build file" This reverts commit fa86a8a640d5a77fb8264957501b1c82a6957c7a. Ant build is still used by Debian --- build.xml | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 build.xml diff --git a/build.xml b/build.xml new file mode 100644 index 0000000..31c1cbe --- /dev/null +++ b/build.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From d9ee34140d97494cf973ba5e5ed3898b5bc2823d Mon Sep 17 00:00:00 2001 From: Jochen Topf Date: Sat, 9 Jan 2021 09:54:12 +0100 Subject: [PATCH 2/3] Revert "Delete obsolete build.sh" This reverts commit 33e940238b627d33ac3b71f2c9e5c8939d4b09bf. Ant build is still used by Debian --- build.sh | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 build.sh diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..06bfa27 --- /dev/null +++ b/build.sh @@ -0,0 +1,2 @@ +protoc --java_out=generated.java src/osmformat.proto +protoc --java_out=generated.java src/fileformat.proto From 0e99a6fef2037dd0b06fea7161c31c5f691e17b9 Mon Sep 17 00:00:00 2001 From: Jochen Topf Date: Sat, 9 Jan 2021 10:09:29 +0100 Subject: [PATCH 3/3] Document build with Ant --- .github/workflows/java.yml | 42 +++++++++++++++++++++++++++++++++++--- README.md | 17 ++++++++++++++- 2 files changed, 55 insertions(+), 4 deletions(-) diff --git a/.github/workflows/java.yml b/.github/workflows/java.yml index bb3952f..f244c20 100644 --- a/.github/workflows/java.yml +++ b/.github/workflows/java.yml @@ -3,9 +3,8 @@ name: Java CI on: [push, pull_request] jobs: - build: - runs-on: ubuntu-latest - + maven-ubuntu18: + runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v2 - run: sudo apt-get install protobuf-compiler @@ -15,3 +14,40 @@ jobs: java-version: 1.8 - name: Build with Maven run: mvn -B package --file pom.xml + + maven-ubuntu20: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - run: sudo apt-get install protobuf-compiler + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Build with Maven + run: mvn -B package --file pom.xml + + ant-ubuntu18: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - run: sudo apt-get install protobuf-compiler libprotobuf-java + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Build with Ant + run: ant + + ant-ubuntu20: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - run: sudo apt-get install protobuf-compiler libprotobuf-java + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Build with Ant + run: ant + diff --git a/README.md b/README.md index 5460b2f..1d2a84e 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,8 @@ something more complete see [libosmium](https://osmcode.org/libosmium/). ## Java Version +### Building with Maven + We publish the Java library to [Maven Central](https://search.maven.org/): ```xml @@ -34,8 +36,21 @@ To build the Java library run: mvn package ``` -For a Java usage example, see [`ReadFileTest`](https://github.com/openstreetmap/OSM-binary/blob/master/test.java/crosby/binary/ReadFileTest.java) +For a Java usage example, see +[`ReadFileTest`](https://github.com/openstreetmap/OSM-binary/blob/master/test.java/crosby/binary/ReadFileTest.java). +### Building with Ant + +If you can not use Maven for some reason you can use the +[Ant](https://ant.apache.org/) instead: + +```sh +ant +``` + +This will build `osmpbf.jar` in the main directory. + +This build is also used for Debian packaging. ## C++ Version