Post to bintray using gradle -bintray-plugin

I have an Android library that I would like to publish to bintray.

So far so good, I am using gradle-bintray-plugin 1.2 with the following configuration:

bintray { user = properties.getProperty("bintray.user") key = properties.getProperty("bintray.apikey") configurations = ['archives'] pkg { repo = "android" // thats how my maven repository is called on bintray name = "mylibrary" websiteUrl = "https://somewebsite" // replaced this, since the project should not matter issueTrackerUrl = 'some issuetracker url' vcsUrl = "some repository" licenses = ["Apache-2.0"] publish = true version { // the 2 functions here, are building the version number name = versionNameBuild() // ie 1.0.0-SomeName vcsTag = versionName() // 1.0.0 gpg { // keys are uploaded sign = true } } } } 

The first problem I encountered was that after I downloaded the library, the version number was "unspecified." Meaning that the file was uploaded successfully, but it was called smth. like "mylibrary-unspecified.aar". I realized that I need to additionally specify the version number of the project in gradle.

like this:

 project.version = "1.0.1" 

After that, it worked fine. Now I have only 2 questions left:

I expect my files to be uploaded as follows:

 $BINTRAYUSERNAME/$REPONAME/$PACKAGENAME/$VERSION/*.aar 

But they are actually loaded in smth like this:

 $BINTRAYUSERNAME/$REPONAME/$PROJECT_FOLDERNAME_OF_ANDROID_STUDIO/$SUBDIRECTORY_OF_THE_LIBRARY/$VERSION/*.aar 

Is there any way to change this "path"? Does it matter?

This leads me to the next question. How to specify maven group type? I mean, is this a maven repository? So I have to do this? Maybe this is due to my first question?

+3
source share
1 answer

Is there any way to change this "path"? Does it matter?

Yes and yes. This path changed as soon as I used the group variable:

 group = "my.awesome.group" 

This also solves the second question. The path of the downloaded file is as follows:

 $BINTRAYUSERNAME/$REPONAME/$PACKAGENAME/$GROUPPATH/$VERSION/*.aar 

I recommend using an example script for Android libraries.

+2
source

Source: https://habr.com/ru/post/989574/


All Articles