Skip to content

Make BintrayPublishTask more friendly (have to use reflection) #326

@natario1

Description

@natario1

Hi,
In order to support publishing multiple packages from the same Gradle subproject, I have to use BintrayUploadTask directly instead of configuring the extension.

https://github.com/natario1/MavenPublisher/blob/81f3f070d9e4f2cd6a211b13b4e525172c71d144/publisher/src/main/kotlin/com/otaliastudios/tools/publisher/bintray/BintrayPublicationHandler.kt#L53-L76

It works fine, but the artifact is not really published in the Bintray website - you have to manually go there and approve it. This is because we also need to run a BintrayPublishTask.

But currently there is no way to run BintrayPublishTask with our own BintrayUploadTask, so I have to use reflection on the publishVersion() method like so:

https://github.com/natario1/MavenPublisher/blob/81f3f070d9e4f2cd6a211b13b4e525172c71d144/publisher/src/main/kotlin/com/otaliastudios/tools/publisher/bintray/BintrayPublicationHandler.kt#L78-L86

This is really dirty and I would like to avoid it in the long run. Can BintrayPublishTask be rewritten in such a way that it can be run on user provided BintrayUploadTask ? It could be as simple as having it accept a list of input upload tasks. If list is empty, it could fallback to the default behavior of finding tasks by name.

Without this small fix, the Bintray Gradle Plugin can literally only be used from the extension, which means one package per subproject.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions