@@ -12,6 +12,7 @@ buildscript {
12
12
classpath " org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion "
13
13
classpath ' com.google.gms:google-services:3.2.0'
14
14
classpath ' com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
15
+ classpath ' org.jfrog.buildinfo:build-info-extractor-gradle:4.5.4'
15
16
}
16
17
}
17
18
@@ -87,6 +88,9 @@ allprojects { project ->
87
88
archives sourcesJar
88
89
}
89
90
91
+ // JFrog Artifactory integration
92
+ project. apply plugin : ' com.jfrog.artifactory'
93
+
90
94
// So that we can define publication
91
95
project. apply plugin : ' maven-publish'
92
96
@@ -113,15 +117,18 @@ allprojects { project ->
113
117
def publicationName = isLibrary ? ' monolithLibrary' : " ${ project.name} Library"
114
118
def archivesBaseName = isLibrary ? ' firebase-ui' : " firebase-ui-${ project.name} "
115
119
120
+ def groupName = project. ext. group
121
+ def versionName = project. ext. version;
122
+
116
123
publishing {
117
124
publications {
118
125
" ${ publicationName} " (MavenPublication ) {
119
126
120
- groupId group
127
+ groupId groupName
121
128
artifactId archivesBaseName
122
- version version
129
+ version versionName
123
130
124
- artifact " $buildDir /outputs/aar/$archivesBaseName -release.aar"
131
+ artifact " $buildDir /outputs/aar/${ archivesBaseName} -release.aar"
125
132
artifact javadocJar
126
133
artifact sourcesJar
127
134
@@ -134,30 +141,32 @@ allprojects { project ->
134
141
135
142
configurations. api. dependencies. each {
136
143
def dependencyNode = dependenciesNode. appendNode(' dependency' )
137
- dependencyNode. appendNode(' groupId' , it. group)
138
144
139
145
if (submodules. contains(it. name)) {
146
+ dependencyNode. appendNode(' groupId' , groupName)
140
147
dependencyNode. appendNode(' artifactId' , " firebase-ui-${ it.name} " )
148
+ dependencyNode. appendNode(' version' , versionName)
141
149
} else {
150
+ dependencyNode. appendNode(' groupId' , it. group)
142
151
dependencyNode. appendNode(' artifactId' , it. name)
152
+ dependencyNode. appendNode(' version' , it. version)
143
153
}
144
154
145
- dependencyNode. appendNode(' version' , it. version)
146
-
147
155
dependencyNode. appendNode(' scope' , ' compile' )
148
156
}
149
157
configurations. implementation. dependencies. each {
150
158
def dependencyNode = dependenciesNode. appendNode(' dependency' )
151
- dependencyNode. appendNode(' groupId' , it. group)
152
159
153
160
if (submodules. contains(it. name)) {
161
+ dependencyNode. appendNode(' groupId' , groupName)
154
162
dependencyNode. appendNode(' artifactId' , " firebase-ui-${ it.name} " )
163
+ dependencyNode. appendNode(' version' , versionName)
155
164
} else {
165
+ dependencyNode. appendNode(' groupId' , it. group)
156
166
dependencyNode. appendNode(' artifactId' , it. name)
167
+ dependencyNode. appendNode(' version' , it. version)
157
168
}
158
169
159
- dependencyNode. appendNode(' version' , it. version)
160
-
161
170
dependencyNode. appendNode(' scope' , ' runtime' )
162
171
}
163
172
@@ -206,26 +215,40 @@ allprojects { project ->
206
215
}
207
216
}
208
217
218
+ def bintrayUsername = hasProperty(' BINTRAY_USER' ) ? getProperty(' BINTRAY_USER' ) : System . getenv(' BINTRAY_USER' )
219
+ def bintrayKey = hasProperty(' BINTRAY_KEY' ) ? getProperty(' BINTRAY_KEY' ) : System . getenv(' BINTRAY_KEY' )
220
+
221
+ artifactory {
222
+ contextUrl = ' https://oss.jfrog.org'
223
+ publish {
224
+ repository {
225
+ repoKey = ' oss-snapshot-local'
226
+
227
+ username = bintrayUsername
228
+ password = bintrayKey
229
+ }
230
+ }
231
+ }
232
+
233
+ artifactoryPublish {
234
+ publications(publishing. publications. " $publicationName " )
235
+ }
236
+
209
237
// Bintray Configuration (applies to submodule and the monolith)
210
238
project. apply plugin : ' com.jfrog.bintray'
211
239
212
240
def pomLoc = isLibrary ? " $buildDir /publications/monolithLibrary/pom-default.xml" : " $buildDir /publications/${ project.name} Library/pom-default.xml"
213
241
214
- group = project. ext. group
215
- version = project. ext. version
216
-
217
- def versionName = project. ext. version
218
-
219
242
bintray {
220
- user = hasProperty( ' BINTRAY_USER ' ) ? getProperty( ' BINTRAY_USER ' ) : System . getenv( ' BINTRAY_USER ' )
221
- key = hasProperty( ' BINTRAY_KEY ' ) ? getProperty( ' BINTRAY_KEY ' ) : System . getenv( ' BINTRAY_KEY ' )
243
+ user = bintrayUsername
244
+ key = bintrayKey
222
245
publications = [publicationName]
223
246
224
247
filesSpec {
225
248
from pomLoc
226
249
into " com/firebaseui/$archivesBaseName /$versionName /"
227
250
rename { String fileName ->
228
- " ${ archivesBaseName} -${ version } .pom"
251
+ " ${ archivesBaseName} -${ versionName } .pom"
229
252
}
230
253
}
231
254
0 commit comments