From 173d5e13987552d7129f93b4ed63bd2f342b6531 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=8F=AA=E5=85=8B?= <429094465@qq.com> Date: Sat, 17 Apr 2021 04:34:48 +0800 Subject: [PATCH] fix #24 (#30) --- gradle-mavenizer.gradle | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/gradle-mavenizer.gradle b/gradle-mavenizer.gradle index 514aa4d..ac0c9bf 100644 --- a/gradle-mavenizer.gradle +++ b/gradle-mavenizer.gradle @@ -8,21 +8,25 @@ apply from: "https://raw.githubusercontent.com/sky-uk/gradle-maven-plugin/${grad project.afterEvaluate { publishing { publications { - mavenPublish(MavenPublication) { - if (isAndroidProject()) { - artifact bundleReleaseAar - artifact androidJavadocsJar - artifact androidSourcesJar - } else { + if (isAndroidProject()) { + android.libraryVariants.all { variant -> + "maven${variant.name.capitalize()}Publish"(MavenPublication) { + artifact project.tasks.findByName("bundle${variant.name.capitalize()}Aar") + artifact androidJavadocsJar + artifact androidSourcesJar + } + } + } else { + mavenPublish(MavenPublication) { artifact jar artifact sourcesJar artifact javadocJar } - + decoratePom(pom) } } - + repositories { def isToRemoteRepo = getBooleanProperty("mavPublishToRemoteRepo") def isToInternalRepo = getBooleanProperty("mavPublishToInternalRepo")