-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
58 lines (53 loc) · 2 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
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// Only modify and release the license-data from the master branch of the license-data repository!
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
buildscript {
repositories {
mavenLocal()
['releases', 'public'].each { r ->
maven {
url "${nexusBaseUrl}/repositories/${r}"
credentials {
username nexusUserName
password nexusPassword
}
}
}
}
dependencies {
classpath "com.xebialabs.gradle.plugins:gradle-xl-defaults-plugin:${xlDefaultsPluginVersion}"
classpath "gradle.plugin.com.xebialabs:gradle-xl-dependency-plugin:${xlDependencyPluginVersion}"
}
}
group = 'com.xebialabs.deployit.gradle'
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'xebialabs.root.opinions'
apply plugin: 'xebialabs.opinions'
apply plugin: 'com.xebialabs.dependency'
apply plugin: 'xebialabs.artifact'
import groovy.json.JsonSlurper
task checkLicenseData() {
doLast {
def slurper = new JsonSlurper()
file('src/main/resources/license-data.json').withReader {
def data = slurper.parse(it)
data.artifacts.each {
def source = it.value.licenseSource
def license = it.value.license
if (source == 'data') {
def ld = data.licenses[license]
if (ld == null) {
throw new RuntimeException("licenses section is missing key for ${license}")
}
def f = file("src/main/resources/${ld.file}")
if (ld.file && !f.exists()) {
throw new RuntimeException("License not found ${f} for ${it.key}")
}
}
}
}
}
}
check.dependsOn checkLicenseData
install.dependsOn check