Android Development: How to publish the library in Android studio to Jcenter
Source: Internet
Author: User
<span id="Label3"></p><p><p>I wrote a simple library, want to put on the jcenter, check all kinds of information, stepped on a variety of pits, well-done, and finally found a very simple and efficient method, is now shared out, the method of my pro-test can be used to achieve up to about half an hour. This method is a foreign cattle people write out, I am here mainly to do a translation and finishing.</p></p>1 organizing the module to be published<p><p>At the bottom of the Build.gradle file for the library that needs to be published, add this line of code</p></p><pre class="prettyprint"><pre class="prettyprint"><code class=" hljs vhdl"><span class="hljs-attribute">‘https</span>://raw.githubusercontent.com/blundell/<span class="hljs-keyword">release</span>-android-<span class="hljs-keyword">library</span>/master/android-<span class="hljs-keyword">release</span>-aar.gradle‘</code></pre></pre><p><p>Effect</p></p><p><p></p></p><p><p>next, after apply plugin: ' Com.android.library ', add the following code:</p></p><pre class="prettyprint"><pre class="prettyprint"><code class=" hljs matlab"><span class="hljs-cell">{ PUBLISH_GROUP_ID = <span class="hljs-string">‘cn.weidongjian.android‘</span> PUBLISH_ARTIFACT_ID = <span class="hljs-string">‘progress-button‘</span> PUBLISH_VERSION = <span class="hljs-string">‘0.2‘</span>}</span></code></pre></pre><p><p>Where publish_group_id fill in the name of the corresponding developer, publish_artifact_id fill in the name of the project, publish_version fill in the project version, but after the release to Jcenter through, your compile address is:<br>PUBLISH_GROUP_ID:PUBLISH_ARTIFACT_ID:PUBLISH_VERSION<br>For example, my address for this project is:</p></p><pre class="prettyprint"><pre class="prettyprint"><code class=" hljs bash"><span class="hljs-string">‘cn.weidongjian.android:progress-button:0.2‘</span></code></pre></pre><p><p>The effect is as Follows:<br></p></p>2 Generating a ZIP file<p><p>Open terminal, fill in this line of code, and then press ENTER</p></p><pre class="prettyprint"><pre class="prettyprint"><code class=" hljs ">gradlew clean build generateRelease</code></pre></pre><p><p>Effect<br></p></p><p><p>After clicking enter, If you are the first generation, you need to download the corresponding Gradle file, if the download fails, you need to turn over the wall, after the download is complete, that is, to start to generate a zip file, there will be a lot of messages generated, probably like this</p></p><p><p></p></p><p><p>finally, the zip file is successfully generated, and the address is f:\practise\progressbutton\progressbutton\build/release-0.2.zip, move the zip file to the desktop, the later to Use.</p></p>3 Register Bintray account and set up warehouse<p><p>Enter bintray, Click Register an account<br>Then click New Repository in the home page to create a new warehouse</p></p><p><p></p></p><p><p>Warehouse name casually write,<strong>type remember to choose Maven</strong>, the following GPG and so on, do not tick</p></p><p><p></p></p><p><p>Then on the home page of the warehouse, click on the Add New package</p></p><p><p></p></p><p><p>To generate a new package, the package name can optionally fill in the name of the library, license select Apache-2.0</p></p><p><p></p></p><p><p>Click Create Package to generate the package</p></p>4 build vertion and upload zip package<p><p>Go to the Package page and click New version to create a new version</p></p><p><p></p></p><p><p>Fill in the information, then on the package page, click on New version, my new version here is named initialcommit, enter the version page</p></p><p><p></p></p><p><p>Then click Upload Files to upload the zip package that was generated before</p></p><p><p></p></p><p><p>Click to add files, adding file, after adding the file successfully, <strong>to select exploding the archive option</strong></p></p><p><p></p></p><p><p></p></p><p><p>Then click Save changes, then the page will prompt you to have several files without publish, you can click Publish both</p></p>4 Release to Jcenter<p><p>Go back to the package page, and then there is an add to Jcenter button in the bottom right corner, click Apply to upload to Jcenter</p></p><p><p></p></p><p><p>Upload to Jcenter need to audit about two hours, the audit will notify you after the mail, so you are done, then you can put your compile address to others, do not know compile address, please see the 1th</p></p><p><p>This method is I try several methods of the simplest one, the basic self do not have to do a special operation, follow the steps step by step to be able to, I hope you have some help, if any questions, welcome message, thank you!</p></p> <p style="font-size:12px;"><p style="font-size:12px;">Copyright Notice: This article for Bo Master original article, without Bo Master permission not Reproduced.</p></p> <p><p>Android Development: How to publish the library in Android studio to Jcenter</p></p></span>
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