Skip to content

Commit

Permalink
Merge pull request #2 from anthonyroux/travis-configuration
Browse files Browse the repository at this point in the history
Configuration to automatically deploy artifacts on BinTray
  • Loading branch information
anthonyroux authored May 25, 2018
2 parents 4618dd7 + f1b42eb commit a21f7c1
Show file tree
Hide file tree
Showing 3 changed files with 123 additions and 6 deletions.
27 changes: 23 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
language: java
install: true

sudo: false
jdk:
- oraclejdk8
- oraclejdk9
- openjdk8
branches:
only:
- master
- /^v[0-9]/

before_install:
- chmod +x gradlew

stages:
- name: build

jobs:
include:
- stage: build
script: ./gradlew build

before_deploy: ./gradlew javadoc

deploy:
- provider: pages
local-dir: build/docs/javadoc
Expand All @@ -17,3 +29,10 @@ deploy:
on:
branch: master
jdk: openjdk8
- provider: script
script: ./gradlew bintrayUpload -x test -Dbintray.user=$BINTRAY_USER -Dbintray.key=$BINTRAY_KEY -Dbuild.number=$TRAVIS_BUILD_NUMBER
script
on:
tags: true
jdk: openjdk8

97 changes: 96 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
buildscript {
repositories {
mavenLocal()
mavenCentral()
jcenter()
}
}

plugins {
id 'io.franzbecker.gradle-lombok' version '1.12'
id 'java'
id 'net.saliman.cobertura' version '2.5.4'
id 'checkstyle'
id 'osgi'
id "maven-publish"
id "com.jfrog.bintray" version "1.7.3"
}

sourceCompatibility = 1.7
Expand All @@ -21,6 +31,8 @@ configurations {
}

repositories {
mavenLocal()
mavenCentral()
jcenter()
}

Expand Down Expand Up @@ -72,9 +84,92 @@ javadoc {
options.docletpath = configurations.doclava.files.asType(List)
}


cobertura {
coverageFormats = ['html', 'xml']
coverageIgnores = [ 'java.io.UnsupportedEncodingException', 'com.amadeus.resources.*' ]
coverageIgnoreTrivial = true
}

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

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}

artifacts {
archives sourcesJar
archives javadocJar
}

def pomConfig = {
licenses {
license {
name POM_LICENCE_NAME
url POM_LICENCE_URL
distribution POM_LICENCE_DIST
}
}
developers {
developer {
id "aroux"
name "Anthony Roux"
email "[email protected]"
}
developer {
id "cbetta"
name "Cristiano Betta"
email "[email protected]"
}
}

scm {
url POM_SCM_URL
}
}

publishing {
publications {
mavenPublication(MavenPublication) {
from components.java
artifact sourcesJar {
classifier "sources"
}
artifact javadocJar {
classifier "javadoc"
}
groupId GROUP
artifactId POM_ARTIFACT_ID
version VERSION_NAME
pom.withXml {
def root = asNode()
root.appendNode('description', POM_DESCRIPTION)
root.appendNode('name', POM_NAME)
root.appendNode('url', POM_URL)
root.children().last() + pomConfig
}
}
}
}

bintray {
user = System.getProperty('bintray.user')
key = System.getProperty('bintray.key')
publications = ['mavenPublication']

pkg {
repo = BINTRAY_REPO
name = BINTRAY_NAME
licenses = ['MIT']
vcsUrl = POM_SCM_URL
version {
name = VERSION_NAME
desc = VERSION_NAME
released = new Date()
}
}

}
5 changes: 4 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
GROUP=com.amadeus
VERSION_NAME=1.0.0-SNAPSHOT
VERSION_NAME=1.0.0

POM_URL=https://github.com/amadeus4dev/amadeus-java
POM_SCM_URL[email protected]:amadeus4dev/amadeus-java.git
Expand All @@ -18,4 +18,7 @@ POM_ARTIFACT_ID=amadeus-java
POM_PACKAGING=jar
POM_ORGANIZATION_URL=https://developer.amadeus.com

BINTRAY_REPO=java
BINTRAY_NAME=amadeus-java

VENDOR_NAME=Amadeus IT Group SA (https://amadeus.com)

0 comments on commit a21f7c1

Please sign in to comment.