-
Notifications
You must be signed in to change notification settings - Fork 10
/
build.gradle
81 lines (64 loc) · 2.05 KB
/
build.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/* ------------------- Gradle.com build-scan ------------------- */
plugins {
id 'com.gradle.build-scan' version '1.0'
}
buildScan {
licenseAgreementUrl = 'https://gradle.com/terms-of-service'
licenseAgree = 'yes'
}
/* ------------------------------------------------------------ */
subprojects {
apply plugin: 'groovy'
group 'io.github.kdabir.glide'
sourceCompatibility = "$javaVersion"
targetCompatibility = "$javaVersion"
repositories {
mavenLocal()
jcenter()
mavenCentral()
}
test {
testLogging {
events "failed"
exceptionFormat "full"
}
}
}
task releaseFilters(dependsOn: ':glide-filters:release')
task releasePlugin(dependsOn: ':glide-gradle-plugin:release')
task releaseRunner(dependsOn: ':glide-runner:release')
// some helpers
task publishedVersions {
doLast {
['glide-filters', 'glide-gradle-plugin'].each { printVersions(it) }
printGitTags()
}
}
task wrapper(type: Wrapper) {
gradleVersion = gradleVersion
}
def printVersions(String component) {
def metadata = new XmlSlurper().parse("https://dl.bintray.com/kdabir/glide/io/github/kdabir/glide/${component}/maven-metadata.xml")
def allVersions = metadata.versioning.versions.version*.text()
def latestVersion = metadata.versioning.latest.text()
logger.quiet """
# $component
Available versions : ${allVersions}
Latest version : $latestVersion \
""".stripIndent()
}
import groovy.json.JsonSlurper
def printGitTags() {
def tags = new JsonSlurper()
.parse(new URL("https://api.github.com/repos/kdabir/glide/git/refs/tags"))*.ref.collect { it.split("/").last() }
logger.quiet """
# tags \
""".stripIndent()
logger.quiet tags.join("\n")
}
task hasKeys {
final keys = ['bintrayUser', 'bintrayKey', 'gradle.publish.key', 'gradle.publish.secret', 'sdkmanConsumerKey', 'sdkmanConsumerToken']
doLast {
println("all keys required to publish: " + keys.every { project.hasProperty(it) })
}
}