@@ -44,7 +44,7 @@ allprojects { project ->
44
44
def isLibrary = ' library' . equals(project. name)
45
45
def isSubmodule = submodules. contains(project. name)
46
46
47
- if (isSubmodule || isLibrary ) {
47
+ if (isLibrary || isSubmodule ) {
48
48
49
49
// So that we can resolve 'android' variable
50
50
project. apply plugin : ' com.android.library'
@@ -103,16 +103,44 @@ allprojects { project ->
103
103
}
104
104
}
105
105
}
106
- }
107
106
108
- // POM to meet maven specs
109
- if ( isLibrary || isSubmodule) {
110
- def targetName = isLibrary ? ' monolithLibrary ' : " ${ project.name} Library "
107
+ // POM to meet maven specs
108
+ def publicationName = isLibrary ? ' monolithLibrary ' : " ${ project.name } Library "
109
+ def archivesBaseName = isLibrary ? ' firebase-ui ' : " firebase-ui- ${ project.name} "
111
110
112
111
publishing {
113
112
publications {
114
- " ${ targetName} " (MavenPublication ) {
113
+ " ${ publicationName} " (MavenPublication ) {
114
+
115
+ groupId group
116
+ artifactId archivesBaseName
117
+ version version
118
+
119
+ artifact " $buildDir /outputs/aar/$archivesBaseName -release.aar"
120
+ artifact javadocJar
121
+ artifact sourcesJar
122
+
115
123
pom. withXml {
124
+ // Dependencies
125
+ def dependenciesNode = asNode(). getAt(" dependencies" )[0 ]
126
+ if (dependenciesNode == null ) {
127
+ dependenciesNode = asNode(). appendNode(" dependencies" )
128
+ }
129
+
130
+ // Add all that are 'compile'
131
+ configurations. compile. allDependencies. each {
132
+ def dependencyNode = dependenciesNode. appendNode(' dependency' )
133
+ dependencyNode. appendNode(' groupId' , it. group)
134
+
135
+ if (submodules. contains(it. name)) {
136
+ dependencyNode. appendNode(' artifactId' , " firebase-ui-${ it.name} " )
137
+ } else {
138
+ dependencyNode. appendNode(' artifactId' , it. name)
139
+ }
140
+
141
+ dependencyNode. appendNode(' version' , it. version)
142
+ }
143
+
116
144
// Common values
117
145
def repoUrl = ' https://github.com/firebase/FirebaseUI-Android'
118
146
def scmUrl
= ' scm:git:[email protected] /firebase/firebaseui-android.git'
@@ -157,85 +185,10 @@ allprojects { project ->
157
185
}
158
186
}
159
187
}
160
- }
161
-
162
- if (isSubmodule) {
163
- publishing {
164
-
165
- // Define a publication for each submodule
166
- publications {
167
188
168
- // Ex: authLibrary(MavenPublication)
169
- " ${ project.name} Library" (MavenPublication ) {
170
- groupId group
171
- artifactId archivesBaseName
172
- version version
173
-
174
- // Release AAR, Sources, and JavaDoc
175
- artifact " $buildDir /outputs/aar/$archivesBaseName -release.aar"
176
- artifact javadocJar
177
- artifact sourcesJar
178
-
179
- pom. withXml {
180
- def dependenciesNode = asNode(). getAt(" dependencies" )[0 ]
181
- if (dependenciesNode == null ) {
182
- dependenciesNode = asNode(). appendNode(" dependencies" )
183
- }
184
-
185
- // Add all that are 'compile'
186
- configurations. compile. allDependencies. each {
187
- def dependencyNode = dependenciesNode. appendNode(' dependency' )
188
- dependencyNode. appendNode(' groupId' , it. group)
189
- dependencyNode. appendNode(' artifactId' , it. name)
190
- dependencyNode. appendNode(' version' , it. version)
191
- }
192
- }
193
- }
194
- }
195
- }
196
- }
197
-
198
- if (isLibrary) {
199
-
200
- // Define the monolith publication
201
- publishing {
202
-
203
- publications {
204
- monolithLibrary(MavenPublication ) {
205
- groupId group
206
- artifactId archivesBaseName
207
- version version
208
-
209
- artifact " $buildDir /outputs/aar/$archivesBaseName -release.aar"
210
- artifact javadocJar
211
- artifact sourcesJar
212
-
213
- // Monolith is just a POM that depends on the others
214
- pom. withXml {
215
- def dependenciesNode = asNode(). getAt(" dependencies" )[0 ]
216
- if (dependenciesNode == null ) {
217
- dependenciesNode = asNode(). appendNode(" dependencies" )
218
- }
219
-
220
- // Add a maven dependency on each submodule
221
- submodules. each { module ->
222
- def dependencyNode = dependenciesNode. appendNode(' dependency' )
223
- dependencyNode. appendNode(' groupId' , group)
224
- dependencyNode. appendNode(' artifactId' , " firebase-ui-${ module} " )
225
- dependencyNode. appendNode(' version' , version)
226
- }
227
- }
228
- }
229
- }
230
- }
231
- }
232
-
233
- // Bintray Configuration (applies to submodule and the monolith)
234
- if (isSubmodule || isLibrary) {
189
+ // Bintray Configuration (applies to submodule and the monolith)
235
190
project. apply plugin : ' com.jfrog.bintray'
236
191
237
- def archivesBaseName = isLibrary ? ' firebase-ui' : " firebase-ui-${ project.name} "
238
- def publicationName = isLibrary ? ' monolithLibrary' : " ${ project.name} Library"
239
192
def pomLoc = isLibrary ? " $buildDir /publications/monolithLibrary/pom-default.xml" : " $buildDir /publications/${ project.name} Library/pom-default.xml"
240
193
241
194
group = project. ext. group
0 commit comments