Skip to content

Commit

Permalink
Handle special case ical zones during build time processing
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesnetherton committed Jun 28, 2024
1 parent 9d703db commit 4fafc1a
Showing 1 changed file with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,21 @@ void nativeResources(
timezoneData.values()
.stream()
.map(Objects::toString)
.map(timeZone -> timeZone.split("/")[0])
.map(timeZone -> {
String[] zoneParts = timeZone.split("/");
if (zoneParts.length == 2) {
return zoneParts[0];
} else if (zoneParts.length == 3) {
return zoneParts[0] + "/" + zoneParts[1];
}
return null;
})
.distinct()
.forEach(region -> {
nativeResourceDirs.produce(new NativeImageResourceDirectoryBuildItem("zoneinfo/" + region));
nativeResourceDirs.produce(new NativeImageResourceDirectoryBuildItem("zoneinfo-global/" + region));
if (region != null) {
nativeResourceDirs.produce(new NativeImageResourceDirectoryBuildItem("zoneinfo/" + region));
nativeResourceDirs.produce(new NativeImageResourceDirectoryBuildItem("zoneinfo-global/" + region));
}
});

} catch (IOException e) {
Expand Down

0 comments on commit 4fafc1a

Please sign in to comment.