@@ -7,14 +7,14 @@ buildscript {
77 }
88
99 dependencies {
10+ classpath ' com.jfrog.bintray.gradle:gradle-bintray-plugin:1.6'
1011 classpath ' nl.javadude.gradle.plugins:license-gradle-plugin:latest.release'
1112 }
1213}
1314
1415plugins {
15- id ' net.researchgate.release' version ' 2.2.1'
1616 id ' nebula.optional-base' version ' 3.0.3'
17- id " me.champeau.gradle.jmh" version " 0.3.1"
17+ id ' me.champeau.gradle.jmh' version ' 0.3.1'
1818}
1919
2020allprojects {
@@ -24,13 +24,22 @@ allprojects {
2424apply from : ' gradle/license.gradle'
2525apply from : ' gradle/publish.gradle'
2626
27+ allprojects {
28+ def travis_defined_version = System . getenv(' TRAVIS_TAG' )
29+ if (travis_defined_version != null ) {
30+ version = travis_defined_version
31+ }
32+ }
33+
2734subprojects {
35+ apply plugin : ' com.jfrog.bintray'
2836 apply plugin : ' findbugs'
2937 apply plugin : ' java'
3038 apply plugin : ' jacoco'
39+ apply plugin : ' maven-publish'
40+ apply plugin : ' me.champeau.gradle.jmh'
3141 apply plugin : ' nebula.provided-base'
3242 apply plugin : ' nebula.optional-base'
33- apply plugin : ' me.champeau.gradle.jmh'
3443
3544 sourceCompatibility = 1.6
3645 targetCompatibility = 1.6
@@ -102,10 +111,66 @@ subprojects {
102111 testCompile group : ' ch.qos.logback' , name : ' logback-core' , version : logbackVersion
103112 }
104113
105- // for commits performed by the release plugin, skip the travis build (as it would attempt to bump the version)
106- release {
107- preCommitText = ' [ci skip]'
114+ publishing {
115+ publications {
116+ mavenJava(MavenPublication ) {
117+ from components. java
118+ artifact sourcesJar
119+ artifact javadocJar
120+ pom. withXml {
121+ asNode(). children(). last() + {
122+ resolveStrategy = Closure . DELEGATE_FIRST
123+ url ' https://github.com/optimizely/java-sdk'
124+ licenses {
125+ license {
126+ name ' The Apache Software License, Version 2.0'
127+ url ' http://www.apache.org/license/LICENSE-2.0.txt'
128+ distribution ' repo'
129+ }
130+ }
131+ developers {
132+ developer {
133+ id ' optimizely'
134+ name ' Optimizely'
135+ email ' developers@optimizely.com'
136+ }
137+ }
138+ }
139+ }
140+ }
141+ }
142+ }
143+
144+ def bintrayName = ' core-api' ;
145+ if (name. equals(' core-httpclient-impl' )) {
146+ bintrayName = ' httpclient'
108147 }
148+
149+ bintray {
150+ user = System . getenv(' BINTRAY_USER' )
151+ key = System . getenv(' BINTRAY_KEY' )
152+ pkg {
153+ repo = ' optimizely'
154+ name = " optimizely-sdk-${ bintrayName} "
155+ userOrg = ' optimizely'
156+ version {
157+ name = rootProject. version
158+ }
159+ publications = [' mavenJava' ]
160+ }
161+ }
162+
163+ build. dependsOn(' generatePomFileForMavenJavaPublication' )
164+
165+ bintrayUpload. dependsOn ' build'
166+
167+ task ship() {
168+ dependsOn(' bintrayUpload' )
169+ }
170+ }
171+
172+ task ship () {
173+ dependsOn(' :core-api:ship' , ' :core-httpclient-impl:ship' )
109174}
110175
111176// todo: remove this wrapper version once we're publishing to jcenter/maven central
0 commit comments