Use Gradle to publish Android open source projects to Jcenter

Source: Internet
Author: User
Tags jcenter

Here's how to use Gradle to publish to Jcenter.

Register first to https://bintray.com to register an account. Configure accountwe need to configure two properties for Bintray_user and Bintray_key. Bintray_user is your registered account name, Bintray_key can be found in the following ways. , first click on your account name to enter the personal page.  Then click Edit to go to the editing page. Then click on API Key, then click on the right side of show to see the API key.
Then go to your. Gradle directory (if you have not configured Gradle_user_home environment variables, it is in your user directory), edit gradle.properties (if not created), join the configuration:
    1. Bintray_user=xxx
    2. Bintray_key=xxx
Configuration Items Download My project: https://github.com/msdx/gradle-publish, copy the gradle.properties into your project, and configure the properties. Then refer to the build.gradle here to add to your build.gradle: 
Buildscript {      repositories {          jcenter ()      }      dependencies {      classpath ' Com.jfrog.bintray.gradle: gradle-bintray-plugin:1.0 '      }  }  

  

Add one more sentence:
    1. Apply from: ' The relative path of your bintray.gradle '
Your bintray.gradle can refer to my project's bintray.gradle to write it. My bintray.gradle here is for the release of Android projects, the release of files including source code, documents and AAR, if you want to publish these, you can use directly. After the command is executed for release configuration, execution of Gradle Bintray is compiled, packaged, and published. Included in the Jcenter Central Library advanced into this page: Https://bintray.com/bintray/jcenter. Then click on the include My package, such as: then search for and tick your item in the popup dialog box. Then you can write your submission request (seemingly also can not write?) ), click "Send", then look at the administrator audit. Auditing waits for administrator approval. It's usually going to pass quickly.  If you're impatient, you can declare your warehouse as Maven {URL http://dl.bintray.com/your user name/maven} before you approve it. Note: If you add this script and run the project in Android Studio, you will get an error, please comment on the "apply from" clause. The reason for the error is that it will not be able to find the task I packaged with AAR, but it is ok under the command line. If there is a better way to pack AAR, welcome to the exchange.

Publish Android Open source projects to Jcenter using Gradle

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.