1
1
buildscript {
2
- project. ext. CERN_VM = System . getProperty(' CERN_TECHNET_VM' ) ?: System . getenv(' CERN_TECHNET_VM' ) ?: false
3
- project. ext. TRAVIS_CI = System . getProperty(' TRAVIS' ) ?: System . getenv(' TRAVIS' ) ?: false
4
- project. ext. DEPLOYMENT = System . getProperty(' deployment' ) ?: false
5
- project. ext. VCS_TAG = System . getProperty(' TRAVIS_TAG' ) ?: System . getenv(' TRAVIS_TAG' )
6
- project. ext. POM = [
7
- groupId : ' org.tensorics' ,
8
- artifactId : ' tensorics-core' ,
9
- description : ' Tensorics is a java framework which uses a tensor as a central object. A tensor represents a set of values placed in an N-dimensional space. Wherever you are tempted to use maps of maps, a tensor might be a good choice ;-) Tensorics provides methods to create, transform and performing calculations with those tensors.' ,
10
- developers : [
11
- [
12
- id : ' kaifox' ,
13
- name : ' Kajetan Fuchsberger' ,
14
-
15
- ],
16
- [
17
- id : ' agorzawski' ,
18
- name : ' Arek Gorzawski' ,
19
-
20
- ],
21
- [
22
- id : ' michi42' ,
23
- name : ' Michi Hostettler' ,
24
-
25
- ],
26
- [
27
- id : ' andreacalia' ,
28
- name : ' Andrea Calia' ,
29
-
30
- ]
31
- ]]
32
- project. ext. INFO = [
33
- repo : ' https://github.com/tensorics/tensorics-core.git' ,
34
- url : ' http://tensorics.org/' ,
35
- github : ' https://github.com/tensorics/tensorics-core' ,
36
- githubIssues : ' https://github.com/tensorics/tensorics-core/issues'
37
- ]
38
- project. ext. BINTRAY = [
39
- repo : ' tensorics-repo' ,
40
- name : ' org.tensorics:tensorics-core' ,
41
- organization : ' tensorics' ,
42
- userName : ' tensorics-dev' ,
43
- apiToken : System . getenv(' BINTRAY_API_TOKEN' )
44
- ]
2
+ project. ext[' CERN_VM' ] = System . getProperty(' CERN_TECHNET_VM' ) ?: System . getenv(' CERN_TECHNET_VM' ) ?: project. hasProperty(' CERN_TECHNET_VM' ) ?: false
3
+ project. ext[' DEPLOYMENT' ] = System . getProperty(' DEPLOYMENT' ) ?: false
45
4
46
5
repositories {
47
- if (CERN_VM ) {
48
- maven { url ' http://artifactory.cern.ch/gradle-plugins' }
6
+ if (project[' CERN_VM' ]) {
49
7
maven { url ' http://artifactory.cern.ch/ds-jcenter' }
50
8
maven { url ' http://artifactory.cern.ch/development' }
9
+ maven { url ' http://artifactory.cern.ch/gradle-plugins' }
51
10
} else {
52
- mavenCentral()
53
- jcenter()
54
- maven { url ' https://plugins.gradle.org/m2/' }
11
+ gradlePluginPortal()
55
12
}
56
13
}
14
+
57
15
dependencies {
58
- classpath ' com.netflix.nebula:nebula-publishing-plugin:5.1.0'
59
- classpath ' com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
60
16
classpath ' com.github.jk1:gradle-license-report:1.5'
61
- }
17
+ classpath ' io.github.gradle-nexus:publish-plugin:1.0.0'
18
+ }
62
19
}
63
20
64
21
apply plugin : ' java'
65
22
apply plugin : ' jacoco'
66
23
apply plugin : ' idea'
67
24
apply plugin : ' eclipse'
68
25
26
+ group = project[' POM.groupId' ]
27
+
28
+ sourceCompatibility = JavaVersion . VERSION_1_8
29
+
69
30
repositories {
70
- if (CERN_VM ) {
71
- maven { url ' http://artifactory.cern.ch/ds-jcenter' }
72
- maven { url ' http://artifactory.cern.ch/development' }
31
+ if (project[ ' CERN_VM' ] ) {
32
+ maven { url ' http://artifactory.cern.ch/ds-jcenter' }
33
+ maven { url ' http://artifactory.cern.ch/development' }
73
34
} else {
74
35
mavenCentral()
75
- jcenter()
76
36
}
77
37
}
78
38
79
- if (DEPLOYMENT ) {
80
- apply plugin : ' maven'
81
- apply plugin : ' maven-publish'
82
- apply plugin : ' nebula.maven-publish'
83
- apply plugin : ' com.jfrog.bintray'
84
-
85
- println ' Applying deployment scripts'
86
- apply from : ' ./scripts/bintray-deploy.gradle'
87
- }
88
-
89
- group ' org.tensorics'
90
-
91
- sourceCompatibility = JavaVersion . VERSION_1_8
92
-
93
39
dependencies {
94
40
compile ' org.jscience:jscience:4.3.1'
95
- compile ' com.google.guava: guava:28.1-jre '
41
+ compile group : ' com.google.guava' , name : ' guava' , version : guavaVersion
96
42
compile ' org.hamcrest:hamcrest-all:1.3'
97
43
compile ' org.slf4j:slf4j-api:1.7.25'
98
44
@@ -106,6 +52,11 @@ dependencies {
106
52
testCompile ' nl.jqno.equalsverifier:equalsverifier:2.3.1'
107
53
}
108
54
55
+ wrapper {
56
+ gradleVersion = ' 5.4.1'
57
+ distributionType = Wrapper.DistributionType . ALL
58
+ }
59
+
109
60
sourceSets {
110
61
main {
111
62
java {
@@ -119,9 +70,23 @@ sourceSets {
119
70
}
120
71
}
121
72
122
- javadoc { options. encoding = " UTF-8" }
73
+ test {
74
+ testLogging {
75
+ events " passed" , " skipped" , " failed"
76
+ exceptionFormat " full"
77
+ }
78
+ }
79
+
80
+ jacocoTestReport {
81
+ reports {
82
+ xml. enabled true
83
+ xml. destination file(" $buildDir /reports/jacoco/report.xml" )
84
+ html. enabled true
85
+ csv. enabled false
86
+ }
87
+ }
123
88
124
- task wrapper ( type : Wrapper ) { gradleVersion = ' 4.8.1 ' }
89
+ javadoc { options . encoding = " UTF-8 " }
125
90
126
91
if (! project. tasks. findByName(" javadocJar" )) {
127
92
task javadocJar(type : Jar ) {
@@ -137,16 +102,6 @@ if(!project.tasks.findByName("sourcesJar")) {
137
102
}
138
103
}
139
104
140
- artifacts { archives javadocJar, sourcesJar }
141
-
142
- jacocoTestReport {
143
- reports {
144
- xml. enabled true
145
- xml. destination new File (" ${ buildDir} /reports/jacoco/report.xml" )
146
- html. enabled true
147
- csv. enabled false
148
- }
149
- }
150
105
151
106
eclipse {
152
107
classpath {
@@ -162,13 +117,6 @@ idea {
162
117
}
163
118
}
164
119
165
- test {
166
- testLogging {
167
- events " failed"
168
- exceptionFormat " short"
169
- }
170
- }
171
-
172
120
if (! project[' CERN_VM' ]) {
173
121
println ' Applying licensing report'
174
122
apply plugin : ' com.github.jk1.dependency-license-report'
@@ -177,4 +125,9 @@ if (!project['CERN_VM']) {
177
125
renderers = [this . class. classLoader. loadClass(' com.github.jk1.license.render.InventoryHtmlReportRenderer' ). newInstance()]
178
126
filters = [this . class. classLoader. loadClass(' com.github.jk1.license.filter.LicenseBundleNormalizer' ). newInstance()]
179
127
}
128
+ }
129
+
130
+ if (project[' DEPLOYMENT' ]) {
131
+ println ' Applying deployment scripts'
132
+ apply from : ' https://raw.githubusercontent.com/ossgang/gradle-scripts/master/deployment/deploy-to-maven-central.gradle'
180
133
}
0 commit comments