Last active
May 7, 2020 16:15
-
-
Save zhcnxf/02aeb0ecebd5e4767f3d to your computer and use it in GitHub Desktop.
Deploy aar file to maven repository for each flavor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is it possible to publish without dependson assemble?