-
Notifications
You must be signed in to change notification settings - Fork 211
Add support for Android's archivesBaseName property #202
Conversation
Can one of the admins review this PR? |
@@ -42,7 +42,8 @@ class AndroidArtifacts implements Artifacts { | |||
} | |||
|
|||
def mainJar(Project project) { | |||
"$project.buildDir/outputs/aar/${project.name}-${variant.baseName}.aar" | |||
def artifactBaseName = project.getProperty("archivesBaseName") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about checking if archivesBaseName
is defined, if so use it, if not fall back to ${project.name}-${variant.baseName}
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure it can be added as a fallback, but I would prefer not to. This seems like the only right way to determine the archive's name.
Do you agree, or would you like me to add the fallback anyway?
I do agree with you. Since it's a dynamic property and not an an actual property of the Project
type it's probably better to have a fallback. I'll add this!
Since it's an undocumented API I would not merge that at all. |
ok to test |
Feel free to merge @takecare |
@steurt I am taking a look at the changelog right now, I am gonna roll a new release shortly after. Expect Thanks everyone for the patience, we are trying to improve the support on our side to speed up this kind of things in the future. |
Problem
In Android projects I like to include the version name in the resulting artifacts (e.g.
android-1.0.0-release.aar
instead ofandroid-release.aar
). Android supports setting a different archive name using thearchivesBaseName
property (Android Gradle Pluggin support).So Android properly supports this, but the novoda bintray-release plugin doesn't. It always uses the
project.name
for the artifact name. So changing thearchivesBaseName
will cause the bintray-release upload to fail, since it can't find the artifact to upload.Solution
I've modified the AndroidArtifacts.groovy to use the
archivesBaseName
property so it will always look for the correct artifact name. Whether it's modified or default: it's value is always set.I've also modified the build.gradle of the android samples project to demonstrate it's usage. Running a release for the android sample project also shows it works as desired.
Update
It would be great if the (awesome 😎) novoda bintray-release plugin can support this! I hope you'll like this PR, include it in bintray-release and release it in an update soon so I can really start using it.
Any feedback is appreciated!