Skip to content

Instantly share code, notes, and snippets.

@zhcnxf
Last active May 7, 2020 16:15
Show Gist options
  • Select an option

  • Save zhcnxf/02aeb0ecebd5e4767f3d to your computer and use it in GitHub Desktop.

Select an option

Save zhcnxf/02aeb0ecebd5e4767f3d to your computer and use it in GitHub Desktop.
Deploy aar file to maven repository for each flavor
apply plugin: 'maven-publish'
afterEvaluate {
android.libraryVariants.each { variant ->
if (variant.buildType.name == "release") {
publishing.publications.create variant.flavorName, MavenPublication, {
groupId "$group"
version "$version"
artifactId "$project.name-$variant.flavorName"
artifact variant.outputs.outputFile.get(0)
}
}
}
tasks.publish.dependsOn tasks.assemble
tasks.publishToMavenLocal.dependsOn tasks.assemble
}
@nascimento

nascimento commented Nov 8, 2017 •

Copy link
Copy Markdown

Is it possible to publish without dependson assemble?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment