11buildscript {
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
454
465 repositories {
47- if (CERN_VM ) {
48- maven { url ' http://artifactory.cern.ch/gradle-plugins' }
6+ if (project[' CERN_VM' ]) {
497 maven { url ' http://artifactory.cern.ch/ds-jcenter' }
508 maven { url ' http://artifactory.cern.ch/development' }
9+ maven { url ' http://artifactory.cern.ch/gradle-plugins' }
5110 } else {
52- mavenCentral()
53- jcenter()
54- maven { url ' https://plugins.gradle.org/m2/' }
11+ gradlePluginPortal()
5512 }
5613 }
14+
5715 dependencies {
58- classpath ' com.netflix.nebula:nebula-publishing-plugin:5.1.0'
59- classpath ' com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
6016 classpath ' com.github.jk1:gradle-license-report:1.5'
61- }
17+ classpath ' io.github.gradle-nexus:publish-plugin:1.0.0'
18+ }
6219}
6320
6421apply plugin : ' java'
6522apply plugin : ' jacoco'
6623apply plugin : ' idea'
6724apply plugin : ' eclipse'
6825
26+ group = project[' POM.groupId' ]
27+
28+ sourceCompatibility = JavaVersion . VERSION_1_8
29+
6930repositories {
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' }
7334 } else {
7435 mavenCentral()
75- jcenter()
7636 }
7737}
7838
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-
9339dependencies {
9440 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
9642 compile ' org.hamcrest:hamcrest-all:1.3'
9743 compile ' org.slf4j:slf4j-api:1.7.25'
9844
@@ -106,6 +52,11 @@ dependencies {
10652 testCompile ' nl.jqno.equalsverifier:equalsverifier:2.3.1'
10753}
10854
55+ wrapper {
56+ gradleVersion = ' 5.4.1'
57+ distributionType = Wrapper.DistributionType . ALL
58+ }
59+
10960sourceSets {
11061 main {
11162 java {
@@ -119,9 +70,23 @@ sourceSets {
11970 }
12071}
12172
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+ }
12388
124- task wrapper ( type : Wrapper ) { gradleVersion = ' 4.8.1 ' }
89+ javadoc { options . encoding = " UTF-8 " }
12590
12691if (! project. tasks. findByName(" javadocJar" )) {
12792 task javadocJar(type : Jar ) {
@@ -137,16 +102,6 @@ if(!project.tasks.findByName("sourcesJar")) {
137102 }
138103}
139104
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- }
150105
151106eclipse {
152107 classpath {
@@ -162,13 +117,6 @@ idea {
162117 }
163118}
164119
165- test {
166- testLogging {
167- events " failed"
168- exceptionFormat " short"
169- }
170- }
171-
172120if (! project[' CERN_VM' ]) {
173121 println ' Applying licensing report'
174122 apply plugin : ' com.github.jk1.dependency-license-report'
@@ -177,4 +125,9 @@ if (!project['CERN_VM']) {
177125 renderers = [this . class. classLoader. loadClass(' com.github.jk1.license.render.InventoryHtmlReportRenderer' ). newInstance()]
178126 filters = [this . class. classLoader. loadClass(' com.github.jk1.license.filter.LicenseBundleNormalizer' ). newInstance()]
179127 }
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'
180133}
0 commit comments