Skip to content

Commit c7f1553

Browse files
committed
deployment to maven central
1 parent 3f450cc commit c7f1553

File tree

8 files changed

+140
-192
lines changed

8 files changed

+140
-192
lines changed

.travis.yml

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
11
language: java
2-
jdk:
3-
- oraclejdk8
42
sudo: false
5-
addons:
6-
apt:
7-
packages:
8-
- oracle-java8-installer
3+
jdk:
4+
- openjdk8
5+
- openjdk11
96
before_install:
107
- chmod +x ./gradlew
11-
deploy:
12-
provider: script
13-
skip_cleanup: true
14-
script: ./gradlew bintrayUpload -Ddeployment=true
15-
on:
16-
tags: true
178
script:
18-
- ./gradlew check
9+
- ./gradlew check --stacktrace
1910
- ./gradlew jacocoTestReport
11+
before_deploy:
12+
- ./gradlew generateLicenseReport
13+
- ./gradlew javadoc
14+
- echo $SIGNING_KEY_SECRING_BASE64 | base64 --decode > ./signing.key.secring
15+
- export SIGNING_KEY_PATH=./signing.key.secring
16+
deploy:
17+
- provider: script
18+
skip_cleanup: true
19+
script: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository -DDEPLOYMENT=true
20+
on:
21+
tags: true
22+
jdk: openjdk11
2023
after_success:
2124
- bash <(curl -s https://codecov.io/bash)

build.gradle

Lines changed: 52 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,20 @@
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-starter',
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-starter.git',
34-
url : 'http://tensorics.org/',
35-
github : 'https://github.com/tensorics/tensorics-core-starter',
36-
githubIssues: 'https://github.com/tensorics/tensorics-core-starter/issues'
37-
]
38-
project.ext.BINTRAY = [
39-
repo : 'tensorics-repo',
40-
name : 'org.tensorics:tensorics-core-starter',
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()
11+
gradlePluginPortal()
5412
}
5513
}
14+
5615
dependencies {
57-
classpath 'com.netflix.nebula:nebula-publishing-plugin:5.1.0'
58-
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
16+
classpath 'com.github.jk1:gradle-license-report:1.5'
17+
classpath 'io.github.gradle-nexus:publish-plugin:1.0.0'
5918
}
6019
}
6120

@@ -64,34 +23,28 @@ apply plugin: 'jacoco'
6423
apply plugin: 'idea'
6524
apply plugin: 'eclipse'
6625

26+
group = project['POM.groupId']
27+
28+
sourceCompatibility = JavaVersion.VERSION_1_8
29+
6730
repositories {
68-
if (CERN_VM) {
31+
if (project['CERN_VM']) {
6932
maven { url 'http://artifactory.cern.ch/ds-jcenter' }
7033
maven { url 'http://artifactory.cern.ch/development' }
7134
} else {
7235
mavenCentral()
73-
jcenter()
7436
}
7537
}
7638

77-
if (DEPLOYMENT) {
78-
apply plugin: 'maven'
79-
apply plugin: 'maven-publish'
80-
apply plugin: 'nebula.maven-publish'
81-
apply plugin: 'com.jfrog.bintray'
82-
83-
println 'Applying deployment scripts'
84-
apply from: './scripts/bintray-deploy.gradle'
39+
dependencies {
40+
compile group: 'org.tensorics', name: 'tensorics-core', version: tensoricsCoreVersion
41+
compile (group: 'org.springframework.boot', name: 'spring-boot-starter', version: springBootVersion) { exclude module: "spring-boot-starter-logging" }
42+
testCompile group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: springBootVersion
8543
}
8644

87-
group 'org.tensorics'
88-
89-
sourceCompatibility = JavaVersion.VERSION_1_8
90-
91-
dependencies {
92-
compile 'org.tensorics:tensorics-core:0.+'
93-
compile (group: 'org.springframework.boot', name: 'spring-boot-starter', version: '2.1.0.RELEASE') { exclude module: "spring-boot-starter-logging" }
94-
testCompile group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: '2.1.0.RELEASE'
45+
wrapper {
46+
gradleVersion = '5.4.1'
47+
distributionType = Wrapper.DistributionType.ALL
9548
}
9649

9750
sourceSets {
@@ -101,9 +54,24 @@ sourceSets {
10154
}
10255
}
10356

104-
javadoc { options.encoding = "UTF-8" }
10557

106-
task wrapper(type: Wrapper) { gradleVersion = '4.8.1' }
58+
test {
59+
testLogging {
60+
events "passed", "skipped", "failed"
61+
exceptionFormat "full"
62+
}
63+
}
64+
65+
jacocoTestReport {
66+
reports {
67+
xml.enabled true
68+
xml.destination file("$buildDir/reports/jacoco/report.xml")
69+
html.enabled true
70+
csv.enabled false
71+
}
72+
}
73+
74+
javadoc { options.encoding = "UTF-8" }
10775

10876
if(!project.tasks.findByName("javadocJar")) {
10977
task javadocJar(type: Jar) {
@@ -119,17 +87,6 @@ if(!project.tasks.findByName("sourcesJar")) {
11987
}
12088
}
12189

122-
artifacts { archives javadocJar, sourcesJar }
123-
124-
jacocoTestReport {
125-
reports {
126-
xml.enabled true
127-
xml.destination new File("${buildDir}/reports/jacoco/report.xml")
128-
html.enabled true
129-
csv.enabled false
130-
}
131-
}
132-
13390
eclipse {
13491
classpath {
13592
downloadJavadoc = true
@@ -143,3 +100,18 @@ idea {
143100
downloadSources = true
144101
}
145102
}
103+
104+
if (!project['CERN_VM']) {
105+
println 'Applying licensing report'
106+
apply plugin: 'com.github.jk1.dependency-license-report'
107+
108+
licenseReport {
109+
renderers = [this.class.classLoader.loadClass('com.github.jk1.license.render.InventoryHtmlReportRenderer').newInstance()]
110+
filters = [this.class.classLoader.loadClass('com.github.jk1.license.filter.LicenseBundleNormalizer').newInstance()]
111+
}
112+
}
113+
114+
if (project['DEPLOYMENT']) {
115+
println 'Applying deployment scripts'
116+
apply from: 'https://raw.githubusercontent.com/ossgang/gradle-scripts/master/deployment/deploy-to-maven-central.gradle'
117+
}

gradle.properties

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
POM.groupId=org.tensorics
2+
POM.artifactId=tensorics-core-starter
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-starter.git
6+
INFO.url=http://tensorics.org/
7+
INFO.github=https://github.com/tensorics/tensorics-core-starter
8+
INFO.githubIssues=https://github.com/tensorics/tensorics-core-starter/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+
tensoricsCoreVersion=0.+
20+
springBootVersion=2.2.10.RELEASE

gradle/wrapper/gradle-wrapper.jar

2.24 KB
Binary file not shown.
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#Sat Jul 01 10:54:52 CEST 2017
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-bin.zip

gradlew

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
1-
#!/usr/bin/env bash
1+
#!/usr/bin/env sh
2+
3+
#
4+
# Copyright 2015 the original author or authors.
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#
218

319
##############################################################################
420
##
@@ -28,16 +44,16 @@ APP_NAME="Gradle"
2844
APP_BASE_NAME=`basename "$0"`
2945

3046
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31-
DEFAULT_JVM_OPTS=""
47+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
3248

3349
# Use the maximum available, or set MAX_FD != -1 to use that value.
3450
MAX_FD="maximum"
3551

36-
warn ( ) {
52+
warn () {
3753
echo "$*"
3854
}
3955

40-
die ( ) {
56+
die () {
4157
echo
4258
echo "$*"
4359
echo
@@ -154,11 +170,19 @@ if $cygwin ; then
154170
esac
155171
fi
156172

157-
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
158-
function splitJvmOpts() {
159-
JVM_OPTS=("$@")
173+
# Escape application args
174+
save () {
175+
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
176+
echo " "
160177
}
161-
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
162-
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
178+
APP_ARGS=$(save "$@")
163179

164-
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
180+
# Collect all arguments for the java command, following the shell quoting and substitution rules
181+
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
182+
183+
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
184+
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
185+
cd "$(dirname "$0")"
186+
fi
187+
188+
exec "$JAVACMD" "$@"

gradlew.bat

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
@rem
2+
@rem Copyright 2015 the original author or authors.
3+
@rem
4+
@rem Licensed under the Apache License, Version 2.0 (the "License");
5+
@rem you may not use this file except in compliance with the License.
6+
@rem You may obtain a copy of the License at
7+
@rem
8+
@rem http://www.apache.org/licenses/LICENSE-2.0
9+
@rem
10+
@rem Unless required by applicable law or agreed to in writing, software
11+
@rem distributed under the License is distributed on an "AS IS" BASIS,
12+
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
@rem See the License for the specific language governing permissions and
14+
@rem limitations under the License.
15+
@rem
16+
117
@if "%DEBUG%" == "" @echo off
218
@rem ##########################################################################
319
@rem
@@ -14,7 +30,7 @@ set APP_BASE_NAME=%~n0
1430
set APP_HOME=%DIRNAME%
1531

1632
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17-
set DEFAULT_JVM_OPTS=
33+
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
1834

1935
@rem Find java.exe
2036
if defined JAVA_HOME goto findJavaFromJavaHome
@@ -49,7 +65,6 @@ goto fail
4965
@rem Get command-line arguments, handling Windows variants
5066

5167
if not "%OS%" == "Windows_NT" goto win9xME_args
52-
if "%@eval[2+2]" == "4" goto 4NT_args
5368

5469
:win9xME_args
5570
@rem Slurp the command line arguments.
@@ -60,11 +75,6 @@ set _SKIP=2
6075
if "x%~1" == "x" goto execute
6176

6277
set CMD_LINE_ARGS=%*
63-
goto execute
64-
65-
:4NT_args
66-
@rem Get arguments from the 4NT Shell from JP Software
67-
set CMD_LINE_ARGS=%$
6878

6979
:execute
7080
@rem Setup the command line

0 commit comments

Comments
 (0)