Skip to content

Commit 0d85cf1

Browse files
committed
wip
1 parent d9f7497 commit 0d85cf1

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

build.gradle

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ def h3VersionProps = new Properties()
5454
file("h3version.properties").withInputStream { h3VersionProps.load(it) }
5555
ext.h3GitReference = h3VersionProps.getProperty('h3.git.reference')
5656

57+
compileJava {
58+
options.compilerArgs += ['-h', "${projectDir}/src/main/c/h3-java/src"]
59+
}
60+
5761
// Task to build H3 native code
5862
task buildH3(type: Exec) {
5963
workingDir "${projectDir}"
@@ -65,11 +69,7 @@ task buildH3(type: Exec) {
6569
h3SystemPrune, h3DockcrossTag, h3DockcrossOnly,
6670
h3GithubArtifactsUse, h3GithubArtifactsByRun
6771
}
68-
}
69-
70-
compileJava {
71-
dependsOn buildH3
72-
options.compilerArgs += ['-h', "${projectDir}/src/main/c/h3-java/src"]
72+
dependsOn compileJava
7373
}
7474

7575
spotless {
@@ -89,6 +89,12 @@ jacocoTestReport {
8989
}
9090
}
9191

92+
jar {
93+
dependsOn buildH3
94+
from sourceSets.main.resources
95+
duplicatesStrategy = DuplicatesStrategy.WARN
96+
}
97+
9298
publishing {
9399
publications {
94100
mavenJava(MavenPublication) {

src/main/c/h3-java/src/jniapi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ JNIEXPORT void JNICALL Java_com_uber_h3core_NativeMethods_polygonToCells(
666666

667667
jlong *resultsElements = (**env).GetLongArrayElements(env, results, 0);
668668

669-
H3Error err;
669+
H3Error err = E_SUCCESS;
670670
if (resultsElements != NULL) {
671671
// if sz is too small, bad things will happen
672672
err = polygonToCells(&polygon, res, flags, resultsElements);
@@ -700,7 +700,7 @@ Java_com_uber_h3core_NativeMethods_polygonToCellsExperimental(
700700
jlong *resultsElements = (**env).GetLongArrayElements(env, results, 0);
701701
jsize resultsSize = (**env).GetArrayLength(env, results);
702702

703-
H3Error err;
703+
H3Error err = E_SUCCESS;
704704
if (resultsElements != NULL) {
705705
err = polygonToCellsExperimental(&polygon, res, flags, resultsSize,
706706
resultsElements);

0 commit comments

Comments
 (0)