forked from PierfrancescoSoffritti/android-youtube-player
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bintrayconfig.gradle
50 lines (45 loc) · 1.58 KB
/
bintrayconfig.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
if (!project.rootProject.file('local.properties').exists()) {
println "Not applying install.gradle"
return
}
apply plugin: 'com.novoda.bintray-release'
def getBintrayUserAndKey() {
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
return [
properties.getProperty("bintray.user"),
properties.getProperty("bintray.apikey")
]
}
if (shard == null) {
throw new IllegalStateException("Must specify a shard in module's build.gradle")
} else if (libVersion == null) {
throw new IllegalStateException("Must specify a libVersion in module's build.gradle")
} else if (libDescription == null) {
throw new IllegalStateException("Must specify a libDescription in module's build.gradle")
}
task checkBintrayConfig {
doLast {
def (user, key) = getBintrayUserAndKey()
if (user == null || user.isEmpty() ||
key == null || key.isEmpty()) {
throw new IllegalStateException("Must specify Bintray user/API key in your local.properties.")
}
}
}
afterEvaluate {
bintrayUpload.dependsOn checkBintrayConfig
}
def (user, key) = getBintrayUserAndKey()
publish {
bintrayUser = user
bintrayKey = key
userOrg = 'pierfrancescosoffritti'
groupId = 'com.pierfrancescosoffritti.androidyoutubeplayer'
uploadName = "android-youtube-player:$shard"
artifactId = shard
publishVersion = libVersion
desc = libDescription
website = 'https://pierfrancescosoffritti.github.io/android-youtube-player'
dryRun = false
}