Revision control
Copy as Markdown
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
def libLicense = properties.libLicense
def libLicenseUrl = properties.libLicenseUrl
def libRepositoryName = properties.libRepositoryName
def libProjectName = properties.libProjectName
def libUrl = properties.libUrl
def libVcsUrl = properties.libVcsUrl
ext.configurePublish = {
def theGroupId = rootProject.ext.library.groupId
def theArtifactId = project.ext.artifactId
def theDescription = project.ext.description
// This is a little cludgey, but it seems unlikely to cause a problem
def isNative = theArtifactId.endsWith("-native")
publishing {
publications {
aar(MavenPublication) {
project.afterEvaluate {
from components.release
}
// If this goes haywire with
// 'Cannot configure the 'publishing' extension after it has been accessed.',
pom {
groupId = theGroupId
artifactId = theArtifactId
description = theDescription
// For mavenLocal publishing workflow, increment the version number every publish.
version = rootProject.ext.library.version + (rootProject.hasProperty('local') ? '-' + rootProject.property('local') : '')
packaging = "aar"
license {
name = libLicense
url = libLicenseUrl
}
def depLicenses = new XmlSlurper().parse(new File("${projectDir}/dependency-licenses.xml"))
depLicenses.license.each { node ->
license {
name = node.name.text()
url = node.url.text()
}
}
developers {
developer {
name = 'Mozilla Glean Team'
email = 'glean-team@mozilla.com'
}
}
scm {
connection = libVcsUrl
developerConnection = libVcsUrl
url = libUrl
}
}
}
}
}
task checkMavenArtifacts
if (isNative) {
publishing.publications.withType(MavenPublication).each {publication ->
def checkFileTask = task "checkFilesForMavenArtifact-${publication.artifactId}"(type: Exec) {
commandLine "${rootProject.projectDir}/bin/check-artifact.sh", project.buildDir, publication.artifactId
}
checkMavenArtifacts.dependsOn(checkFileTask)
}
}
}