|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
import dev.nokee.platform.jni.JniJarBinary |
|
|
|
|
import dev.nokee.platform.jni.JniLibrary |
|
|
|
|
import dev.nokee.platform.jni.JniLibraryExtension |
|
|
|
|
import dev.nokee.platform.nativebase.TargetMachine |
|
|
|
|
import dev.nokee.runtime.nativebase.TargetMachine |
|
|
|
|
import groovy.transform.CompileStatic |
|
|
|
|
import org.gradle.api.Plugin |
|
|
|
|
import org.gradle.api.Project |
|
|
|
@ -27,8 +27,8 @@ class UberJniJarPlugin implements Plugin<Project> {
|
|
|
|
|
library.binaries.withType(JniJarBinary).configureEach { |
|
|
|
|
if (it.jarTask.isPresent()) it.jarTask.get()?.enabled = false |
|
|
|
|
} |
|
|
|
|
if (library.targetMachines.get().size() >= 1) { |
|
|
|
|
logger.info("${project.name}: Merging binaries into the JVM Jar.") |
|
|
|
|
if (library.targetMachines.get().size() > 1) { |
|
|
|
|
for (TargetMachine targetMachine : library.targetMachines.get()) { |
|
|
|
|
Provider<JniLibrary> variant = library.variants |
|
|
|
|
.flatMap(targetMachineOf(targetMachine)) |
|
|
|
@ -37,6 +37,12 @@ class UberJniJarPlugin implements Plugin<Project> {
|
|
|
|
|
spec.from(variant.map { it.nativeRuntimeFiles }) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
library.variants.configureEach { |
|
|
|
|
task.into(it.resourcePath) { CopySpec spec -> |
|
|
|
|
spec.from(it.nativeRuntimeFiles) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|