-
Notifications
You must be signed in to change notification settings - Fork 62
/
properties.gradle
38 lines (32 loc) · 1008 Bytes
/
properties.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
def tvhProperties = new Properties()
if (rootProject.file("local-tvheadend.properties").exists()) {
tvhProperties.load(new FileInputStream(rootProject.file("local-tvheadend.properties")))
}
static def completeName(name) {
return "ie.macinnes.tvheadend." + name
}
ext.tvhHasProperty = { name ->
if (tvhProperties.containsKey(completeName(name))) {
return true;
} else if (rootProject.hasProperty(completeName(name))) {
return true;
} else {
return rootProject.hasProperty(name)
}
}
ext.tvhProperty = { name ->
if (tvhProperties.containsKey(completeName(name))) {
return tvhProperties[completeName(name)];
} else if (rootProject.hasProperty(completeName(name))) {
return rootProject.property(completeName(name));
} else {
return rootProject.property(name)
}
}
ext.tvhPropertyFallback = { name, fallback ->
if (tvhHasProperty(name)) {
return tvhProperty(name)
} else {
return fallback
}
}