forked from twitter-archive/twitter-kit-android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
internal.gradle
30 lines (27 loc) · 816 Bytes
/
internal.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
project.ext.applyInternal = { Map arguments ->
String plugin = arguments.plugin
File scriptFile = arguments.from
// Apply script
if (scriptFile != null) {
if (scriptFile.exists()) {
project.apply from: scriptFile
} else {
project.logger.info("Unable to apply plugin script: {}", scriptFile.name)
}
}
// Apply plugin
if (plugin != null) {
try {
project.apply plugin: Class.forName(plugin)
} catch (ClassNotFoundException e) {
project.logger.info("Unable to apply plugin class: {}", plugin)
}
}
}
project.ext.internal = { Closure closure ->
try {
closure()
} catch (MissingMethodException e) {
project.logger.info("Unable to apply closure: {}", e.method)
}
}