Skip to content

Commit 2979f94

Browse files
committed
attempt to fix h3-java publishing for jar
1 parent b2ff9d3 commit 2979f94

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

build.gradle

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ compileJava {
7373
// Task to build H3 native code
7474
task buildH3(type: Exec) {
7575
workingDir "${projectDir}"
76+
dependsOn compileJava
7677
if (System.getProperty('os.name').toLowerCase().contains('windows')) {
7778
commandLine 'powershell', '-ExecutionPolicy', 'Bypass', '-File',
7879
'./src/main/c/h3-java/build-h3-windows.ps1', h3GitRemote, h3GitReference
@@ -81,21 +82,22 @@ task buildH3(type: Exec) {
8182
h3SystemPrune, h3DockcrossTag, h3DockcrossOnly,
8283
h3GithubArtifactsUse, h3GithubArtifactsByRun
8384
}
84-
dependsOn compileJava
8585
outputs.dir("${projectDir}/src/main/resources")
8686
}
8787

8888
// Task to build H3 native code for Android only
8989
task buildH3Android(type: Exec) {
90+
mustRunAfter buildH3
91+
dependsOn compileJava
9092
workingDir "${projectDir}"
9193
commandLine './src/main/c/h3-java/build-h3.sh', h3GitRemote, h3GitReference, 'true',
9294
h3SystemPrune, h3DockcrossTag, 'android-arm android-arm64',
9395
h3GithubArtifactsUse, h3GithubArtifactsByRun
94-
dependsOn compileJava
9596
outputs.dir("${projectDir}/src/main/resources")
9697
}
9798

9899
processResources {
100+
mustRunAfter buildH3Android
99101
dependsOn buildH3
100102
}
101103

@@ -143,7 +145,7 @@ task compileAndroidJava(type: JavaCompile) {
143145

144146
// Android JAR task - creates JAR with only Android native libraries
145147
task androidJar(type: Jar) {
146-
dependsOn compileAndroidJava
148+
dependsOn compileAndroidJava, buildH3Android
147149
archiveBaseName = 'h3-android'
148150
archiveVersion = project.version
149151

@@ -259,6 +261,8 @@ sourcesJar {
259261

260262
// Android sources JAR
261263
task androidSourcesJar(type: Jar) {
264+
dependsOn buildH3Android
265+
262266
archiveBaseName = 'h3-android'
263267
archiveVersion = project.version
264268
archiveClassifier = 'sources'

0 commit comments

Comments
 (0)