Skip to content

Commit 7b2c569

Browse files
committed
Add bintray publishing
1 parent d04fcfc commit 7b2c569

File tree

7 files changed

+147
-2
lines changed

7 files changed

+147
-2
lines changed

build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ apply from: script('dependencies')
44
buildscript {
55
repositories {
66
mavenCentral()
7+
jcenter()
78
}
89
dependencies {
910
classpath 'no.entitas.gradle.jaxb:gradle-jaxb-plugin:2.0'
11+
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:0.3'
1012
}
1113
}
1214

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
group=com.bol.openapi
2-
version=4.0.0-SNAPSHOT
2+
version=4.0.0

gradle/publishing.gradle

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
apply plugin: 'maven-publish'
2+
apply plugin: 'bintray'
3+
publishing {
4+
publications {
5+
main(MavenPublication) {
6+
if (plugins.hasPlugin('war')) {
7+
from components.web
8+
} else {
9+
from components.java
10+
}
11+
artifact sourcesJar
12+
// artifact javadocJar
13+
// artifact groovydocJar
14+
pom.withXml {
15+
asNode().with {
16+
appendNode('name', 'Bol.com OpenAPI Java client')
17+
appendNode('description', 'Bol.com OpenAPI Java client')
18+
appendNode('url', 'http://github.com/pvdissel/openapi-java')
19+
appendNode('licenses').with {
20+
appendNode('license').with {
21+
appendNode('name', 'MIT')
22+
appendNode('url', 'http://opensource.org/licenses/MIT')
23+
}
24+
}
25+
appendNode('developers').with {
26+
appendNode('developer').with {
27+
appendNode('id', 'pvdissel')
28+
appendNode('name', 'Patrick van Dissel')
29+
appendNode('email', 'pvdissel@gmail.com')
30+
}
31+
}
32+
appendNode('scm').with {
33+
appendNode('connection', 'git://github.com/pvdissel/openapi-java.git')
34+
appendNode('developerConnection', 'git@github.com:pvdissel/openapi-java.git')
35+
appendNode('url', 'http://github.com/pvdissel/openapi-java')
36+
}
37+
}
38+
}
39+
}
40+
}
41+
repositories {
42+
mavenLocal()
43+
}
44+
}
45+
if (project.hasProperty('bintrayUser') && project.hasProperty('bintrayKey')) {
46+
bintray {
47+
user = project.bintrayUser
48+
key = project.bintrayKey
49+
publications = ['main']
50+
pkg {
51+
repo = 'bol-com-releases'
52+
name = 'com.bol.openapi:openapi-java'
53+
desc = 'Bol.com OpenAPI Java client'
54+
licenses = ['Apache-2.0']
55+
labels = []
56+
}
57+
}
58+
}
59+
bintrayUpload.dependsOn('generatePomFileForMainPublication', 'build')

subprojects/api/api.gradle

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,31 @@ def setTestProperties = {
2222

2323
test setTestProperties
2424
integrationTest setTestProperties
25+
26+
apply from: script('publishing')
27+
28+
archivesBaseName = "${rootProject.name}-${project.name}"
29+
publishing {
30+
publications {
31+
main(MavenPublication) {
32+
artifactId project.archivesBaseName
33+
}
34+
}
35+
}
36+
task sourcesJar(type: Jar) {
37+
classifier = 'sources'
38+
from sourceSets.main.allSource
39+
}
40+
task javadocJar(type: Jar) {
41+
classifier = 'javadoc'
42+
from javadoc.outputs.files
43+
}
44+
task groovydocJar(type: Jar) {
45+
classifier = 'groovydoc'
46+
from groovydoc.outputs.files
47+
}
48+
artifacts {
49+
archives sourcesJar
50+
// archives javadocJar
51+
// archives groovydocJar
52+
}

subprojects/client/client.gradle

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,31 @@ def setTestProperties = {
2020

2121
test setTestProperties
2222
integrationTest setTestProperties
23+
24+
apply from: script('publishing')
25+
26+
archivesBaseName = "${rootProject.name}-${project.name}"
27+
publishing {
28+
publications {
29+
main(MavenPublication) {
30+
artifactId project.archivesBaseName
31+
}
32+
}
33+
}
34+
task sourcesJar(type: Jar) {
35+
classifier = 'sources'
36+
from sourceSets.main.allSource
37+
}
38+
task javadocJar(type: Jar) {
39+
classifier = 'javadoc'
40+
from javadoc.outputs.files
41+
}
42+
task groovydocJar(type: Jar) {
43+
classifier = 'groovydoc'
44+
from groovydoc.outputs.files
45+
}
46+
artifacts {
47+
archives sourcesJar
48+
// archives javadocJar
49+
// archives groovydocJar
50+
}

subprojects/client/src/integrationTest/groovy/com/bol/openapi/OpenApiClientIntegrationSpec.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class OpenApiClientIntegrationSpec extends Specification {
8282

8383
def product = results.products.get(0)
8484
println product.EAN
85-
product.offerData.offers.size() > 1
85+
product.offerData.offers.size() >= 1
8686
}
8787

8888
def 'Return cheapest offer of a product'() {

subprojects/schema/schema.gradle

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,31 @@ dependencies {
77
testCompile libraries.spock
88
testCompile libraries.hamcrest
99
}
10+
11+
apply from: script('publishing')
12+
13+
archivesBaseName = "${rootProject.name}-${project.name}"
14+
publishing {
15+
publications {
16+
main(MavenPublication) {
17+
artifactId project.archivesBaseName
18+
}
19+
}
20+
}
21+
task sourcesJar(type: Jar) {
22+
classifier = 'sources'
23+
from sourceSets.main.allSource
24+
}
25+
task javadocJar(type: Jar) {
26+
classifier = 'javadoc'
27+
from javadoc.outputs.files
28+
}
29+
task groovydocJar(type: Jar) {
30+
classifier = 'groovydoc'
31+
from groovydoc.outputs.files
32+
}
33+
artifacts {
34+
archives sourcesJar
35+
// archives javadocJar
36+
// archives groovydocJar
37+
}

0 commit comments

Comments
 (0)