-
-
Notifications
You must be signed in to change notification settings - Fork 38
/
build.gradle
93 lines (78 loc) · 2.83 KB
/
build.gradle
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
82
83
84
85
86
87
88
89
90
91
92
93
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '7.2.2' apply false
id 'com.android.library' version '7.2.2' apply false
id 'org.jetbrains.kotlin.android' version '1.9.22' apply false
}
task clean(type: Delete) {
delete rootProject.buildDir
}
allprojects {
afterEvaluate {
}
}
ext {
pluginExportPath = project.hasProperty('pluginExportPath') ? project.property('pluginExportPath') : null
aarExportPath = project.hasProperty('pluginExportPath') ? project.property('pluginExportPath') + '\\poing-godot-admob-libs' : null
}
task exportAar(type: Copy) {
def aarFiles = []
subprojects { subproject ->
if (subproject.file("src").exists() && subproject.name != "core") {
def moduleAarDir = subproject.file("build/outputs/aar")
aarFiles.addAll(fileTree(moduleAarDir) {
include '*release.aar'
})
}
}
from aarFiles
into aarExportPath
}
task exportGdap(type: Copy) {
def gdapFiles = []
subprojects { subproject ->
if (subproject.file("src").exists()) {
def configGdapDir = subproject.file("config")
gdapFiles.addAll(fileTree(configGdapDir) {
include '*.gdap'
})
}
}
from gdapFiles
into pluginExportPath
}
task exportFiles(dependsOn: [exportAar, exportGdap])
gradle.taskGraph.whenReady { taskGraph ->
if (taskGraph.hasTask(exportFiles)) {
if (pluginExportPath == null) {
throw new GradleException("The export path for AAR files is not defined. Use the command './gradlew exportFiles -PpluginExportPath=<desired-path>' to export the AAR files.")
}
println "Exporting AAR files to: $pluginExportPath"
}
}
task zipPlugins(type: Zip) {
def godotVersion = project.hasProperty("godotVersion") ? project.getProperty("godotVersion") : ""
def zipFileName = "poing-godot-admob-android${godotVersion ? '-v' + godotVersion : ''}.zip"
archiveFileName.set(zipFileName)
destinationDirectory.set(file("${rootProject.projectDir}/.output"))
subprojects { subproject ->
if (subproject.file("src").exists() && subproject.name != "core") {
def moduleAarDir = subproject.file("build/outputs/aar")
def aarFiles = fileTree(moduleAarDir) {
include '*release.aar'
}
def configGdapDir = subproject.file("config")
def gdapFiles = fileTree(configGdapDir) {
include '*.gdap'
}
into("${subproject.name}") {
from(gdapFiles) {
include '*.gdap'
}
into("poing-godot-admob-libs") {
from(aarFiles)
}
}
}
}
}