Skip to content

Commit 4424e4a

Browse files
committed
"Fix POM generation"
Change-Id: Ie30c99bb27c77d9741de0c15ab4a5e03a7cd9897
1 parent fad63c4 commit 4424e4a

File tree

2 files changed

+25
-8
lines changed

2 files changed

+25
-8
lines changed

build.gradle

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ allprojects { project ->
3333

3434
def isLibrary = 'library'.equals(project.name)
3535
def isSubmodule = project.ext.submodules.contains(project.name)
36+
def pomTask = "generatePomFileFor${project.name.capitalize()}LibraryPublication"
3637

3738
if (isSubmodule) {
3839

@@ -62,20 +63,20 @@ allprojects { project ->
6263
from javadoc.destinationDir
6364
}
6465

66+
// Define base name for archives
67+
// Ex: firebase-ui-auth
68+
archivesBaseName = "firebase-ui-${project.name}"
69+
6570
// Convenience tasks that depends on the above
66-
task prepareArtifacts(dependsOn: [javadocJar, sourcesJar, assembleRelease]) {}
71+
task prepareArtifacts(dependsOn: [javadocJar, sourcesJar, assembleRelease, pomTask]) {}
6772

6873
// Use tasks above to define artifacts
6974
artifacts {
7075
archives javadocJar
7176
archives sourcesJar
7277
}
7378

74-
// Define base name for archives
75-
// Ex: firebase-ui-auth
76-
archivesBaseName = "firebase-ui-${project.name}"
77-
78-
// So that we can define publications
79+
// So that we can define publication
7980
apply plugin: 'maven-publish'
8081

8182
publishing {
@@ -122,6 +123,13 @@ allprojects { project ->
122123
}
123124
}
124125

126+
repositories {
127+
maven {
128+
name 'BuildLocal'
129+
url "$buildDir/repo"
130+
}
131+
}
132+
125133
}
126134
}
127135

@@ -130,6 +138,7 @@ allprojects { project ->
130138
apply plugin: 'com.jfrog.bintray'
131139

132140
def archivesBaseName = isLibrary ? 'firebase-ui' : "firebase-ui-${project.name}"
141+
def pomLoc = isLibrary ? "$buildDir/publications/monolithLibrary/pom-default.xml" : "$buildDir/publications/${project.name}Library/pom-default.xml"
133142

134143
group = project.ext.group
135144
version = project.ext.version
@@ -140,6 +149,14 @@ allprojects { project ->
140149
user = hasProperty('BINTRAY_USER') ? getProperty('BINTRAY_USER') : System.getenv('BINTRAY_USER')
141150
key = hasProperty('BINTRAY_KEY') ? getProperty('BINTRAY_KEY') : System.getenv('BINTRAY_KEY')
142151

152+
filesSpec {
153+
from pomLoc
154+
into "com/firebaseui/$archivesBaseName/$versionName/"
155+
rename { String fileName ->
156+
"${archivesBaseName}-${project.ext.version}.pom"
157+
}
158+
}
159+
143160
configurations = [ 'archives' ]
144161

145162
pkg {

library/publish.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ task prepareArtifacts(dependsOn: [
5555
javadocJar,
5656
sourcesJar,
5757
assembleRelease,
58-
prepareArtifactsTasks()]) {
59-
58+
prepareArtifactsTasks(),
59+
"generatePomFileForMonolithLibraryPublication"]) {
6060
}
6161

6262
/**

0 commit comments

Comments
 (0)