@@ -7,6 +7,8 @@ apply plugin: 'com.jfrog.bintray'
77allprojects {
88 apply plugin : ' java'
99 apply plugin : ' jacoco'
10+ apply plugin : ' maven-publish'
11+ apply plugin : ' com.jfrog.bintray'
1012
1113 repositories {
1214 jcenter()
@@ -26,6 +28,11 @@ allprojects {
2628 csv. enabled = false
2729 }
2830 }
31+
32+ // invoke this task when ready to publish to Bintray
33+ bintrayUpload {
34+ dependsOn ' :bintrayCredentialsCheck'
35+ }
2936}
3037
3138subprojects {
@@ -91,10 +98,23 @@ task setBuild() {
9198 }
9299}
93100
101+ def packageName = ' flywheel-core'
102+
94103group = ' au.com.williamhill.flywheel'
95104version = packageVersion
96105
97- def packageName = ' flywheel-core'
106+ def envUser = ' BINTRAY_USER'
107+ def envKey = ' BINTRAY_KEY'
108+ task bintrayCredentialsCheck {
109+ doLast {
110+ if (System . getenv(envUser) == null ) {
111+ throw new GradleException (" No Bintray username specified; set with 'export ${ envUser} =<username>'" )
112+ }
113+ if (System . getenv(envKey) == null ) {
114+ throw new GradleException (" No Bintray key specified; set with 'export ${ envKey} =<key>'" )
115+ }
116+ }
117+ }
98118
99119repositories {
100120 jcenter()
@@ -120,41 +140,30 @@ dependencies {
120140 testRuntime ' log4j:log4j:1.2.17'
121141}
122142
123- def envUser = ' BINTRAY_USER'
124- def envKey = ' BINTRAY_KEY'
125- task bintrayCredentialsCheck {
126- doLast {
127- if (System . getenv(envUser) == null ) {
128- throw new GradleException (" No Bintray username specified; set with 'export ${ envUser} =<username>'" )
129- }
130- if (System . getenv(envKey) == null ) {
131- throw new GradleException (" No Bintray key specified; set with 'export ${ envKey} =<key>'" )
132- }
133- }
134- }
135-
136143def packageDesc = ' A simple, fast, WebSocket-based IoT message broker'
144+ def repoName = ' flywheel'
137145bintray {
138146 user = System . getenv(envUser)
139147 key = System . getenv(envKey)
140148 publications = [' mavenJava' ]
141149 pkg {
142- repo = ' flywheel '
150+ repo = " ${ repoName } "
143151 name = packageName
144152 userOrg = ' william-hill-community'
145153 desc = packageDesc
146- websiteUrl = ' https://github.com/william-hill-community/flywheel '
154+ websiteUrl = " https://github.com/william-hill-community/${ repoName } "
147155 licenses = [' BSD New' ]
148- vcsUrl = ' https://github.com/william-hill-community/flywheel.git'
156+ vcsUrl = " https://github.com/william-hill-community/${ repoName} "
157+ issueTrackerUrl = " https://github.com/william-hill-community/${ repoName} /issues"
149158 publicDownloadNumbers = true
150- githubRepo = ' william-hill-community/flywheel '
159+ githubRepo = " william-hill-community/${ repoName } "
151160 override = true
152161 publish = false
153162 version {
154- name = packageVersion
163+ name = project( ' : ' ) . version
155164 desc = packageDesc
156165 released = new Date ()
157- vcsTag = packageVersion
166+ vcsTag = project( ' : ' ) . version
158167 }
159168 }
160169}
0 commit comments