Skip to content
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.

Commit

Permalink
Add a signature file for released POM files
Browse files Browse the repository at this point in the history
While release syncs with Maven central, it requires ASC files for all
published artifacts. But POM files don't have them right now.
To add them, several significant changes were made:
1. gradle was updated to 5.0 version. As the results, several new fixes
   where applied:
     1. update "lombok" support by adding "annotationProcessor" line as
     the lombok integration is changed
     2. "shadow" plugin was updated to 4.0.3 version as ClassNotFound
     error appears for old version
2. bintray plugin was updated to 1.8.4 version
3. now signing plugin signs publications instead of archives

#145
  • Loading branch information
extsoft committed Dec 31, 2018
1 parent e497a79 commit 739cf14
Show file tree
Hide file tree
Showing 10 changed files with 60 additions and 57 deletions.
2 changes: 1 addition & 1 deletion .rultor.yml
Expand Up @@ -25,4 +25,4 @@ release:
script: |-
cp -v ../gradle.properties ../secring.gpg ./
./gradlew updateVersion -PnewVersion=${tag}
./gradlew clean ready signArchives bintrayUpload --info
./gradlew clean ready signMavenPublication bintrayUpload --info
6 changes: 2 additions & 4 deletions build.gradle
@@ -1,7 +1,5 @@
import groovy.io.FileType

plugins {
id "com.jfrog.bintray" version "1.7" apply false
id "com.jfrog.bintray" version "1.8.4" apply false
}

ext {
Expand Down Expand Up @@ -61,7 +59,7 @@ defaultTasks 'clean', 'ready'

//task to write the version parameter given via command line into the "gradle.properties" files.
// Call with: gradle updateVersion -PnewVersion=1.0.1-SNAPSHOT
task('updateVersion') << {
task('updateVersion') {
if (project.hasProperty('newVersion')) {
//set version in gradle settings
project.version = project.newVersion
Expand Down
78 changes: 39 additions & 39 deletions gradle/bintray.gradle
Expand Up @@ -19,44 +19,6 @@ artifacts {
archives sourcesJar
}

signing {
sign configurations.archives
}

bintray {
user = bintrayUser
key = bintrayApiKey
publications = ['maven']
publish = true
filesSpec {
from("${buildDir}/libs") {
include '*.jar.asc'
}
from("${buildDir}/publications/maven") {
include 'pom-default.xml.asc'
rename 'pom-default.xml.asc', "${project.name}-${project.version}.pom.asc"
}
into "${project.group.replaceAll(/\./, '/')}/${project.name}/${project.version}"
}
pkg {
userOrg = BINTRAY_ORG
repo = rootProject.name
name = project.name
licenses = ['Apache-2.0']
vcsUrl = GITHUB_URL
publicDownloadNumbers = true
version {
name = project.version
vcsTag = project.version
mavenCentralSync {
sync = true
user = sonatypeUsername
password = sonatypePassword
}
}
}
}

// Create the pom configuration:
def pomConfig = {
licenses {
Expand Down Expand Up @@ -98,4 +60,42 @@ publishing {
}
}
}
}
}

signing {
sign publishing.publications.maven
}

bintray {
user = bintrayUser
key = bintrayApiKey
publications = ['maven']
publish = true
filesSpec {
from("${buildDir}/libs") {
include '*.jar.asc'
}
from("${buildDir}/publications/maven") {
include 'pom-default.xml.asc'
rename 'pom-default.xml.asc', "${project.name}-${project.version}.pom.asc"
}
into "${project.group.replaceAll(/\./, '/')}/${project.name}/${project.version}"
}
pkg {
userOrg = BINTRAY_ORG
repo = rootProject.name
name = project.name
licenses = ['Apache-2.0']
vcsUrl = GITHUB_URL
publicDownloadNumbers = true
version {
name = project.version
vcsTag = project.version
mavenCentralSync {
sync = true
user = sonatypeUsername
password = sonatypePassword
}
}
}
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,5 @@
#Mon Mar 13 16:56:27 EET 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.0-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.1-all.zip
23 changes: 13 additions & 10 deletions gradlew
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/usr/bin/env sh

##############################################################################
##
Expand Down Expand Up @@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn ( ) {
warn () {
echo "$*"
}

die ( ) {
die () {
echo
echo "$*"
echo
Expand Down Expand Up @@ -154,16 +154,19 @@ if $cygwin ; then
esac
fi

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

# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [[ "$(uname)" == "Darwin" ]] && [[ "$HOME" == "$PWD" ]]; then
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi

exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
exec "$JAVACMD" "$@"
1 change: 1 addition & 0 deletions sunshine-core/build.gradle
@@ -1,5 +1,6 @@
dependencies {
compileOnly 'org.projectlombok:lombok:1.16.14'
annotationProcessor 'org.projectlombok:lombok:1.16.14'
testCompile 'org.hamcrest:hamcrest-all:1.3'
testCompile 'junit:junit:4.11'
testCompile 'com.github.stefanbirkner:system-rules:1.18.0'
Expand Down
2 changes: 1 addition & 1 deletion sunshine-junit4-integration-tests/build.gradle
Expand Up @@ -3,7 +3,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.1'
classpath 'com.github.jengelman.gradle.plugins:shadow:4.0.3'
}
}

Expand Down
1 change: 1 addition & 0 deletions sunshine-junit4/build.gradle
@@ -1,5 +1,6 @@
dependencies {
compileOnly 'org.projectlombok:lombok:1.16.14'
annotationProcessor 'org.projectlombok:lombok:1.16.14'
compile 'junit:junit:4.11'
testCompile 'org.hamcrest:hamcrest-all:1.3'
}
Expand Down
1 change: 1 addition & 0 deletions sunshine-testng/build.gradle
@@ -1,5 +1,6 @@
dependencies {
compileOnly 'org.projectlombok:lombok:1.16.14'
annotationProcessor 'org.projectlombok:lombok:1.16.14'
compile 'org.testng:testng:6.11'
testCompile 'org.hamcrest:hamcrest-all:1.3'
testCompile 'junit:junit:4.11'
Expand Down

0 comments on commit 739cf14

Please sign in to comment.