Skip to content

Commit

Permalink
Publish on bintray (and then jcenter)
Browse files Browse the repository at this point in the history
  • Loading branch information
neuhalje committed Feb 10, 2017
1 parent 53e8d59 commit 7c37293
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 74 deletions.
89 changes: 89 additions & 0 deletions bintray.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
def pomConfig = {

scm {
connection 'scm:git:https://github.com/neuhalje/bouncy-gpg.git'
developerConnection 'scm:git:https://github.com/neuhalje/bouncy-gpg.git'
url 'https://github.com/neuhalje/bouncy-gpg/'
}

licenses {
license {
name 'WTFPL'
url 'http://www.wtfpl.net/'
}
}

developers {
developer {
id 'neuhalje'
name 'Jens Neuhalfen'
email '[email protected]'
}
}
}

task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}

task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}

artifacts {
archives javadocJar, sourcesJar
}

signing {
sign configurations.archives
}

publishing {
publications {
maven(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
groupId group
artifactId 'bouncy-gpg'
version property('version')

pom.withXml {
def root = asNode()
root.appendNode('description', 'Make using Bouncy Castle with OpenPGP fun again!')
root.appendNode('name', 'bouncy-gpg')
root.appendNode('url', 'https://github.com/neuhalje/bouncy-gpg')
root.children().last() + pomConfig
}
}
}
}

bintray {
user = property('bintray_Username')
key = property('bintray_Password')

dryRun = false //[Default: false] Whether to run this as dry-run, without deploying
publish = true //[Default: false] Whether version should be auto published after an upload
override = false //[Default: false] Whether to override version artifacts already published

pkg {
repo = 'maven'
name = 'bouncy-gpg'
licenses = ['WTFPL']
vcsUrl = 'https://github.com/neuhalje/bouncy-gpg.git'
websiteUrl = 'https://github.com/neuhalje/bouncy-gpg'
labels = ['batch-job', 'bouncycastle', 'bouncy-castle', 'gpg', 'gnupg', 'security', 'encryption', 'decryption']

version {
name = property('version')
desc = 'Make using Bouncy Castle with OpenPGP fun again!'
released = new Date()
vcsTag = property('version')
}
}

publications = ['maven']
}
18 changes: 13 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
buildscript {
repositories {
jcenter()
}
}

plugins {
id 'java'
id 'jacoco'

// deploy to maven central
id 'maven'
id 'maven-publish'
id 'signing'

id "com.jfrog.bintray" version "1.7"
}


sourceCompatibility = 1.8
targetCompatibility = 1.8

version = '2.0.0'
group= 'name.neuhalfen.projects.crypto.bouncycastle.openpgp'
version= '2.0.0'

repositories {
jcenter()
Expand Down Expand Up @@ -54,11 +62,11 @@ jacocoTestReport {

check.dependsOn jacocoTestReport

// JCenter deployment
// bintray deployment
// configured in gradle.properties

if ( hasProperty('jcenter_Username')) {
apply from: 'jcenter.gradle'
if (hasProperty('bintray_Username')) {
apply from: 'bintray.gradle'
}
// Misc

Expand Down
2 changes: 1 addition & 1 deletion examples/reencrypt/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dependencies {
compile 'org.bouncycastle:bcprov-jdk15on:1.56'
compile 'org.bouncycastle:bcpg-jdk15on:1.56'

compile 'name.neuhalfen.projects.crypto.bouncycastle.openpgp:Bouncy-gpg:2.+'
compile 'name.neuhalfen.projects.crypto.bouncycastle.openpgp:bouncy-gpg:2.+'

compile 'org.slf4j:slf4j-api:1.7.22'
compile 'ch.qos.logback:logback-classic:1.2.1'
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ signing.keyId=YourKeyId
signing.password=YourPublicKeyPassword
signing.secretKeyRingFile=PathToYourKeyRingFile

jcenter_Username=your-jcenter-id
jcenter_Password=your-jcenter-password
bintray_Username=your-jcenter-id
bintray_Password=your-jcenter-password
66 changes: 0 additions & 66 deletions jcenter.gradle

This file was deleted.

1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rootProject.name = 'bouncy-gpg'

0 comments on commit 7c37293

Please sign in to comment.