Skip to content

Commit f1b42eb

Browse files
author
Anthony Roux
committed
configuration to automatically deploy artifacts on BinTray
1 parent 4618dd7 commit f1b42eb

File tree

3 files changed

+123
-6
lines changed

3 files changed

+123
-6
lines changed

.travis.yml

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,25 @@
11
language: java
2+
install: true
3+
4+
sudo: false
25
jdk:
36
- oraclejdk8
47
- oraclejdk9
58
- openjdk8
6-
branches:
7-
only:
8-
- master
9-
- /^v[0-9]/
9+
10+
before_install:
11+
- chmod +x gradlew
12+
13+
stages:
14+
- name: build
15+
16+
jobs:
17+
include:
18+
- stage: build
19+
script: ./gradlew build
20+
1021
before_deploy: ./gradlew javadoc
22+
1123
deploy:
1224
- provider: pages
1325
local-dir: build/docs/javadoc
@@ -17,3 +29,10 @@ deploy:
1729
on:
1830
branch: master
1931
jdk: openjdk8
32+
- provider: script
33+
script: ./gradlew bintrayUpload -x test -Dbintray.user=$BINTRAY_USER -Dbintray.key=$BINTRAY_KEY -Dbuild.number=$TRAVIS_BUILD_NUMBER
34+
script
35+
on:
36+
tags: true
37+
jdk: openjdk8
38+

build.gradle

Lines changed: 96 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
1+
buildscript {
2+
repositories {
3+
mavenLocal()
4+
mavenCentral()
5+
jcenter()
6+
}
7+
}
8+
19
plugins {
210
id 'io.franzbecker.gradle-lombok' version '1.12'
311
id 'java'
412
id 'net.saliman.cobertura' version '2.5.4'
513
id 'checkstyle'
614
id 'osgi'
15+
id "maven-publish"
16+
id "com.jfrog.bintray" version "1.7.3"
717
}
818

919
sourceCompatibility = 1.7
@@ -21,6 +31,8 @@ configurations {
2131
}
2232

2333
repositories {
34+
mavenLocal()
35+
mavenCentral()
2436
jcenter()
2537
}
2638

@@ -72,9 +84,92 @@ javadoc {
7284
options.docletpath = configurations.doclava.files.asType(List)
7385
}
7486

75-
7687
cobertura {
7788
coverageFormats = ['html', 'xml']
7889
coverageIgnores = [ 'java.io.UnsupportedEncodingException', 'com.amadeus.resources.*' ]
7990
coverageIgnoreTrivial = true
91+
}
92+
93+
task sourcesJar(type: Jar, dependsOn: classes) {
94+
classifier = 'sources'
95+
from sourceSets.main.allSource
96+
}
97+
98+
task javadocJar(type: Jar, dependsOn: javadoc) {
99+
classifier = 'javadoc'
100+
from javadoc.destinationDir
101+
}
102+
103+
artifacts {
104+
archives sourcesJar
105+
archives javadocJar
106+
}
107+
108+
def pomConfig = {
109+
licenses {
110+
license {
111+
name POM_LICENCE_NAME
112+
url POM_LICENCE_URL
113+
distribution POM_LICENCE_DIST
114+
}
115+
}
116+
developers {
117+
developer {
118+
id "aroux"
119+
name "Anthony Roux"
120+
121+
}
122+
developer {
123+
id "cbetta"
124+
name "Cristiano Betta"
125+
126+
}
127+
}
128+
129+
scm {
130+
url POM_SCM_URL
131+
}
132+
}
133+
134+
publishing {
135+
publications {
136+
mavenPublication(MavenPublication) {
137+
from components.java
138+
artifact sourcesJar {
139+
classifier "sources"
140+
}
141+
artifact javadocJar {
142+
classifier "javadoc"
143+
}
144+
groupId GROUP
145+
artifactId POM_ARTIFACT_ID
146+
version VERSION_NAME
147+
pom.withXml {
148+
def root = asNode()
149+
root.appendNode('description', POM_DESCRIPTION)
150+
root.appendNode('name', POM_NAME)
151+
root.appendNode('url', POM_URL)
152+
root.children().last() + pomConfig
153+
}
154+
}
155+
}
156+
}
157+
158+
bintray {
159+
user = System.getProperty('bintray.user')
160+
key = System.getProperty('bintray.key')
161+
publications = ['mavenPublication']
162+
163+
pkg {
164+
repo = BINTRAY_REPO
165+
name = BINTRAY_NAME
166+
licenses = ['MIT']
167+
vcsUrl = POM_SCM_URL
168+
version {
169+
name = VERSION_NAME
170+
desc = VERSION_NAME
171+
released = new Date()
172+
}
173+
}
174+
80175
}

gradle.properties

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
GROUP=com.amadeus
2-
VERSION_NAME=1.0.0-SNAPSHOT
2+
VERSION_NAME=1.0.0
33

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

21+
BINTRAY_REPO=java
22+
BINTRAY_NAME=amadeus-java
23+
2124
VENDOR_NAME=Amadeus IT Group SA (https://amadeus.com)

0 commit comments

Comments
 (0)