mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 13:55:54 -04:00
For the F-Droid missing libgdx.so problem (#4090)
This commit is contained in:
parent
e0a8de9eb5
commit
856fe1174a
@ -77,21 +77,11 @@ task("copyAndroidNatives") {
|
|||||||
val natives: Configuration by configurations
|
val natives: Configuration by configurations
|
||||||
|
|
||||||
doFirst {
|
doFirst {
|
||||||
file("libs/armeabi/").mkdirs()
|
val rx = Regex(""".*natives-([^.]+)\.jar$""")
|
||||||
file("libs/armeabi-v7a/").mkdirs()
|
|
||||||
file("libs/arm64-v8a/").mkdirs()
|
|
||||||
file("libs/x86_64/").mkdirs()
|
|
||||||
file("libs/x86/").mkdirs()
|
|
||||||
natives.forEach { jar ->
|
natives.forEach { jar ->
|
||||||
val outputDir: File? = when {
|
if (rx.matches(jar.name)) {
|
||||||
jar.name.endsWith("natives-arm64-v8a.jar") -> file("libs/arm64-v8a")
|
val outputDir = file(rx.replace(jar.name) { "libs/" + it.groups[1]!!.value })
|
||||||
jar.name.endsWith("natives-armeabi-v7a.jar") -> file("libs/armeabi-v7a")
|
outputDir.mkdirs()
|
||||||
jar.name.endsWith("natives-armeabi.jar") -> file("libs/armeabi")
|
|
||||||
jar.name.endsWith("natives-x86_64.jar") -> file("libs/x86_64")
|
|
||||||
jar.name.endsWith("natives-x86.jar") -> file("libs/x86")
|
|
||||||
else -> null
|
|
||||||
}
|
|
||||||
outputDir?.let {
|
|
||||||
copy {
|
copy {
|
||||||
from(zipTree(jar))
|
from(zipTree(jar))
|
||||||
into(outputDir)
|
into(outputDir)
|
||||||
@ -103,7 +93,7 @@ task("copyAndroidNatives") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tasks.whenTaskAdded {
|
tasks.whenTaskAdded {
|
||||||
if ("package" in name) {
|
if ("package" in name || "assemble" in name) {
|
||||||
dependsOn("copyAndroidNatives")
|
dependsOn("copyAndroidNatives")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user