Require minimum java 17 (#477)

flatgeobuf
Michael Barry 2023-02-06 06:38:16 -05:00 zatwierdzone przez GitHub
rodzic db3e8228ae
commit d5336efcae
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
8 zmienionych plików z 115 dodań i 113 usunięć

Wyświetl plik

@ -15,17 +15,17 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'
cache: 'maven'
- name: Ensure code formatted with mvn spotless:apply
run: ./mvnw -DskipTests --batch-mode -no-transfer-progress spotless:check
- uses: actions/checkout@v3
with:
submodules: true
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'
cache: 'maven'
- name: Ensure code formatted with mvn spotless:apply
run: ./mvnw -DskipTests --batch-mode -no-transfer-progress spotless:check
build:
name: Java ${{ matrix.jdk }} / ${{ matrix.os }} ${{ matrix.args }}
@ -36,33 +36,33 @@ jobs:
os: [ ubuntu-latest, macos-latest, windows-latest ]
jdk: [ 17 ]
include:
- os: ubuntu-latest
jdk: 16
- os: ubuntu-latest
jdk: 18
- os: ubuntu-latest
jdk: 17
args: "-DargLine='-Duser.language=fr -Duser.country=FR'"
- os: ubuntu-latest
jdk: 17
args: "-DargLine='-Duser.language=fr -Duser.country=FR'"
- os: ubuntu-latest
jdk: 18
- os: ubuntu-latest
jdk: 19
runs-on: ${{ matrix.os }}
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Set up JDK ${{ matrix.jdk }}
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.jdk }}
distribution: 'temurin'
cache: 'maven'
# Skip spotless since that gets checked in a separate task
- name: Build with mvnw (linux/mac)
if: ${{ !contains(matrix.os, 'windows') }}
run: ./mvnw ${{matrix.args}} -Dspotless.check.skip --batch-mode -no-transfer-progress package verify jib:buildTar --file pom.xml
- name: Build with mvnw.cmd (windows)
if: ${{ contains(matrix.os, 'windows') }}
run: mvnw.cmd ${{matrix.args}} -Dspotless.check.skip --batch-mode -no-transfer-progress package verify jib:buildTar --file pom.xml
shell: cmd
- uses: actions/checkout@v3
with:
submodules: true
- name: Set up JDK ${{ matrix.jdk }}
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.jdk }}
distribution: 'temurin'
cache: 'maven'
# Skip spotless since that gets checked in a separate task
- name: Build with mvnw (linux/mac)
if: ${{ !contains(matrix.os, 'windows') }}
run: ./mvnw ${{matrix.args}} -Dspotless.check.skip --batch-mode -no-transfer-progress package verify jib:buildTar --file pom.xml
- name: Build with mvnw.cmd (windows)
if: ${{ contains(matrix.os, 'windows') }}
run: mvnw.cmd ${{matrix.args}} -Dspotless.check.skip --batch-mode -no-transfer-progress package verify jib:buildTar --file pom.xml
shell: cmd
examples:
name: Example project
@ -70,85 +70,85 @@ jobs:
timeout-minutes: 15
continue-on-error: true
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'
- name: Build and test
run: mvn --batch-mode -no-transfer-progress package --file standalone.pom.xml
working-directory: planetiler-examples
- name: Find jar
run: mv target/*with-deps.jar ./run.jar
working-directory: planetiler-examples
- name: Run
run: java -jar run.jar --osm-path=../planetiler-core/src/test/resources/monaco-latest.osm.pbf --mbtiles=data/out.mbtiles
working-directory: planetiler-examples
- name: Verify
run: java -cp run.jar com.onthegomap.planetiler.mbtiles.Verify data/out.mbtiles
working-directory: planetiler-examples
- uses: actions/checkout@v3
with:
submodules: true
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'
- name: Build and test
run: mvn --batch-mode -no-transfer-progress package --file standalone.pom.xml
working-directory: planetiler-examples
- name: Find jar
run: mv target/*with-deps.jar ./run.jar
working-directory: planetiler-examples
- name: Run
run: java -jar run.jar --osm-path=../planetiler-core/src/test/resources/monaco-latest.osm.pbf --mbtiles=data/out.mbtiles
working-directory: planetiler-examples
- name: Verify
run: java -cp run.jar com.onthegomap.planetiler.mbtiles.Verify data/out.mbtiles
working-directory: planetiler-examples
run:
name: Build / Run
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Cache data/sources
uses: ./.github/cache-sources-action
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'
cache: 'maven'
- uses: actions/checkout@v3
with:
submodules: true
- name: Cache data/sources
uses: ./.github/cache-sources-action
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'
cache: 'maven'
- name: Build this branch
run: ./mvnw -DskipTests -Dimage.version=CI_ONLY --batch-mode -no-transfer-progress package jib:dockerBuild --file pom.xml
- name: Build this branch
run: ./mvnw -DskipTests -Dimage.version=CI_ONLY --batch-mode -no-transfer-progress package jib:dockerBuild --file pom.xml
- name: 'Upload artifact'
uses: actions/upload-artifact@v3
with:
name: planetiler-build
path: planetiler-dist/target/*with-deps.jar
- name: 'Upload artifact'
uses: actions/upload-artifact@v3
with:
name: planetiler-build
path: planetiler-dist/target/*with-deps.jar
- name: Download data (java)
run: java -jar planetiler-dist/target/*with-deps.jar --only-download --area=monaco
- name: Download data (java)
run: java -jar planetiler-dist/target/*with-deps.jar --only-download --area=monaco
- name: Download wikidata (java)
run: java -jar planetiler-dist/target/*with-deps.jar --only-fetch-wikidata --area=monaco
- name: Download wikidata (java)
run: java -jar planetiler-dist/target/*with-deps.jar --only-fetch-wikidata --area=monaco
- name: Verify build
run: ./scripts/test-release.sh CI_ONLY
env:
SKIP_EXAMPLE_PROJECT: true
- name: Verify build
run: ./scripts/test-release.sh CI_ONLY
env:
SKIP_EXAMPLE_PROJECT: true
quickstart:
name: Quickstart script
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Cache data/sources
uses: ./.github/cache-sources-action
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'
cache: 'maven'
- uses: actions/checkout@v3
with:
submodules: true
- name: Cache data/sources
uses: ./.github/cache-sources-action
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'
cache: 'maven'
- name: quickstart.sh --build
run: rm -rf data/output.mbtiles data/tmp && ./quickstart.sh monaco --build && ./scripts/check-monaco.sh data/output.mbtiles
- name: quickstart.sh --jar
run: rm -rf data/output.mbtiles data/tmp && ./quickstart.sh monaco --jar && ./scripts/check-monaco.sh data/output.mbtiles
# run docker last since it creates temp dirs with root user
- name: quickstart.sh --docker
run: rm -rf data/output.mbtiles data/tmp && ./quickstart.sh monaco --docker && ./scripts/check-monaco.sh data/output.mbtiles
- name: quickstart.sh --build
run: rm -rf data/output.mbtiles data/tmp && ./quickstart.sh monaco --build && ./scripts/check-monaco.sh data/output.mbtiles
- name: quickstart.sh --jar
run: rm -rf data/output.mbtiles data/tmp && ./quickstart.sh monaco --jar && ./scripts/check-monaco.sh data/output.mbtiles
# run docker last since it creates temp dirs with root user
- name: quickstart.sh --docker
run: rm -rf data/output.mbtiles data/tmp && ./quickstart.sh monaco --docker && ./scripts/check-monaco.sh data/output.mbtiles

Wyświetl plik

@ -11,7 +11,7 @@ Pull requests are welcome! Any pull request should:
To set up your local development environment:
- Fork the repo [setup submodules](README.md#git-submodules)
- Install Java 16 or later. You can download Java manually from [Adoptium](https://adoptium.net/installation.html) or
- Install Java 17 or later. You can download Java manually from [Adoptium](https://adoptium.net/installation.html) or
use:
- [Windows installer](https://adoptium.net/installation.html#windows-msi)
- [macOS installer](https://adoptium.net/installation.html#macos-pkg) (or `brew install --cask temurin`,
@ -54,7 +54,7 @@ Troubleshooting:
- If any java source files show "Cannot resolve symbol..." errors for Planetiler classes, you might need to
select: `File -> Invalidate Caches... -> Just Restart`.
- If you see a "Project JDK is not defined" error, then choose `Setup SDK` and point IntelliJ at the Java 16 or later
- If you see a "Project JDK is not defined" error, then choose `Setup SDK` and point IntelliJ at the Java 17 or later
installed on your system
### Visual Studio Code

Wyświetl plik

@ -1,8 +1,9 @@
# Generating a Map of the World
To generate a map of the world using the built-in [OpenMapTiles profile](https://github.com/openmaptiles/planetiler-openmaptiles), you will need a
To generate a map of the world using the
built-in [OpenMapTiles profile](https://github.com/openmaptiles/planetiler-openmaptiles), you will need a
machine with
Java 16 or later installed and at least 10x as much disk space and at least 0.5x as much RAM as the `planet.osm.pbf`
Java 17 or later installed and at least 10x as much disk space and at least 0.5x as much RAM as the `planet.osm.pbf`
file you start from. All testing has been done using Digital Ocean droplets with dedicated
vCPUs ([referral link](https://m.do.co/c/a947e99aab25)) and OpenJDK 17 installed through `apt`. Planetiler splits work
among available CPUs so the more you have, the less time it takes.
@ -21,7 +22,8 @@ First decide where to get the `planet.osm.pbf` file:
osmium apply-changes daylight.osm.pbf admin.osc.bz2 <buildings.osc.bz2, ...> -o everything.osm.pbf
osmium renumber everything.osm.pbf -o planet.osm.pbf
```
- If you would like to update your `planet.osm.pbf` file to the latest changes from OpenStreetMap, you can use [pyosmium-up-to-date](https://docs.osmcode.org/pyosmium/latest/tools_uptodate.html):
- If you would like to update your `planet.osm.pbf` file to the latest changes from OpenStreetMap, you can
use [pyosmium-up-to-date](https://docs.osmcode.org/pyosmium/latest/tools_uptodate.html):
```bash
pyosmium-up-to-date --size 20000 -v planet.osm.pbf

Wyświetl plik

@ -32,7 +32,7 @@ the [OpenStreetMap Americana Project](https://github.com/ZeLonewolf/openstreetma
To generate a map of an area using the [OpenMapTiles profile](https://github.com/openmaptiles/planetiler-openmaptiles),
you will need:
- Java 16+ (see [CONTRIBUTING.md](CONTRIBUTING.md)) or [Docker](https://docs.docker.com/get-docker/)
- Java 17+ (see [CONTRIBUTING.md](CONTRIBUTING.md)) or [Docker](https://docs.docker.com/get-docker/)
- at least 1GB of free disk space plus 5-10x the size of the `.osm.pbf` file
- at least 0.5x as much free RAM as the input `.osm.pbf` file size

Wyświetl plik

@ -4,7 +4,7 @@ This is a minimal example project that shows how to create custom maps with Plan
Requirements:
- Java 16+ (see [CONTIRBUTING.md](../CONTRIBUTING.md))
- Java 17+ (see [CONTIRBUTING.md](../CONTRIBUTING.md))
- on mac: `brew install --cask temurin`
- [Maven](https://maven.apache.org/install.html)
- on mac: `brew install maven`

Wyświetl plik

@ -9,8 +9,8 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>16</maven.compiler.source>
<maven.compiler.target>16</maven.compiler.target>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<planetiler.version>0.6-SNAPSHOT</planetiler.version>
<junit.version>5.9.2</junit.version>
<!-- Replace this with the main class for the profile you add -->

Wyświetl plik

@ -17,8 +17,8 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>16</maven.compiler.source>
<maven.compiler.target>16</maven.compiler.target>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<maven.source.excludeResources>true</maven.source.excludeResources>
<jackson.version>2.14.2</jackson.version>
<junit.version>5.9.2</junit.version>
@ -203,7 +203,7 @@
</execution>
</executions>
</plugin>
<!-- require building with jdk 16 -->
<!-- require building with jdk 17 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
@ -217,7 +217,7 @@
<configuration>
<rules>
<requireJavaVersion>
<version>16</version>
<version>17</version>
</requireJavaVersion>
</rules>
</configuration>

Wyświetl plik

@ -116,7 +116,7 @@ function check_java_version() {
else
OUTPUT="$($JAVA -jar "$1" --help 2>&1 || echo OK)"
if [[ "$OUTPUT" =~ "UnsupportedClassVersionError" ]]; then
echo "Wrong version of java installed, need at least 16 but found:"
echo "Wrong version of java installed, need at least 17 but found:"
$JAVA --version
exit 1
fi