使用gradle这个-bintray-插件上bintray发布 [英] Publish on bintray using the gradle-bintray-plugin

查看:269
本文介绍了使用gradle这个-bintray-插件上bintray发布的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Android的图书​​馆,我想在bintray发布。

到目前为止好,我现在用的是gradle这个-bintray-1.2插件具有以下配置:

  bintray {
    用户= properties.getProperty(bintray.user)
    键= properties.getProperty(bintray.apikey)    配置= ['档案']
    PKG {
        回购=机器人//这就是我的Maven仓库是如何被调用的bintray
        NAME =在MyLibrary
        websiteUrl =htt​​ps://开头somewebsite//代替这一点,因为该项目并不重要
        issueTrackerUrl ='一些issuetracker URL'
        vcsUrl =一些库
        许可证= [Apache的2.0]
        发布=真
        版本{
            //此处的2个功能,正在建设的版本号
            名称= versionNameBuild()//即1.0.0-SomeName
            vcsTag =的versionName()// 1.0.0
            GPG {
                //键上传
                签=真
            }
        }
    }
}

我遇到的第一个问题,是我上传后库的版本号是未指定。这意味着,该文件已成功上传,但它被称为不便。像在MyLibrary-unspecified.aar。我想通了,我不得不另外指定的gradle在该项目的版本号。

是这样的:

  project.version =1.0.1

在这之后,这是工作的罚款。现在,我只有2个问题留给:

我希望我的文件上传这样的:

  $ BINTRAYUSERNAME / $ REPONAME / $ PACKAGENAME / $ VERSION / *。AAR

但它们实际上是上传到水木清华这样的:

<$p$p><$c$c>$BINTRAYUSERNAME/$REPONAME/$PROJECT_FOLDERNAME_OF_ANDROID_STUDIO/$SUBDIRECTORY_OF_THE_LIBRARY/$VERSION/*.aar

我可以改变这个路径不知何故?有什么关系?

这使我对我的下一个问题。
如何指定Maven的组团式?我的意思是Maven仓库吧?所以,我应该能够设置?难道这可能与我的第一个问题?


解决方案

  

我可以改变这个路径不知何故?有什么关系?


是,是的。这条道路改变了,只要我使用的组变量:

 组=my.awesome.group

这解决了第二个问题也是如此。上传的文件的路径则是:

  $ BINTRAYUSERNAME / $ REPONAME / $ PACKAGENAME / $ GROUPPATH / $ VERSION / *。AAR

我建议使用Android的库例子脚本

I have an Android-Library that I would like to publish on bintray.

So far so good, I am using the 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() // i.e. 1.0.0-SomeName
            vcsTag = versionName()  // 1.0.0
            gpg {
                // keys are uploaded
                sign = true
            }
        }
    }
}

The first issue I ran into, was that after I uploaded the library the Version number was "unspecified". Meaning, that the file was uploaded successfully, but it was called smth. like "mylibrary-unspecified.aar". I figured out that I had to additionally specify the project version number in gradle.

like this:

project.version = "1.0.1"

After that, this was working fine. Now I have only 2 Questions left:

I would expect my files to be uploaded like this:

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

But they are actually uploaded to smth like this:

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

Can I change this "path" somehow? Does it matter?

Which leads me to my next question. How can I specify the maven group-type? I mean it's a maven repository right? So I should be able to set this up? Is this may be related to my first question?

解决方案

Can I change this "path" somehow? Does it matter?

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

group = "my.awesome.group"

This solves the second Question as well. The path of the uploaded file is then:

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

I recommend using for Android libraries the example script.

这篇关于使用gradle这个-bintray-插件上bintray发布的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆