-
Notifications
You must be signed in to change notification settings - Fork 12
/
build.gradle.kts
81 lines (64 loc) · 2.25 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import com.android.build.gradle.internal.tasks.factory.dependsOn
plugins {
id("com.android.library")
id("org.jetbrains.kotlin.android")
}
// TODO: Update value to your plugin's name.
val pluginName = "GodotAndroidPluginTemplate"
// TODO: Update value to match your plugin's package name.
val pluginPackageName = "org.godotengine.plugin.android.template"
android {
namespace = pluginPackageName
compileSdk = 33
buildFeatures {
buildConfig = true
}
defaultConfig {
minSdk = 21
manifestPlaceholders["godotPluginName"] = pluginName
manifestPlaceholders["godotPluginPackageName"] = pluginPackageName
buildConfigField("String", "GODOT_PLUGIN_NAME", "\"${pluginName}\"")
setProperty("archivesBaseName", pluginName)
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
}
}
dependencies {
implementation("org.godotengine:godot:4.3.0.stable")
// TODO: Additional dependencies should be added to export_plugin.gd as well.
}
// BUILD TASKS DEFINITION
val copyDebugAARToDemoAddons by tasks.registering(Copy::class) {
description = "Copies the generated debug AAR binary to the plugin's addons directory"
from("build/outputs/aar")
include("$pluginName-debug.aar")
into("demo/addons/$pluginName/bin/debug")
}
val copyReleaseAARToDemoAddons by tasks.registering(Copy::class) {
description = "Copies the generated release AAR binary to the plugin's addons directory"
from("build/outputs/aar")
include("$pluginName-release.aar")
into("demo/addons/$pluginName/bin/release")
}
val cleanDemoAddons by tasks.registering(Delete::class) {
delete("demo/addons/$pluginName")
}
val copyAddonsToDemo by tasks.registering(Copy::class) {
description = "Copies the export scripts templates to the plugin's addons directory"
dependsOn(cleanDemoAddons)
finalizedBy(copyDebugAARToDemoAddons)
finalizedBy(copyReleaseAARToDemoAddons)
from("export_scripts_template")
into("demo/addons/$pluginName")
}
tasks.named("assemble").configure {
finalizedBy(copyAddonsToDemo)
}
tasks.named<Delete>("clean").apply {
dependsOn(cleanDemoAddons)
}