68 lines
1.7 KiB
Kotlin
68 lines
1.7 KiB
Kotlin
|
|
plugins {
|
||
|
|
kotlin("android")
|
||
|
|
id("com.android.application")
|
||
|
|
}
|
||
|
|
|
||
|
|
val gdxVersion: String by project
|
||
|
|
val natives: Configuration by configurations.creating
|
||
|
|
|
||
|
|
android {
|
||
|
|
namespace = "com.artlegend"
|
||
|
|
compileSdk = 34
|
||
|
|
|
||
|
|
defaultConfig {
|
||
|
|
applicationId = "com.artlegend"
|
||
|
|
minSdk = 26
|
||
|
|
targetSdk = 34
|
||
|
|
versionCode = 1
|
||
|
|
versionName = "0.1.0"
|
||
|
|
}
|
||
|
|
|
||
|
|
compileOptions {
|
||
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
||
|
|
targetCompatibility = JavaVersion.VERSION_17
|
||
|
|
}
|
||
|
|
|
||
|
|
kotlinOptions {
|
||
|
|
jvmTarget = "17"
|
||
|
|
}
|
||
|
|
|
||
|
|
sourceSets {
|
||
|
|
getByName("main") {
|
||
|
|
assets.srcDirs(rootProject.file("assets"))
|
||
|
|
jniLibs.srcDirs("libs")
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
dependencies {
|
||
|
|
implementation(project(":core"))
|
||
|
|
implementation("com.badlogicgames.gdx:gdx-backend-android:$gdxVersion")
|
||
|
|
natives("com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a")
|
||
|
|
natives("com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-arm64-v8a")
|
||
|
|
natives("com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86")
|
||
|
|
natives("com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86_64")
|
||
|
|
}
|
||
|
|
|
||
|
|
tasks.register("copyAndroidNatives") {
|
||
|
|
doFirst {
|
||
|
|
natives.files.forEach { jar ->
|
||
|
|
val outputDir = file("libs")
|
||
|
|
outputDir.mkdirs()
|
||
|
|
copy {
|
||
|
|
from(zipTree(jar))
|
||
|
|
into(outputDir)
|
||
|
|
include("*.so")
|
||
|
|
eachFile { path = name }
|
||
|
|
includeEmptyDirs = false
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
tasks.whenTaskAdded {
|
||
|
|
if (name.contains("package") || name.contains("assemble") || name.contains("bundle")) {
|
||
|
|
dependsOn("copyAndroidNatives")
|
||
|
|
}
|
||
|
|
}
|