Added deployment configuration

This commit is contained in:
Miro Spönemann 2016-06-15 11:03:53 +02:00
parent 5a729317d8
commit 342b401270
5 changed files with 163 additions and 2 deletions

2
Jenkinsfile vendored
View file

@ -4,6 +4,6 @@ node {
checkout scm
stage 'Build'
sh "./gradlew build"
sh "./gradlew build uploadArchives"
archive '**/build/**/*.jar'
}

View file

@ -12,6 +12,7 @@ subprojects {
apply from: "${rootDir}/gradle/versions.gradle"
apply from: "${rootDir}/gradle/eclipse-project-layout.gradle"
apply from: "${rootDir}/gradle/java-compiler-settings.gradle"
apply from: "${rootDir}/gradle/maven-deployment.gradle"
group = 'org.eclipse.xtext'
}

76
gradle/developers.gradle Normal file
View file

@ -0,0 +1,76 @@
uploadArchives.repositories.mavenDeployer.pom.project {
developers {
developer {
name 'Sven Efftinge'
email 'sven.efftinge@typefox.io'
organization 'TypeFox'
organizationUrl 'http://typefox.io'
}
developer {
name 'Sebastian Benz'
}
developer {
name 'Lorenzo Bettini'
}
developer {
name 'Michael Clay'
}
developer {
name 'Christian Dietrich'
email 'christian.dietrich@itemis.de'
organization 'itemis'
organizationUrl 'http://www.itemis.com'
}
developer {
name 'Moritz Eysholdt'
email 'moritz.eysholdt@typefox.io'
organization 'TypeFox'
organizationUrl 'http://typefox.io'
}
developer {
name 'Dennis Hübner'
email 'dennis.huebner@typefox.io'
organization 'TypeFox'
organizationUrl 'http://typefox.io'
}
developer {
name 'Jan Köhnlein'
email 'jan.koehnlein@typefox.io'
organization 'TypeFox'
organizationUrl 'http://typefox.io'
}
developer {
name 'Anton Kosyakov'
email 'anton.kosyakov@typefox.io'
organization 'TypeFox'
organizationUrl 'http://typefox.io'
}
developer {
name 'Stefan Oehme'
}
developer {
name 'Holger Schill'
email 'holger.schill@itemis.de'
organization 'itemis'
organizationUrl 'http://www.itemis.com'
}
developer {
name 'Christian Schneider'
email 'christian.schneider@typefox.io'
organization 'TypeFox'
organizationUrl 'http://typefox.io'
}
developer {
name 'Miro Spönemann'
email 'miro.spoenemann@typefox.io'
organization 'TypeFox'
organizationUrl 'http://typefox.io'
}
developer {
name 'Knut Wannheden'
}
developer {
name 'Sebastian Zarnekow'
}
}
}

View file

@ -6,6 +6,12 @@ tasks.withType(JavaCompile) {
options.encoding = 'ISO-8859-1'
}
tasks.withType(Javadoc) {
options.encoding = 'ISO-8859-1'
options.tags = [ 'noreference', 'noextend', 'noimplement', 'noinstantiate', 'nooverride', 'model', 'generated', 'ordered' ]
options.addStringOption('Xdoclint:none', '-quiet')
}
configurations {
optional {
description 'Dependencies required at build time, but not exported into meta data'
@ -25,4 +31,3 @@ configurations {
sourceSets.main.compileClasspath += configurations.optional
eclipse.classpath.plusConfigurations += [configurations.optional]
javadoc.classpath += configurations.optional
javadoc.options.addStringOption('-Xdoclint:none')

View file

@ -0,0 +1,79 @@
apply plugin: 'signing'
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
from ('.') {
include 'schema/**', 'model/**'
}
metaInf {
from 'META-INF'
}
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar, javadocJar
}
def envSecretKeyRingFile = System.getenv('SIGNING_KEY_RING')
if (envSecretKeyRingFile != null)
ext.'signing.secretKeyRingFile' = envSecretKeyRingFile
def envKeyId = System.getenv('SIGNING_KEY_ID')
if (envKeyId != null)
ext.'signing.keyId' = envKeyId
def envPassword = System.getenv('SIGNING_PASSWORD')
if (envPassword != null)
ext.'signing.password' = envPassword
signing {
required { gradle.taskGraph.hasTask('uploadArchives') }
sign configurations.archives
}
if (!project.hasProperty('signing.secretKeyRingFile') || !project.property('signing.secretKeyRingFile')
|| !project.hasProperty('signing.keyId') || !project.property('signing.keyId')
|| !project.hasProperty('signing.password') || !project.property('signing.password')) {
signArchives.enabled = false
}
def envSonatypeUser = System.getenv('SONATYPE_USER')
if (envSonatypeUser != null)
ext.'sonatypeUserName' = envSonatypeUser
def envSonatypePassword = System.getenv('SONATYPE_PASSWORD')
if (envSonatypePassword != null)
ext.'sonatypePassword' = envSonatypePassword
uploadArchives.repositories.mavenDeployer {
beforeDeployment { deployment -> signing.signPom(deployment) }
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
if (project.hasProperty('sonatypeUserName') && project.hasProperty('sonatypePassword')) {
authentication(userName: sonatypeUserName, password: sonatypePassword)
}
}
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
if (project.hasProperty('sonatypeUserName') && project.hasProperty('sonatypePassword')) {
authentication(userName: sonatypeUserName, password: sonatypePassword)
}
}
pom.project {
packaging 'jar'
url 'https://www.eclipse.org/Xtext/'
licenses {
license {
name 'Eclipse Public License, Version 1.0'
url 'http://www.eclipse.org/legal/epl-v10.html'
}
}
scm {
connection 'scm:git:git@github.com:eclipse/xtext-core.git'
developerConnection 'scm:git:git@github.com:eclipse/xtext-core.git'
url 'git@github.com:eclipse/xtext-core.git'
}
}
}
apply from: "${rootDir}/gradle/developers.gradle"