Skip to content

Commit 1dc56f9

Browse files
authored
Merge pull request #583 from xdev-software/develop
Release
2 parents 9af5f59 + d30f5e7 commit 1dc56f9

File tree

154 files changed

+4364
-85
lines changed

Some content is hidden

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

154 files changed

+4364
-85
lines changed

.github/workflows/check-build.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ on:
2020
- 'assets/**'
2121

2222
env:
23-
PRIMARY_MAVEN_MODULE: ${{ github.event.repository.name }}
24-
DEMO_MAVEN_MODULE: ${{ github.event.repository.name }}-demo
23+
DEMO_MAVEN_MODULE: flow-demo
2524

2625
jobs:
2726
build:
@@ -42,6 +41,15 @@ jobs:
4241
distribution: ${{ matrix.distribution }}
4342
java-version: ${{ matrix.java }}
4443
cache: 'maven'
44+
45+
- name: Cache Vaadin prod bundles
46+
uses: actions/cache@v4
47+
with:
48+
path: |
49+
**/bundles/prod.bundle
50+
key: ${{ runner.os }}-vaadin-prod-bundles-${{ hashFiles('**/pom.xml') }}
51+
restore-keys: |
52+
${{ runner.os }}-vaadin-prod-bundles-
4553
4654
- name: Build with Maven
4755
run: ./mvnw -B clean package -Pproduction

.github/workflows/release.yml

Lines changed: 42 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ on:
44
push:
55
branches: [ master ]
66

7-
env:
8-
PRIMARY_MAVEN_MODULE: ${{ github.event.repository.name }}
9-
107
permissions:
118
contents: write
129
pull-requests: write
@@ -66,10 +63,9 @@ jobs:
6663
- name: Get version
6764
id: version
6865
run: |
69-
version=$(../mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)
66+
version=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)
7067
echo "release=$version" >> $GITHUB_OUTPUT
7168
echo "releasenumber=${version//[!0-9]/}" >> $GITHUB_OUTPUT
72-
working-directory: ${{ env.PRIMARY_MAVEN_MODULE }}
7369
7470
- name: Commit and Push
7571
run: |
@@ -94,8 +90,21 @@ jobs:
9490
Add the following lines to your pom:
9591
```XML
9692
<dependency>
97-
<groupId>software.xdev</groupId>
98-
<artifactId>${{ env.PRIMARY_MAVEN_MODULE }}</artifactId>
93+
<groupId>software.xdev.vaadin.maps-leaflet</groupId>
94+
<artifactId>flow</artifactId>
95+
<version>${{ steps.version.outputs.release }}</version>
96+
</dependency>
97+
```
98+
99+
You can also use the [BOM](https://github.com/${{ github.repository }}/tree/develop/bom) for easier dependency management.
100+
101+
### Plugins
102+
103+
You can also install [predefined plugins](https://github.com/${{ github.repository }}/tree/develop/plugins) using:
104+
```XML
105+
<dependency>
106+
<groupId>software.xdev.vaadin.maps-leaflet.plugins</groupId>
107+
<artifactId>...</artifactId>
99108
<version>${{ steps.version.outputs.release }}</version>
100109
</dependency>
101110
```
@@ -125,14 +134,18 @@ jobs:
125134
server-password: PACKAGES_CENTRAL_TOKEN
126135
gpg-passphrase: MAVEN_GPG_PASSPHRASE
127136
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Only import once
128-
129-
- name: Publish to GitHub Packages Central
130-
run: ../mvnw -B deploy -P publish -DskipTests -DaltDeploymentRepository=github-central::https://maven.pkg.github.com/xdev-software/central
131-
working-directory: ${{ env.PRIMARY_MAVEN_MODULE }}
137+
138+
- name: Publish to GitHub Packages
139+
run: |
140+
modules_block=$(grep -ozP '<modules>(\r|\n|.)*<\/modules>' 'pom.xml' | tr -d '\0')
141+
modules=($(echo $modules_block | grep -oP '(?<=<module>)[^<]+' | grep -v demo))
142+
printf -v modules_joined '%s,' "${modules[@]}"
143+
modules_arg=$(echo "${modules_joined%,}")
144+
./mvnw -B deploy -pl "$modules_arg" -am -T2C -P publish -DskipTests -DaltDeploymentRepository=github-central::https://maven.pkg.github.com/xdev-software/central
132145
env:
133146
PACKAGES_CENTRAL_TOKEN: ${{ secrets.PACKAGES_CENTRAL_TOKEN }}
134147
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
135-
148+
136149
- name: Set up JDK
137150
uses: actions/setup-java@v4
138151
with: # running setup-java again overwrites the settings.xml
@@ -144,12 +157,16 @@ jobs:
144157
gpg-passphrase: MAVEN_GPG_PASSPHRASE
145158

146159
- name: Publish to Central Portal
147-
run: ../mvnw -B deploy -P publish,publish-sonatype-central-portal -DskipTests
160+
run: |
161+
modules_block=$(grep -ozP '<modules>(\r|\n|.)*<\/modules>' 'pom.xml' | tr -d '\0')
162+
modules=($(echo $modules_block | grep -oP '(?<=<module>)[^<]+' | grep -v demo))
163+
printf -v modules_joined '%s,' "${modules[@]}"
164+
modules_arg=$(echo "${modules_joined%,}")
165+
./mvnw -B deploy -pl "$modules_arg" -am -T2C -P publish,publish-sonatype-central-portal -DskipTests
148166
env:
149167
MAVEN_CENTRAL_USERNAME: ${{ secrets.SONATYPE_MAVEN_CENTRAL_PORTAL_USERNAME }}
150168
MAVEN_CENTRAL_TOKEN: ${{ secrets.SONATYPE_MAVEN_CENTRAL_PORTAL_TOKEN }}
151169
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
152-
working-directory: ${{ env.PRIMARY_MAVEN_MODULE }}
153170

154171
publish-pages:
155172
runs-on: ubuntu-latest
@@ -172,14 +189,22 @@ jobs:
172189
cache: 'maven'
173190

174191
- name: Build site
175-
run: ../mvnw -B compile site -DskipTests -T2C
176-
working-directory: ${{ env.PRIMARY_MAVEN_MODULE }}
192+
run: ./mvnw -B compile site -DskipTests -T2C
193+
194+
- name: Aggregate site
195+
run: |
196+
modules=($(grep -ozP '(?<=module>)[^<]+' 'pom.xml' | tr -d '\0'))
197+
for m in "${modules[@]}"
198+
do
199+
echo "$m/target/site -> ./target/site/$m"
200+
cp -r $m/target/site ./target/site/$m
201+
done
177202
178203
- name: Deploy to Github pages
179204
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4
180205
with:
181206
github_token: ${{ secrets.GITHUB_TOKEN }}
182-
publish_dir: ./${{ env.PRIMARY_MAVEN_MODULE }}/target/site
207+
publish_dir: ./target/site
183208
force_orphan: true
184209

185210
after-release:

.github/workflows/test-deploy.yml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,18 @@ jobs:
2222
server-password: PACKAGES_CENTRAL_TOKEN
2323
gpg-passphrase: MAVEN_GPG_PASSPHRASE
2424
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Only import once
25-
26-
- name: Publish to GitHub Packages Central
27-
run: ../mvnw -B deploy -P publish -DskipTests -DaltDeploymentRepository=github-central::https://maven.pkg.github.com/xdev-software/central
28-
working-directory: ${{ env.PRIMARY_MAVEN_MODULE }}
25+
26+
- name: Publish to GitHub Packages
27+
run: |
28+
modules_block=$(grep -ozP '<modules>(\r|\n|.)*<\/modules>' 'pom.xml' | tr -d '\0')
29+
modules=($(echo $modules_block | grep -oP '(?<=<module>)[^<]+' | grep -v demo))
30+
printf -v modules_joined '%s,' "${modules[@]}"
31+
modules_arg=$(echo "${modules_joined%,}")
32+
./mvnw -B deploy -pl "$modules_arg" -am -T2C -P publish -DskipTests -DaltDeploymentRepository=github-central::https://maven.pkg.github.com/xdev-software/central
2933
env:
3034
PACKAGES_CENTRAL_TOKEN: ${{ secrets.PACKAGES_CENTRAL_TOKEN }}
3135
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
32-
36+
3337
- name: Set up JDK
3438
uses: actions/setup-java@v4
3539
with: # running setup-java again overwrites the settings.xml
@@ -41,8 +45,12 @@ jobs:
4145
gpg-passphrase: MAVEN_GPG_PASSPHRASE
4246

4347
- name: Publish to Central Portal
44-
run: ../mvnw -B deploy -P publish,publish-sonatype-central-portal -DskipTests
45-
working-directory: ${{ env.PRIMARY_MAVEN_MODULE }}
48+
run: |
49+
modules_block=$(grep -ozP '<modules>(\r|\n|.)*<\/modules>' 'pom.xml' | tr -d '\0')
50+
modules=($(echo $modules_block | grep -oP '(?<=<module>)[^<]+' | grep -v demo))
51+
printf -v modules_joined '%s,' "${modules[@]}"
52+
modules_arg=$(echo "${modules_joined%,}")
53+
./mvnw -B deploy -pl "$modules_arg" -am -T2C -P publish,publish-sonatype-central-portal -DskipTests
4654
env:
4755
MAVEN_CENTRAL_USERNAME: ${{ secrets.SONATYPE_MAVEN_CENTRAL_PORTAL_USERNAME }}
4856
MAVEN_CENTRAL_TOKEN: ${{ secrets.SONATYPE_MAVEN_CENTRAL_PORTAL_TOKEN }}

.gitignore

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,9 @@ tsconfig.json
4949
types.d.ts
5050
vite.config.ts
5151
vite.generated.ts
52-
/*/src/main/frontend/generated/
53-
/*/src/main/frontend/index.html
54-
/*/src/main/dev-bundle/
55-
/*/src/main/bundles/
52+
**/src/main/frontend/generated/
53+
**/src/main/frontend/index.html
54+
**/src/main/bundles/
5655
*.lock
5756

5857

.run/Run Demo.run.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<component name="ProjectRunConfigurationManager">
22
<configuration default="false" name="Run Demo" type="Application" factoryName="Application">
33
<option name="MAIN_CLASS_NAME" value="software.xdev.vaadin.Application" />
4-
<module name="vaadin-maps-leaflet-flow-demo" />
4+
<module name="flow-demo" />
55
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
66
<extension name="coverage">
77
<pattern>

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# 5.0.0
2+
3+
> [!WARNING]
4+
> Breaking change - Artifact relocation: <br/>
5+
> ``software.xdev:vaadin-maps-leaflet-flow`` was moved to ``software.xdev.vaadin.maps-leaflet:flow``
6+
7+
* Introduced support for Leaflet plugins #307
8+
* Plugins can be installed from ``software.xdev.vaadin.maps-leaflet.plugins:<artifactId>``
9+
* The following [plugins](./plugins/) are currently available:
10+
* geoman
11+
* leaflet-markercluster
12+
* maplibre-gl-leaflet
13+
* You can also use the [``bom``](./bom/) for easier dependency management
14+
115
# 4.6.4
216
* Updated dependencies
317

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@
44
![Vaadin 24+](https://img.shields.io/badge/Vaadin%20Platform/Flow-24+-00b4f0)
55

66
# LeafletMap for Vaadin
7-
A Vaadin Flow Java API for [Leaflet](https://leafletjs.com/)
7+
A Vaadin Flow Java API for [Leaflet](https://leafletjs.com/).
88

99
![demo](assets/demo.png)
1010

1111
## Usage
1212

1313
This API wraps the Leaflet API in a Vaadin friendly way.<br/>It uses a similar structure (classes, methods) as the [Leaflet JavaScript API](https://leafletjs.com/reference.html).
1414

15-
To get started it's recommended to have a look at the [demo](./vaadin-maps-leaflet-flow-demo), notably the [minimalistic example](./vaadin-maps-leaflet-flow-demo/src/main/java/software/xdev/vaadin/maps/leaflet/flow/demo/MinimalisticDemo.java).
15+
To get started it's recommended to have a look at the [demo](./flow-demo), notably the [minimalistic example](./flow-demo/src/main/java/software/xdev/vaadin/maps/leaflet/flow/demo/MinimalisticDemo.java).
1616

1717
> [!NOTE]
1818
> **The API only supports sending instructions to the client**<br/>
1919
> Due to data integrity retrieving client-side data (that can be modified by users) is not supported.
2020
>
21-
> Event listeners can still be registered but this needs to be done manually. An example is available [in the demo](./vaadin-maps-leaflet-flow-demo/src/main/java/software/xdev/vaadin/maps/leaflet/flow/demo/EventDemo.java).
21+
> Event listeners can still be registered but this needs to be done manually. An example is available [in the demo](./flow-demo/src/main/java/software/xdev/vaadin/maps/leaflet/flow/demo/EventDemo.java).
2222
>
23-
> <details><summary>The following code snippet is a simplification of an even more <a href="./vaadin-maps-leaflet-flow-demo/src/main/java/software/xdev/vaadin/maps/leaflet/flow/demo/ComplexDemo.java#L251">complex example</a> which sends (unvalidated!) client side data back to the server (click to expand)</summary>
23+
> <details><summary>The following code snippet is a simplification of an even more <a href="./flow-demo/src/main/java/software/xdev/vaadin/maps/leaflet/flow/demo/ComplexDemo.java#L251">complex example</a> which sends (unvalidated!) client side data back to the server (click to expand)</summary>
2424
>
2525
> ```java
2626
> this.map.on("click", "e => document.getElementById('" + ID + "').$server.mapClicked(e.latlng.lat, e.latng.lng)");
@@ -33,12 +33,16 @@ To get started it's recommended to have a look at the [demo](./vaadin-maps-leafl
3333
> ```
3434
> </details>
3535
36+
### Plugins
37+
38+
We also offer various [predefined plugins](./plugins/) which you can utilize to enhance your Leaflet experience.
39+
3640
## Installation
3741
[Installation guide of the latest release](https://github.com/xdev-software/vaadin-maps-leaflet-flow/releases/latest#Installation)
3842
3943
#### Static resources
4044
Please note that Leaflet uses a few default icons for various components (e.g. Markers).<br/>
41-
These are also shipped with the library and can be found inside [``META-INF/resources``](./vaadin-maps-leaflet-flow/src/main/resources/META-INF/resources/).<br/>
45+
These are also shipped with the library and can be found inside [``META-INF/resources``](./flow/src/main/resources/META-INF/resources/).<br/>
4246
You might have to fine tune your security configuration to allow these.
4347
4448
#### Compatibility with Vaadin
@@ -51,7 +55,7 @@ You might have to fine tune your security configuration to allow these.
5155
5256
## Run the Demo
5357
* Checkout the repo
54-
* Run ``mvn install && mvn -f vaadin-maps-leaflet-flow-demo spring-boot:run``
58+
* Run ``mvn install && mvn -f flow-demo spring-boot:run``
5559
* Open http://localhost:8080
5660
5761
<details>

bom/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# BOM - [Bill of Materials](https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Bill_of_Materials_.28BOM.29_POMs)
2+
3+
Add it like this
4+
```xml
5+
<dependencyManagement>
6+
<dependencies>
7+
<dependency>
8+
<groupId>software.xdev.vaadin.maps-leaflet</groupId>
9+
<artifactId>bom</artifactId>
10+
<version>...</version>
11+
<type>pom</type>
12+
<scope>import</scope>
13+
</dependency>
14+
</dependencies>
15+
</dependencyManagement>
16+
```

0 commit comments

Comments
 (0)