Skip to content

Commit

Permalink
deployment to maven central
Browse files Browse the repository at this point in the history
  • Loading branch information
andreacalia committed Apr 15, 2021
1 parent d187368 commit 2719c0a
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 152 deletions.
26 changes: 15 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
language: java
dist: trusty
sudo: false
jdk:
- oraclejdk8
- oraclejdk9
- openjdk8
- openjdk11
before_install:
- chmod +x ./gradlew
script:
- ./gradlew check
- ./gradlew javadoc
- ./gradlew check --stacktrace
- ./gradlew jacocoTestReport
before_deploy:
- ./gradlew generateLicenseReport
- ./gradlew javadoc
- echo $SIGNING_KEY_SECRING_BASE64 | base64 --decode > ./signing.key.secring
- export SIGNING_KEY_PATH=./signing.key.secring
deploy:
provider: script
skip_cleanup: true
script: ./gradlew bintrayUpload -Ddeployment=true
on:
tags: true
jdk: oraclejdk8
- provider: script
skip_cleanup: true
script: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository -DDEPLOYMENT=true
on:
tags: true
jdk: openjdk11
after_success:
- bash <(curl -s https://codecov.io/bash)
103 changes: 43 additions & 60 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,44 +1,20 @@
buildscript {
project.ext.CERN_VM = System.getProperty('CERN_TECHNET_VM') ?: System.getenv('CERN_TECHNET_VM') ?: false
project.ext.TRAVIS_CI = System.getProperty('TRAVIS') ?: System.getenv('TRAVIS') ?: false
project.ext.DEPLOYMENT = System.getProperty('deployment') ?: false
project.ext.VCS_TAG = System.getProperty('TRAVIS_TAG') ?: System.getenv('TRAVIS_TAG')
project.ext.POM = [
groupId : 'org.streamingpool',
artifactId : 'streamingpool-core',
description: 'This project is an high level abstraction over Reactive Streams libraries that is currently used inside CERN.',
developers : [[
id : 'streamingpool-dev',
name : 'Streamingpool Developers',
email: 'streamingpool-dev@cern.ch'
]]
]
project.ext.INFO = [
repo : 'https://github.com/streamingpool/streamingpool-core.git',
url : 'http://www.streamingpool.org/',
github : 'https://github.com/streamingpool/streamingpool-core',
githubIssues: 'https://github.com/streamingpool/streamingpool-core/issues'
]
project.ext.BINTRAY = [
repo : 'streamingpool-repos',
name : 'org.streamingpool:streamingpool-core',
organization: 'streamingpool',
userName : 'streamingpool-dev',
apiToken : System.getenv('BINTRAY_API_TOKEN')
]
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 (CERN_VM) {
maven { url 'http://artifactory.cern.ch/gradle-plugins' }
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 {
mavenCentral()
jcenter()
gradlePluginPortal()
}
}

dependencies {
classpath 'com.netflix.nebula:nebula-publishing-plugin:5.1.0'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
classpath 'com.github.jk1:gradle-license-report:1.5'
classpath 'io.github.gradle-nexus:publish-plugin:1.0.0'
}
}

Expand All @@ -47,41 +23,31 @@ apply plugin: 'jacoco'
apply plugin: 'idea'
apply plugin: 'eclipse'

group = project['POM.groupId']

sourceCompatibility = JavaVersion.VERSION_1_8

repositories {
if (CERN_VM) {
maven { url 'http://artifactory.cern.ch/ds-jcenter' }
maven { url 'http://artifactory.cern.ch/development' }
maven { url 'http://artifactory.cern.ch/ds-jcenter' }
maven { url 'http://artifactory.cern.ch/development' }
} else {
mavenCentral()
jcenter()
}
}

if (DEPLOYMENT) {
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'nebula.maven-publish'
apply plugin: 'com.jfrog.bintray'

println 'Applying deployment scripts'
apply from: './scripts/bintray-deploy.gradle'
}

group 'org.streamingpool'

sourceCompatibility = JavaVersion.VERSION_1_8

dependencies {
compile 'org.reactivestreams:reactive-streams:1.0.0'
compile 'io.reactivex.rxjava2:rxjava:2.1.16'

compile 'org.springframework:spring-core:5.1.2.RELEASE'
compile 'org.springframework:spring-context:5.1.2.RELEASE'
compile 'org.springframework:spring-test:5.1.2.RELEASE' // Testing utils in /src/java for the moment
compile group: 'org.springframework', name: 'spring-core', version: springVersion
compile group: 'org.springframework', name: 'spring-context', version: springVersion
// Testing utils in /src/java for the moment
compile group: 'org.springframework', name: 'spring-test', version: springVersion

compile 'org.slf4j:slf4j-api:1.7.25'

compile 'com.google.guava:guava:27.0.1-jre'
compile group: 'com.google.guava', name: 'guava', version: guavaVersion

compile 'junit:junit:4.12' // Testing utils in /src/java for the moment
compile 'org.mockito:mockito-core:2.23.0' // Testing utils in /src/java for the moment
Expand All @@ -105,26 +71,28 @@ sourceSets {
}
}

wrapper {
gradleVersion = '5.4.1'
distributionType = Wrapper.DistributionType.ALL
}

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

task wrapper(type: Wrapper) { gradleVersion = '4.8.1' }

if(!project.tasks.findByName("javadocJar")) {
if (!project.tasks.findByName("javadocJar")) {
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
}

if(!project.tasks.findByName("sourcesJar")) {
if (!project.tasks.findByName("sourcesJar")) {
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
}

artifacts { archives javadocJar, sourcesJar }

jacocoTestReport {
reports {
xml.enabled true
Expand All @@ -146,4 +114,19 @@ idea {
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'
}
21 changes: 21 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
POM.groupId=org.streamingpool
POM.artifactId=streamingpool-core
POM.description=This project is an high level abstraction over Reactive Streams libraries that is currently used inside CERN.

INFO.repo=https://github.com/streamingpool/streamingpool-core.git
INFO.url=http://www.streamingpool.org/
INFO.github=https://github.com/streamingpool/streamingpool-core
INFO.githubIssues=https://github.com/streamingpool/streamingpool-core/issues
INFO.licenseNameShort=Apache-2.0
INFO.licenseName=The Apache License, Version 2.0
INFO.licenseUrl=http://www.apache.org/licenses/LICENSE-2.0.txt
INFO.mainDeveloper=streamingpool-developers
INFO.mainDeveloperEmail=streamingpool-developers@googlegroups.com
INFO.organization=streamingpool

SONATYPE.repoUrl=https://oss.sonatype.org/service/local/
SONATYPE.repoSnapshotsUrl=https://oss.sonatype.org/content/repositories/snapshots/

guavaVersion=29.0-jre
springVersion=5.2.9.RELEASE
springBootVersion=2.2.10.RELEASE
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.8.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
80 changes: 0 additions & 80 deletions scripts/bintray-deploy.gradle

This file was deleted.

0 comments on commit 2719c0a

Please sign in to comment.