-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
126 lines (106 loc) · 3.29 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
buildscript {
project.ext['CERN_VM'] = System.getProperty('CERN_TECHNET_VM') ?: System.getenv('CERN_TECHNET_VM') ?: project.hasProperty('CERN_TECHNET_VM') ?: false
project.ext['DEPLOYMENT'] = System.getProperty('DEPLOYMENT') ?: false
repositories {
if (project['CERN_VM']) {
maven { url 'http://artifactory.cern.ch/ds-jcenter' }
maven { url 'http://artifactory.cern.ch/development' }
maven { url 'http://artifactory.cern.ch/gradle-plugins' }
} else {
gradlePluginPortal()
}
}
dependencies {
classpath 'com.github.jk1:gradle-license-report:1.5'
classpath 'io.github.gradle-nexus:publish-plugin:1.0.0'
classpath 'biz.aQute.bnd:biz.aQute.bnd.gradle:5.1.2' // OSGi
classpath 'biz.aQute.bnd:biz.aQute.bndlib:5.1.2' // OSGi
}
}
apply plugin: 'java'
apply plugin: 'jacoco'
apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'biz.aQute.bnd.builder' // OSGi
group = project['POM.groupId']
repositories {
if (project['CERN_VM']) {
maven { url 'http://artifactory.cern.ch/ds-jcenter' }
maven { url 'http://artifactory.cern.ch/development' }
} else {
mavenCentral()
}
}
dependencies {
implementation group: 'org.ossgang', name: 'ossgang-commons', version: '0.30.0'
implementation group: 'com.google.code.gson', name:'gson', version: '2.9.1'
testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile group: 'org.assertj', name: 'assertj-core', version: '3.17.2'
testCompile group: 'org.mockito', name: 'mockito-core', version: '2.23.0'
}
wrapper {
gradleVersion = '5.4.1'
distributionType = Wrapper.DistributionType.ALL
}
jar {
// OSGi
bnd([
'Bundle-Vendor' : 'ossgang',
'-exportcontents': '*',
'-buildpath' : '' // no dependencies
])
}
test {
testLogging {
events "passed", "skipped", "failed"
exceptionFormat "full"
}
}
jacoco {
toolVersion = "0.8.3"
}
jacocoTestReport {
reports {
xml.enabled true
xml.destination file("$buildDir/reports/jacoco/report.xml")
html.enabled true
csv.enabled false
}
}
javadoc { options.encoding = "UTF-8" }
if (!project.tasks.findByName("javadocJar")) {
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
}
if (!project.tasks.findByName("sourcesJar")) {
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
}
eclipse {
classpath {
downloadJavadoc = true
downloadSources = true
}
}
idea {
module {
downloadJavadoc = true
downloadSources = true
}
}
if (!project['CERN_VM']) {
println 'Applying licensing report'
apply plugin: 'com.github.jk1.dependency-license-report'
licenseReport {
renderers = [this.class.classLoader.loadClass('com.github.jk1.license.render.InventoryHtmlReportRenderer').newInstance()]
filters = [this.class.classLoader.loadClass('com.github.jk1.license.filter.LicenseBundleNormalizer').newInstance()]
}
}
if (project['DEPLOYMENT']) {
println 'Applying deployment scripts'
apply from: 'https://raw.githubusercontent.com/ossgang/gradle-scripts/master/deployment/deploy-to-maven-central.gradle'
}