Skip to content

Commit

Permalink
Merge pull request #440 from xdev-software/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
AB-xdev authored Sep 3, 2024
2 parents 01240a5 + e9c1143 commit 08cf90f
Show file tree
Hide file tree
Showing 24 changed files with 563 additions and 69 deletions.
3 changes: 3 additions & 0 deletions .config/pmd/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@
<!-- Prohibits singleton pattern -->
<exclude name="MutableStaticState"/>

<!-- Checks LoC, already handled by Checkstyle -->
<exclude name="NcssCount"/>

<!-- Some override methods or Junit require this -->
<exclude name="SignatureDeclareThrowsException"/>

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ jobs:
cache: 'maven'

- name: Build site
run: ../mvnw -B site -DskipTests
run: ../mvnw -B compile site -DskipTests -T2C
working-directory: ${{ env.PRIMARY_MAVEN_MODULE }}

- name: Deploy to Github pages
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
- '.idea/**'
- 'assets/**'
pull_request:
types: [opened, synchronize, reopened]
branches: [ develop ]
paths-ignore:
- '**.md'
- '.config/**'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}

- name: Publish to OSSRH
run: ../mvnw -B deploy -Possrh
run: ../mvnw -B deploy -Possrh -DskipTests
working-directory: ${{ env.PRIMARY_MAVEN_MODULE }}
env:
MAVEN_CENTRAL_USERNAME: ${{ secrets.S01_OSS_SONATYPE_MAVEN_USERNAME }}
Expand Down
2 changes: 1 addition & 1 deletion .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.8/apache-maven-3.9.8-bin.zip
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 4.4.0
* Added support for [GeoJSON](https://leafletjs.com/reference.html#geojson) and [FeatureGroup](https://leafletjs.com/reference.html#featuregroup) #438
* Add "draggable" property to LMarkerOptions #413 (thanks to @ChristianHoesel)

## 4.3.0
* Updated to Vaadin 24.4
* Deduplicated ``tLMapZoomPanOptions``
Expand Down
28 changes: 28 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,31 @@ If the ``develop`` is ready for release, create a pull request to the ``master``
When the release is finished do the following:
* Merge the auto-generated PR (with the incremented version number) back into the ``develop``
* Ensure that [Vaadin Directory](https://vaadin.com/directory) syncs the update and maybe update the component / version there

### Release failures

There are 2 modes of release failure:
1. The remote server was e.g. down and non of the artifacts got published
2. There was a build failure during release and only parts of the artifacts got released

In case 1 we can re-release the existing version,<br/>in case 2 we have to release a new version when we can't get the artifacts deleted (as is the case with Maven Central)

#### How-to: Re-Releasing an existing version

1. Delete the release on GitHub
2. Delete the release Git tag from the repo (locally and remote!)
3. Delete the ``master``-Branch and re-create it from the ``develop`` branch (or reset it to the state before the release-workflow commits have been done)
* This requires __temporarily__ removing the branch protection
* Once this was done a new release is triggered immediately!

#### How-to: Releasing a new version

1. Merge the ``master`` branch back into ``develop`` (or another temporary branch)
2. Make sure all master branch versions are prepared for a new release<br/>e.g. if the broken release was ``1.0.0`` the version should now be at ``1.0.1-SNAPSHOT`` - the ``SNAPSHOT`` is important for the workflow!
3. Mark the broken release as broken e.g. inside the Changelog, GitHub Release page, etc.<br/>
You can use something like this:
```
> [!WARNING]
> This release is broken as my cat accidentally clicked the abort button during the process
```
4. Merge the changes back into the ``master`` branch to trigger a new release
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ To get started it's recommended to have a look at the [demo](./vaadin-maps-leafl
> [!NOTE]
> **The API only supports sending instructions to the client**<br/>
> Due to data integrity retrieving client-side data (that can be modified by users) is not supported.
> * Event listeners can still be registered but this needs to be done manually.<br/>[An example is available in the demo](https://github.com/xdev-software/vaadin-maps-leaflet-flow/blob/5a008511935105ea977187112cd0053c7de33e19/vaadin-maps-leaflet-flow-demo/src/main/java/software/xdev/vaadin/maps/leaflet/flow/demo/ComplexDemo.java#L223).
> * Event listeners can still be registered but this needs to be done manually.<br/>[An example is available in the demo](./vaadin-maps-leaflet-flow-demo/src/main/java/software/xdev/vaadin/maps/leaflet/flow/demo/EventDemo.java).
## Installation
[Installation guide of the latest release](https://github.com/xdev-software/vaadin-maps-leaflet-flow/releases/latest#Installation)
Expand Down
14 changes: 7 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>software.xdev</groupId>
<artifactId>vaadin-maps-leaflet-flow-root</artifactId>
<version>4.3.1-SNAPSHOT</version>
<version>4.4.0-SNAPSHOT</version>
<packaging>pom</packaging>

<organization>
Expand Down Expand Up @@ -40,12 +40,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.4.0</version>
<version>3.5.0</version>
<dependencies>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>10.17.0</version>
<version>10.18.1</version>
</dependency>
</dependencies>
<configuration>
Expand All @@ -70,7 +70,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.23.0</version>
<version>3.25.0</version>
<configuration>
<includeTests>true</includeTests>
<printFailingErrors>true</printFailingErrors>
Expand All @@ -82,12 +82,12 @@
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-core</artifactId>
<version>7.2.0</version>
<version>7.5.0</version>
</dependency>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-java</artifactId>
<version>7.2.0</version>
<version>7.5.0</version>
</dependency>
</dependencies>
</plugin>
Expand All @@ -99,7 +99,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>3.4.0</version>
<version>3.5.0</version>
</plugin>
</plugins>
</reporting>
Expand Down
10 changes: 10 additions & 0 deletions renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@
"maven"
],
"enabled": false
},
{
"description": "Group net.sourceforge.pmd",
"matchPackagePatterns": [
"^net.sourceforge.pmd"
],
"datasources": [
"maven"
],
"groupName": "net.sourceforge.pmd"
}
]
}
8 changes: 4 additions & 4 deletions vaadin-maps-leaflet-flow-demo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
<parent>
<groupId>software.xdev</groupId>
<artifactId>vaadin-maps-leaflet-flow-root</artifactId>
<version>4.3.1-SNAPSHOT</version>
<version>4.4.0-SNAPSHOT</version>
</parent>

<artifactId>vaadin-maps-leaflet-flow-demo</artifactId>
<version>4.3.1-SNAPSHOT</version>
<version>4.4.0-SNAPSHOT</version>
<packaging>jar</packaging>

<organization>
Expand All @@ -29,9 +29,9 @@
<mainClass>software.xdev.vaadin.Application</mainClass>

<!-- Dependency-Versions -->
<vaadin.version>24.4.4</vaadin.version>
<vaadin.version>24.4.11</vaadin.version>

<org.springframework.boot.version>3.3.1</org.springframework.boot.version>
<org.springframework.boot.version>3.3.3</org.springframework.boot.version>
</properties>

<dependencyManagement>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import software.xdev.vaadin.maps.leaflet.flow.demo.ComplexDemo;
import software.xdev.vaadin.maps.leaflet.flow.demo.EventDemo;
import software.xdev.vaadin.maps.leaflet.flow.demo.FreeingUpResourceBenchmarkDemo;
import software.xdev.vaadin.maps.leaflet.flow.demo.GeoJSONDemo;
import software.xdev.vaadin.maps.leaflet.flow.demo.InitialResizeDemo;
import software.xdev.vaadin.maps.leaflet.flow.demo.MinimalisticDemo;
import software.xdev.vaadin.maps.leaflet.flow.demo.MultiLayerWithPyramidDemo;
Expand Down Expand Up @@ -93,6 +94,11 @@ protected void onAttach(final AttachEvent attachEvent)
"using Pyramids ▲ and more...\n"
+ "Showcases a selection of different layers and how they can be displayed on a map"
),
new Example(
GeoJSONDemo.NAV,
"GeoJSON",
"Showcases how GeoJSON can be used"
),
new Example(
FreeingUpResourceBenchmarkDemo.NAV,
"Freeing up resources Benchmark",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ public ComplexDemo()
final LMarker markerInfo = new LMarker(
this.reg,
new LLatLng(this.reg, 49.674662, 12.162869),
new LMarkerOptions().withIcon(divIconInfo));
new LMarkerOptions()
.withIcon(divIconInfo)
.withDraggable(true));

@SuppressWarnings("checkstyle:LineLength")
final LIcon iconXDEV = new LIcon(this.reg, new LIconOptions()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
package software.xdev.vaadin.maps.leaflet.flow.demo;

import com.vaadin.flow.component.html.Anchor;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.router.Route;

import software.xdev.vaadin.maps.leaflet.MapContainer;
import software.xdev.vaadin.maps.leaflet.base.RawString;
import software.xdev.vaadin.maps.leaflet.basictypes.LLatLng;
import software.xdev.vaadin.maps.leaflet.layer.other.LGeoJSONLayer;
import software.xdev.vaadin.maps.leaflet.layer.other.LGeoJSONLayerOptions;
import software.xdev.vaadin.maps.leaflet.layer.raster.LTileLayer;
import software.xdev.vaadin.maps.leaflet.map.LMap;
import software.xdev.vaadin.maps.leaflet.registry.LComponentManagementRegistry;
import software.xdev.vaadin.maps.leaflet.registry.LDefaultComponentManagementRegistry;


@Route(GeoJSONDemo.NAV)
@SuppressWarnings("checkstyle:MagicNumber")
public class GeoJSONDemo extends VerticalLayout
{
public static final String NAV = "/geojson";

public GeoJSONDemo()
{
// Let the view use 100% of the site
this.setSizeFull();

this.add(new Anchor("https://leafletjs.com/examples/geojson", "Based on this example"));

// Create the registry which is needed so that components can be reused and their methods invoked
// Note: You normally don't need to invoke any methods of the registry and just hand it over to the components
final LComponentManagementRegistry reg = new LDefaultComponentManagementRegistry(this);

// Create and add the MapContainer (which contains the map) to the UI
final MapContainer mapContainer = new MapContainer(reg);
mapContainer.setSizeFull();
this.add(mapContainer);

final LMap map = mapContainer.getlMap();

// Add a (default) TileLayer so that we can see something on the map
map.addLayer(LTileLayer.createDefaultForOpenStreetMapTileServer(reg));

// Set what part of the world should be shown
map.setView(new LLatLng(reg, 39.75621, -104.99404), 17);

// Handle GeoJSON
final String serializedGeoJSON = """
{
"type": "Feature",
"properties": {
"name": "Coors Field",
"amenity": "Baseball Stadium",
"popupContent": "This is where the Rockies play!"
},
"geometry": {
"type": "Point",
"coordinates": [-104.99404, 39.75621]
}
}
""";
new LGeoJSONLayer(
reg,
serializedGeoJSON,
new LGeoJSONLayerOptions()
.withOnEachFeature(new RawString("(feature, layer) => { "
+ " if (feature.properties && feature.properties.popupContent) { "
+ " layer.bindPopup(feature.properties.popupContent); "
+ " }"
+ " }"))
)
.addTo(map);
}
}
Loading

0 comments on commit 08cf90f

Please # to comment.