Skip to content

Commit aad6082

Browse files
committed
deployment to maven central
1 parent ada444b commit aad6082

File tree

5 files changed

+74
-179
lines changed

5 files changed

+74
-179
lines changed

.travis.yml

+12-9
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,36 @@
11
language: java
2+
sudo: false
23
jdk:
34
- openjdk8
4-
sudo: false
5+
- openjdk11
56
before_install:
67
- chmod +x ./gradlew
78
script:
8-
- ./gradlew check
9+
- ./gradlew check --stacktrace
910
- ./gradlew jacocoTestReport
1011
before_deploy:
1112
- ./gradlew generateLicenseReport
1213
- ./gradlew javadoc
13-
- mkdir projectpage
14-
- cp -r build/reports/* projectpage
15-
- cp -r build/docs/* projectpage
16-
- cp -r docs/* projectpage
14+
- echo $SIGNING_KEY_SECRING_BASE64 | base64 --decode > ./signing.key.secring
15+
- export SIGNING_KEY_PATH=./signing.key.secring
16+
- mkdir -p projectpage
17+
- cp -rv build/reports/* projectpage
18+
- cp -rv build/docs/* projectpage
19+
- cp -rv docs/* projectpage
1720
deploy:
1821
- provider: script
1922
skip_cleanup: true
20-
script: ./gradlew bintrayUpload -Ddeployment=true
23+
script: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository -DDEPLOYMENT=true
2124
on:
2225
tags: true
23-
jdk: openjdk8
26+
jdk: openjdk11
2427
- provider: pages
2528
skip_cleanup: true
2629
github-token: $GITHUB_TOKEN
2730
local-dir: projectpage
2831
keep-history: false
2932
on:
3033
branch: master
31-
jdk: openjdk8
34+
jdk: openjdk11
3235
after_success:
3336
- bash <(curl -s https://codecov.io/bash)

build.gradle

+42-89
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,44 @@
11
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
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

6421
apply plugin: 'java'
6522
apply plugin: 'jacoco'
6623
apply plugin: 'idea'
6724
apply plugin: 'eclipse'
6825

26+
group = project['POM.groupId']
27+
28+
sourceCompatibility = JavaVersion.VERSION_1_8
29+
6930
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' }
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-
9339
dependencies {
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+
10960
sourceSets {
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

12691
if(!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

151106
eclipse {
152107
classpath {
@@ -162,13 +117,6 @@ idea {
162117
}
163118
}
164119

165-
test {
166-
testLogging {
167-
events "failed"
168-
exceptionFormat "short"
169-
}
170-
}
171-
172120
if (!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
}

gradle.properties

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
POM.groupId=org.tensorics
2+
POM.artifactId=tensorics-core
3+
POM.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.
4+
5+
INFO.repo=https://github.com/tensorics/tensorics-core.git
6+
INFO.url=http://tensorics.org/
7+
INFO.github=https://github.com/tensorics/tensorics-core
8+
INFO.githubIssues=https://github.com/tensorics/tensorics-core/issues
9+
INFO.licenseNameShort=Apache-2.0
10+
INFO.licenseName=The Apache License, Version 2.0
11+
INFO.licenseUrl=http://www.apache.org/licenses/LICENSE-2.0.txt
12+
INFO.mainDeveloper=tensorics-developers
13+
INFO.mainDeveloperEmail[email protected]
14+
INFO.organization=tensorics
15+
16+
SONATYPE.repoUrl=https://oss.sonatype.org/service/local/
17+
SONATYPE.repoSnapshotsUrl=https://oss.sonatype.org/content/repositories/snapshots/
18+
19+
guavaVersion=29.0-jre
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.8.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

scripts/bintray-deploy.gradle

-80
This file was deleted.

0 commit comments

Comments
 (0)