-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
133 lines (112 loc) · 3.32 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
127
128
129
130
131
132
133
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'
}
}
apply plugin: 'java'
apply plugin: 'jacoco'
apply plugin: 'idea'
apply plugin: 'eclipse'
group = project['POM.groupId']
sourceCompatibility = JavaVersion.VERSION_1_8
repositories {
if (project['CERN_VM']) {
maven { url 'http://artifactory.cern.ch/ds-jcenter' }
maven { url 'http://artifactory.cern.ch/development' }
} else {
mavenCentral()
}
}
dependencies {
compile 'org.jscience:jscience:4.3.1'
compile group: 'com.google.guava', name: 'guava', version: guavaVersion
compile 'org.hamcrest:hamcrest-all:1.3'
compile 'org.slf4j:slf4j-api:1.7.25'
testCompile 'junit:junit:4.13.1'
testCompile 'org.slf4j:slf4j-log4j12:+'
testCompile 'pl.pragmatists:JUnitParams:1.0.4'
testCompile 'org.mockito:mockito-core:3.1.0'
testCompile 'org.objenesis:objenesis:3.1'
testCompile 'com.openpojo:openpojo:0.8.13'
testCompile 'org.assertj:assertj-core:3.13.2'
testCompile 'nl.jqno.equalsverifier:equalsverifier:2.3.1'
}
wrapper {
gradleVersion = '5.4.1'
distributionType = Wrapper.DistributionType.ALL
}
sourceSets {
main {
java {
srcDir 'src/java'
}
}
test {
java {
srcDir 'src/test'
}
}
}
test {
testLogging {
events "passed", "skipped", "failed"
exceptionFormat "full"
}
}
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'
}