Skip to content

Commit 6877aef

Browse files
committed
ci: Use script deployment with new setup for Bintray
1 parent 129ee20 commit 6877aef

33 files changed

+179
-600
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ compare-comply/src/test/resources/compare_comply/cloud-object-storage-credential
2626
compare-comply/src/test/resources/compare_comply/cloud-object-storage-credentials-output.json
2727
secrets.tar
2828
package-lock.json
29+
*.mlmodel

.travis.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,23 +54,16 @@ script:
5454
#- "./gradlew docs > /dev/null"
5555
after_success:
5656
- bash <(curl -s https://codecov.io/bash)
57-
before_deploy:
58-
- cat .utility/bintray-config.template | envsubst >bintray-config.json
59-
- cat bintray-config.json
60-
- "./gradlew generatePomFileForMavenPublication"
6157
deploy:
62-
- provider: bintray
63-
file: bintray-config.json
64-
user: $BINTRAY_USER
65-
key: $BINTRAY_APIKEY
58+
- provider: script
6659
skip_cleanup: true
60+
script: "./gradlew bintrayUpload"
6761
on:
6862
branch: bintray-deploy
6963
jdk: openjdk7
7064
#- provider: script
7165
# skip_cleanup: true
72-
# script:
73-
# - semantic-release
66+
# script: "semantic-release"
7467
# on:
7568
# branch: bintray-deploy
7669
# jdk: openjdk7

.utility/bintray-config.template

Lines changed: 0 additions & 41 deletions
This file was deleted.

.utility/bintray-properties.gradle

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
ext {
2+
packageName = PACKAGE_NAME
3+
libraryName = NAME
4+
artifact = ARTIFACT_ID
5+
libraryDescription = DESCRIPTION
6+
}
7+
8+
apply from: rootProject.file('.utility/bintray-release.gradle')

.utility/bintray-release.gradle

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
apply plugin: 'com.jfrog.bintray'
2+
apply plugin: 'com.github.johnrengelman.shadow'
3+
apply plugin: 'java'
4+
apply plugin: 'java-library'
5+
apply plugin: 'maven'
6+
apply plugin: 'maven-publish'
7+
8+
bintrayUpload.dependsOn assemble
9+
bintrayUpload.dependsOn sourcesJar
10+
bintrayUpload.dependsOn javadocJar
11+
12+
bintray {
13+
user = System.getenv('BINTRAY_USER')
14+
key = System.getenv('BINTRAY_APIKEY')
15+
publications = ['maven']
16+
dryRun = false
17+
pkg {
18+
repo = 'ibm-cloud-sdk-repo'
19+
name = packageName
20+
userOrg = 'ibm-cloud-sdks'
21+
licenses = ['Apache-2.0']
22+
vcsUrl = 'https://github.com/watson-developer-cloud/java-sdk.git'
23+
version {
24+
name = project.property('version')
25+
vcsTag = project.property('version')
26+
released = new Date()
27+
}
28+
}
29+
}
30+
31+
def pomConfig = {
32+
scm {
33+
connection 'scm:git:[email protected]:watson-developer-cloud/java-sdk.git'
34+
developerConnection 'scm:git:[email protected]:watson-developer-cloud/java-sdk.git'
35+
url 'https://github.com/watson-developer-cloud/java-sdk'
36+
}
37+
38+
issueManagement {
39+
system 'GitHub'
40+
url 'https://github.com/watson-developer-cloud/java-sdk/issues'
41+
42+
}
43+
44+
ciManagement {
45+
system 'Travis CI'
46+
url 'https://travis-ci.org/watson-developer-cloud/java-sdk'
47+
}
48+
49+
licenses {
50+
license {
51+
name 'The Apache License, Version 2.0'
52+
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
53+
}
54+
}
55+
56+
developers {
57+
developer {
58+
id 'german'
59+
name 'German Attanasio'
60+
61+
}
62+
developer {
63+
id 'logan'
64+
name 'Logan Patino'
65+
66+
}
67+
}
68+
}
69+
70+
publishing {
71+
publications {
72+
maven(MavenPublication) {
73+
from components.java
74+
artifact sourcesJar
75+
artifact javadocJar
76+
artifact shadowJar
77+
groupId 'com.ibm.watson'
78+
artifactId artifact
79+
version project.property('version')
80+
pom.withXml {
81+
def root = asNode()
82+
root.appendNode('description', libraryDescription)
83+
root.appendNode('name', libraryName)
84+
root.appendNode('url', 'https://cloud.ibm.com/developer/watson/dashboard')
85+
root.children().last() + pomConfig
86+
}
87+
}
88+
}
89+
}

assistant/build.gradle

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -68,43 +68,4 @@ processResources {
6868
]
6969
}
7070

71-
task writeNewPom {
72-
doLast {
73-
pom {
74-
project {
75-
name 'IBM Watson Java SDK - Assistant'
76-
packaging 'jar'
77-
description 'Java client library to use the IBM Assistant API'
78-
url 'https://cloud.ibm.com/developer/watson/dashboard'
79-
80-
scm {
81-
connection 'scm:git:[email protected]:watson-developer-cloud/java-sdk.git'
82-
developerConnection 'scm:git:[email protected]:watson-developer-cloud/java-sdk.git'
83-
url 'https://github.com/watson-developer-cloud/java-sdk'
84-
}
85-
86-
licenses {
87-
license {
88-
name 'The Apache License, Version 2.0'
89-
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
90-
}
91-
}
92-
93-
developers {
94-
developer {
95-
id 'german'
96-
name 'German Attanasio'
97-
98-
}
99-
developer {
100-
id 'logan'
101-
name 'Logan Patino'
102-
103-
}
104-
}
105-
}
106-
}.writeTo("$buildDir/poms/pom-default.xml")
107-
}
108-
}
109-
110-
install.finalizedBy(writeNewPom)
71+
apply from: rootProject.file('.utility/bintray-properties.gradle')

assistant/gradle.properties

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
PACKAGE_NAME=com.ibm.watson:assistant
2+
ARTIFACT_ID=assistant
3+
NAME=IBM Watson Java SDK - Assistant
4+
DESCRIPTION=Java client library to use the IBM Assistant API

build.gradle

Lines changed: 9 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1-
plugins {
2-
id 'net.researchgate.release' version '2.4.0'
3-
id 'me.champeau.gradle.japicmp' version '0.2.6'
1+
buildscript {
2+
repositories {
3+
maven { url "https://plugins.gradle.org/m2/" }
4+
jcenter()
5+
}
6+
dependencies {
7+
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
8+
classpath "com.github.jengelman.gradle.plugins:shadow:1.2.4"
9+
}
410
}
511

612
apply from: 'utils.gradle'
@@ -128,30 +134,3 @@ task testReport(type: TestReport) {
128134
// Include the results from the `test` task in all subprojects
129135
reportOn subprojects*.test
130136
}
131-
132-
release {
133-
tagTemplate = 'v$version'
134-
}
135-
136-
task startmessage {
137-
doLast {
138-
println 'starting build'
139-
}
140-
}
141-
142-
task japicmp(type: me.champeau.gradle.japicmp.JapicmpTask) {
143-
ext.oldJarVersion = project.hasProperty('oldJarVersion') ? project.getProperty('oldJarVersion') : "pass-in-older-jar-version"
144-
ext.newJarVersion = project.hasProperty('newJarVersion') ? project.getProperty('newJarVersion') : "pass-in-newer-jar-version"
145-
ext.oldJarPath = project.hasProperty('oldJarPath') ? project.getProperty('oldJarPath') : "pass/in/path/to/older/version.jar"
146-
ext.newJarPath = project.hasProperty('newJarPath') ? project.getProperty('newJarPath') : "pass/in/path/to/newer/version.jar"
147-
148-
oldClasspath = files(oldJarPath)
149-
newClasspath = files(newJarPath)
150-
151-
onlyModified = true
152-
failOnModification = true
153-
154-
htmlOutputFile = file("$buildDir/reports/java-sdk-api-diff-" + oldJarVersion + "-to-" + newJarVersion + ".html")
155-
}
156-
157-
beforeReleaseBuild.dependsOn startmessage

compare-comply/build.gradle

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -68,43 +68,4 @@ processResources {
6868
]
6969
}
7070

71-
task writeNewPom {
72-
doLast {
73-
pom {
74-
project {
75-
name 'IBM Watson Java SDK - Compare and Comply'
76-
packaging 'jar'
77-
description 'Java client library to use the IBM Compare and Comply API'
78-
url 'https://cloud.ibm.com/developer/watson/dashboard'
79-
80-
scm {
81-
connection 'scm:git:[email protected]:watson-developer-cloud/java-sdk.git'
82-
developerConnection 'scm:git:[email protected]:watson-developer-cloud/java-sdk.git'
83-
url 'https://github.com/watson-developer-cloud/java-sdk'
84-
}
85-
86-
licenses {
87-
license {
88-
name 'The Apache License, Version 2.0'
89-
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
90-
}
91-
}
92-
93-
developers {
94-
developer {
95-
id 'german'
96-
name 'German Attanasio'
97-
98-
}
99-
developer {
100-
id 'logan'
101-
name 'Logan Patino'
102-
103-
}
104-
}
105-
}
106-
}.writeTo("$buildDir/poms/pom-default.xml")
107-
}
108-
}
109-
110-
install.finalizedBy(writeNewPom)
71+
apply from: rootProject.file('.utility/bintray-properties.gradle')

compare-comply/gradle.properties

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
PACKAGE_NAME=com.ibm.watson:compare-comply
2+
ARTIFACT_ID=compare-comply
3+
NAME=IBM Watson Java SDK - Compare and Comply
4+
DESCRIPTION=Java client library to use the IBM Compare and Comply API

0 commit comments

Comments
 (0)