-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathconfig.gradle
64 lines (58 loc) · 1.98 KB
/
config.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
ext.createComponentZipTasks = { components, names, base, type, project, func ->
def stringNames = names.collect {it.toString()}
def configMap = [:]
components.each {
if (it in NativeLibrarySpec && stringNames.contains(it.name)) {
it.binaries.each {
if (!it.buildable) return
def target = nativeUtils.getPublishClassifier(it)
if (configMap.containsKey(target)) {
configMap.get(target).add(it)
} else {
configMap.put(target, [])
configMap.get(target).add(it)
}
}
}
}
def taskList = []
def outputsFolder = file("$project.buildDir/outputs")
configMap.each { key, value ->
def task = project.tasks.create(base + "-${key}", type) {
description = 'Creates component archive for platform ' + key
destinationDirectory = outputsFolder
classifier = key
archiveBaseName = base
duplicatesStrategy = 'exclude'
func(it, value)
}
if (key.contains('debug')) {
project.tasks['runtimeLibDebug'].configure {
func(it, value)
}
} else {
project.tasks['runtimeLib'].configure {
func(it, value)
}
}
taskList.add(task)
project.build.dependsOn task
project.artifacts {
task
}
addTaskToCopyAllOutputs(task)
}
return taskList
}
ext.includeStandardZipFormat = { task, value ->
value.each { binary ->
if (binary.buildable) {
if (binary instanceof SharedLibraryBinarySpec) {
task.dependsOn binary.tasks.link
task.from(binary.sharedLibraryFile) {
into nativeUtils.getPlatformPath(binary) + '/shared'
}
}
}
}
}