-
Notifications
You must be signed in to change notification settings - Fork 92
/
fatAar.gradle
39 lines (37 loc) · 1.38 KB
/
fatAar.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
def copyJarTask(String buildType) {
return tasks.create("copyJars${buildType}", Copy.class) {
from(tasks.getByName("bundleLibCompileToJar${buildType}"))
into("../unity-ads/libs/${buildType}/")
include('classes.jar')
rename('classes.jar', "${project.name}.jar")
}
}
static def tasksDependentOnScar(String buildType) {
return [
"copy${buildType}JniLibsProjectAndLocalJars",
"compile${buildType}Kotlin",
"merge${buildType}JavaResource",
"sync${buildType}LibJars",
"extract${buildType}Annotations",
"desugar${buildType}FileDependencies",
"dokkaJavadoc"
]
}
project.tasks.whenTaskAdded { Task theTask ->
{
["Release", "Debug"].each { buildType ->
{
if (theTask.name == "bundleLibCompileToJar${buildType}") {
if (project.name != "unity-ads") {
theTask.finalizedBy(copyJarTask("${buildType}"))
}
}
if (tasksDependentOnScar("${buildType}").any { theTask.name == it }) {
theTask.dependsOn(":unity-scaradapter-common:copyJars${buildType}")
theTask.dependsOn(":unity-scaradapter-2000:copyJars${buildType}")
theTask.dependsOn(":unity-scaradapter-2100:copyJars${buildType}")
}
}
}
}
}