Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix paths to Windows resources #109

Merged
merged 3 commits into from
Sep 14, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The public API of this library consists of the public functions declared in
file [H3Core.java](./src/main/java/com/uber/h3core/H3Core.java), and support
for the Linux x64 and Darwin x64 platforms.

## Unreleased Changes
### Fixed
- Fixed the path to Windows resources.

## [4.0.0] - 2022-08-23
### Breaking Changes
- Upgraded the core library to v4.0.0. (#104, #103, #102, #91)
Expand Down
4 changes: 2 additions & 2 deletions src/main/c/h3-java/build-h3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,10 @@ for image in android-arm android-arm64 linux-arm64 linux-armv5 linux-armv7 linux
# Copy the built artifact into the source tree so it can be included in the
# built JAR.
OUTPUT_ROOT=src/main/resources/$image
if [ "$image" -eq "windows-static-x64" ]; then
if [ "$image" = "windows-static-x64" ]; then
OUTPUT_ROOT=src/main/resources/windows-x64
fi
if [ "$image" -eq "windows-static-x86" ]; then
if [ "$image" = "windows-static-x86" ]; then
OUTPUT_ROOT=src/main/resources/windows-x86
fi
mkdir -p $OUTPUT_ROOT
Expand Down
26 changes: 26 additions & 0 deletions src/test/java/com/uber/h3core/TestH3CoreLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@
package com.uber.h3core;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

import com.google.common.collect.ImmutableList;
import java.io.File;
import java.io.IOException;
import java.util.List;
import org.junit.Test;

/** H3CoreLoader is mostly tested by {@link TestH3CoreFactory}. This also tests OS detection. */
Expand Down Expand Up @@ -65,4 +68,27 @@ public void testExtractNonexistant() throws IOException {

H3CoreLoader.copyResource("/nonexistant-resource", tempFile);
}

@Test
public void testResourcesExist() throws IOException {
List<String> resources =
ImmutableList.of(
"/linux-x64/libh3-java.so",
"/linux-x86/libh3-java.so",
"/linux-arm64/libh3-java.so",
"/linux-armv5/libh3-java.so",
"/linux-armv7/libh3-java.so",
"/linux-ppc64le/libh3-java.so",
"/linux-s390x/libh3-java.so",
"/windows-x64/libh3-java.dll",
"/windows-x86/libh3-java.dll",
"/darwin-x64/libh3-java.dylib",
"/darwin-arm/libh3-java.dylib",
"/freebsd-x64/libh3-java.so",
"/android-arm/libh3-java.so",
"/android-arm64/libh3-java.so");
for (String name : resources) {
assertNotNull(name + " is an included resource", H3CoreLoader.class.getResource(name));
}
}
}