|
|
|
@ -134,8 +134,13 @@ def configureSubProjects() {
|
|
|
|
|
// lint every library |
|
|
|
|
def lintTask = project.tasks.create("lint") |
|
|
|
|
subprojects { |
|
|
|
|
repos.addMavenRepositories(repositories) |
|
|
|
|
|
|
|
|
|
// Only modify Android projects. |
|
|
|
|
if (project.name.equals('doclava') || project.name.equals('jdiff')) { |
|
|
|
|
if (project.name.equals('doclava') |
|
|
|
|
|| project.name.equals('jdiff') |
|
|
|
|
|| project.name.equals('support-testutils') |
|
|
|
|
|| project.name.equals('noto-emoji-compat')) { |
|
|
|
|
// disable tests and return |
|
|
|
|
project.tasks.whenTaskAdded { task -> |
|
|
|
|
if (task instanceof org.gradle.api.tasks.testing.Test) { |
|
|
|
@ -152,7 +157,6 @@ def configureSubProjects() {
|
|
|
|
|
version = rootProject.ext.supportVersion |
|
|
|
|
group = 'com.android.support' |
|
|
|
|
|
|
|
|
|
repos.addMavenRepositories(repositories) |
|
|
|
|
project.plugins.whenPluginAdded { plugin -> |
|
|
|
|
def isAndroidLibrary = "com.android.build.gradle.LibraryPlugin" |
|
|
|
|
.equals(plugin.class.name) |
|
|
|
@ -216,60 +220,58 @@ def configureSubProjects() {
|
|
|
|
|
if (isAndroidLibrary || isJavaLibrary) { |
|
|
|
|
// Add library to the aggregate dependency report. |
|
|
|
|
task allDeps(type: DependencyReportTask) {} |
|
|
|
|
// create a release task that produces artifactory friends artifacts |
|
|
|
|
// a.k.a. unique versions for snapshots with their maven-metadata files. |
|
|
|
|
task artifactoryRelease(type : Upload) { |
|
|
|
|
configuration = configurations.archives |
|
|
|
|
repositories { |
|
|
|
|
mavenDeployer { |
|
|
|
|
repository(url: uri("$rootProject.ext.artifactoryRepoOut")) |
|
|
|
|
setUniqueVersion(true) |
|
|
|
|
|
|
|
|
|
project.afterEvaluate { |
|
|
|
|
Upload uploadTask = (Upload) project.tasks.uploadArchives; |
|
|
|
|
uploadTask.repositories.mavenDeployer { |
|
|
|
|
|
|
|
|
|
// Disable unique names for SNAPSHOTS so they can be updated in place. |
|
|
|
|
setUniqueVersion(false) |
|
|
|
|
|
|
|
|
|
// Remove any invalid maven-metadata.xml files that may have been |
|
|
|
|
// created for SNAPSHOT versions that are *not* uniquely versioned. |
|
|
|
|
pom*.each { pom -> |
|
|
|
|
if (pom.version.endsWith('-SNAPSHOT')) { |
|
|
|
|
final File artifactDir = new File( |
|
|
|
|
rootProject.ext.supportRepoOut, |
|
|
|
|
pom.groupId.replace('.', '/') |
|
|
|
|
+ '/' + pom.artifactId |
|
|
|
|
+ '/' + pom.version) |
|
|
|
|
delete fileTree(dir: artifactDir, |
|
|
|
|
include: 'maven-metadata.xml*') |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// Create release and separate zip task for library. |
|
|
|
|
task release(type: Upload) { |
|
|
|
|
configuration = configurations.archives |
|
|
|
|
repositories { |
|
|
|
|
mavenDeployer { |
|
|
|
|
repository(url: uri("$rootProject.ext.supportRepoOut")) |
|
|
|
|
|
|
|
|
|
// Disable unique names for SNAPSHOTS so they can be updated in place. |
|
|
|
|
setUniqueVersion(false) |
|
|
|
|
doLast { |
|
|
|
|
// Remove any invalid maven-metadata.xml files that may have been |
|
|
|
|
// created for SNAPSHOT versions that are *not* uniquely versioned. |
|
|
|
|
pom*.each { pom -> |
|
|
|
|
if (pom.version.endsWith('-SNAPSHOT')) { |
|
|
|
|
final File artifactDir = new File( |
|
|
|
|
rootProject.ext.supportRepoOut, |
|
|
|
|
pom.groupId.replace('.', '/') |
|
|
|
|
+ '/' + pom.artifactId |
|
|
|
|
+ '/' + pom.version) |
|
|
|
|
delete fileTree(dir: artifactDir, |
|
|
|
|
include: 'maven-metadata.xml*') |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
uploadTask.repositories.mavenDeployer.pom*.whenConfigured { pom -> |
|
|
|
|
pom.dependencies.findAll { dep -> |
|
|
|
|
dep.groupId == 'com.android.support' && |
|
|
|
|
dep.artifactId != 'support-annotations' |
|
|
|
|
}*.type = 'aar' |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// create a release task that produces artifactory friends artifacts |
|
|
|
|
// a.k.a. unique versions for snapshots with their maven-metadata files. |
|
|
|
|
task artifactoryRelease(type : Upload) { |
|
|
|
|
configuration = uploadTask.configuration |
|
|
|
|
repositories { |
|
|
|
|
mavenDeployer { |
|
|
|
|
repository(url: uri("$rootProject.ext.artifactoryRepoOut")) |
|
|
|
|
setUniqueVersion(true) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
artifactoryRelease.dependsOn release |
|
|
|
|
|
|
|
|
|
def deployer = release.repositories.mavenDeployer |
|
|
|
|
deployer.pom*.whenConfigured { pom -> |
|
|
|
|
pom.dependencies.findAll { dep -> |
|
|
|
|
dep.groupId == 'com.android.support' && |
|
|
|
|
dep.artifactId != 'support-annotations' |
|
|
|
|
}*.type = 'aar' |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Before the upload, make sure the repo is ready. |
|
|
|
|
release.dependsOn rootProject.tasks.prepareRepo |
|
|
|
|
// Before the upload, make sure the repo is ready. |
|
|
|
|
uploadTask.dependsOn rootProject.tasks.prepareRepo |
|
|
|
|
|
|
|
|
|
artifactoryRelease.dependsOn uploadTask |
|
|
|
|
|
|
|
|
|
// Make the mainupload depend on this one. |
|
|
|
|
mainUpload.dependsOn uploadTask |
|
|
|
|
mainUpload.dependsOn artifactoryRelease |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Make the mainupload depend on this one. |
|
|
|
|
mainUpload.dependsOn release |
|
|
|
|
mainUpload.dependsOn artifactoryRelease |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|