Skip to content

Commit

Permalink
"Fix POM generation"
Browse files Browse the repository at this point in the history
Change-Id: Ie30c99bb27c77d9741de0c15ab4a5e03a7cd9897
  • Loading branch information
samtstern committed May 18, 2016
1 parent fad63c4 commit 4424e4a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 8 deletions.
29 changes: 23 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ allprojects { project ->

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

if (isSubmodule) {

Expand Down Expand Up @@ -62,20 +63,20 @@ allprojects { project ->
from javadoc.destinationDir
}

// Define base name for archives
// Ex: firebase-ui-auth
archivesBaseName = "firebase-ui-${project.name}"

// Convenience tasks that depends on the above
task prepareArtifacts(dependsOn: [javadocJar, sourcesJar, assembleRelease]) {}
task prepareArtifacts(dependsOn: [javadocJar, sourcesJar, assembleRelease, pomTask]) {}

// Use tasks above to define artifacts
artifacts {
archives javadocJar
archives sourcesJar
}

// Define base name for archives
// Ex: firebase-ui-auth
archivesBaseName = "firebase-ui-${project.name}"

// So that we can define publications
// So that we can define publication
apply plugin: 'maven-publish'

publishing {
Expand Down Expand Up @@ -122,6 +123,13 @@ allprojects { project ->
}
}

repositories {
maven {
name 'BuildLocal'
url "$buildDir/repo"
}
}

}
}

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

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

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

filesSpec {
from pomLoc
into "com/firebaseui/$archivesBaseName/$versionName/"
rename { String fileName ->
"${archivesBaseName}-${project.ext.version}.pom"
}
}

configurations = [ 'archives' ]

pkg {
Expand Down
4 changes: 2 additions & 2 deletions library/publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ task prepareArtifacts(dependsOn: [
javadocJar,
sourcesJar,
assembleRelease,
prepareArtifactsTasks()]) {

prepareArtifactsTasks(),
"generatePomFileForMonolithLibraryPublication"]) {
}

/**
Expand Down

0 comments on commit 4424e4a

Please sign in to comment.