Skip to content

Commit

Permalink
Make jar depend on JNI build
Browse files Browse the repository at this point in the history
  • Loading branch information
mcm001 committed Dec 24, 2023
1 parent 4f6850c commit a71b1e3
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions photon-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ apply from: "${rootDir}/shared/javacpp/setupBuild.gradle"
apply plugin: 'edu.wpi.first.GradleJni'

def nativeOutputDir = file("$buildDir/${nativeName}_outs")
def taskFoo = null;
println("Saving to $nativeOutputDir")

model {
Expand Down Expand Up @@ -133,18 +132,29 @@ model {
copy {
from so.sharedLibraryFile
// We know all should be shared libs only at this point
into file("$buildDir/${nativeName}_outs/${nativeUtils.getPlatformPath(so)}/shared")
into file(nativeOutputDir.path + "/${nativeUtils.getPlatformPath(so)}/shared")
}
}
}

$.tasks.jar.dependsOn testTask
// $.tasks.jar.dependsOn testTask
// taskFoo = testTask;
}
}
}

// yay misdirection
tasks.register('testDesktop') {
dependsOn copyPhotonCoreNative
}
jar.dependsOn tasks.named('testDesktop')

jar {
from nativeOutputDir
println("Adding to JAR $nativeOutputDir")
}


// Make sure our files get added to resources, and that build happens before JAR does
// println taskFoo
sourceSets.main.resources.srcDirs += nativeOutputDir
// jar.dependsOn { taskFoo }
// sourceSets.main.resources.srcDirs += nativeOutputDir
// println sourceSets.main.resources.srcDirs

0 comments on commit a71b1e3

Please sign in to comment.