Super easy way to publish your Android and Java artifacts to bintray.
The source code is from novoda/bintray-release, and the following improvements have been made:
- Fixed a bug that did not support gradle 6.+
- Replaced the deprecated api in the dependent android gradle plugin
This library has been published to jcenter
and private repositories https://dl.bintray.com/panpf/maven/
, you can freely choose where to download it
Add the following dependencies to your project build.gradle
file:
buildscript {
...
dependencies {
classpath 'com.github.panpf.bintray-publish:bintray-publish:$LAST_VERSION'
}
}
Please replace $LAST_VERSION
with the latest version:
Add the following code to your module build.gradle
file:
// must be applied after your artifact generating plugin (eg. java / com.android.library)
apply plugin: 'com.github.panpf.bintray-publish'
Use the publish
closure to set the info of your module build.gradle
file:
publish {
userOrg = 'panpf'
groupId = 'com.github.pnapf.bintray-publish'
artifactId = 'bintray-publish'
publishVersion = '1.0.0'
desc = 'Oh hi, this is a nice description for a project, right?'
website = 'https://github.com/panpf/bintray-publish'
}
If you use Kotlin DSL use:
configure<com.github.panpf.bintray.publish.PublishExtension> {
userOrg = "panpf"
groupId = "com.github.pnapf.bintray-publish"
artifactId = "bintray-publish"
publishVersion = "1.0.0"
desc = "Oh hi, this is a nice description for a project, right?"
website = "https://github.com/panpf/bintray-publish"
}
Finally, use the task bintrayUpload
to publish (make sure you build the project first!):
$ ./gradlew clean build bintrayUpload -PbintrayUser=BINTRAY_USERNAME -PbintrayKey=BINTRAY_KEY -PdryRun=false
More info on the available properties and other usages in the Github Wiki.
If you are using to release the android aar library, and need to temporarily publish aar to mavenLocal() and rely on it from mavenLocal(), and your Gradle version is 6.0+, then you may need to add the following configuration:
tasks.withType(GenerateModuleMetadata) {
enabled = false
}
If you use Kotlin DSL use:
tasks.withType<GenerateModuleMetadata> {
enabled = false
}
For specific details, please refer to the document aar_mavenlocal_gradle6_error.md
- Gradle: 5.4.1+
- Android gradle plugin: 3.5.0+
Here are a list of useful links:
- If you have a problem check the Issues Page first to see if we are working on it
- For further usage or to delve more deeply checkout the Github Wiki
Please view the CHANGELOG.md file
Copyright (C) 2020 panpf <[email protected]>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.