Skip to content

HOWTO Jcenter

zhaozhenxuan edited this page Apr 18, 2019 · 2 revisions

Distributing Carrier aar package via jcenter

1. Introduction

For the convenience of android dApps, org.elastos.carrier<-debug>.aar package would be distributed to community developers via jfrog binary (jcenter) platform in public. Therefore, developers of dApps using Carrier could use manager to make **org.elastos.carrier<-debug>.aar as its dependency project.

The rest of this document elaborates the details of HOW-TO make distribution via jfrog binary (jcenter) platform.

2. Table of Contents

3. Get Started

Register Account

Try to sign up for an account at jfrog binary.

Recording API Key

After registration, there is an API key on https://bintray.com/profile/edit. Copy the API key for laster use.

Create Maven Repo

Try to create a repository on repositories item on https://bintray.com/profile/edit(https://bintray.com/profile/edit).

Notice: Choose the type with maven.

Configure Gradle

Open the Carrier project and add classpash under buildscript/dependencies in the root build.grade file:

classpath "guru.stefma.bintrayrelease:bintrayrelease:$bintrayReleaseVersion"

In the module build.gradle file, add the following configuration:

apply plugin: 'guru.stefma.bintrayrelease'

version = "5.2.4" 
group = "org.elastos"
androidArtifact {
    artifactId = "carrier"
}
publish {
    userOrg = 'elastos'
    desc = 'Elastos Carrier SDK'
    website = 'https://github.com/elastos/Elastos.NET.Carrier.Android.SDK'
}

Distribution

Finally, use the taskbintrayUpload to publish (make sure you build the project first) with following command in Android Studio Terminal:

$ ./gradlew clean build bintrayUpload -PbintrayUser=BINTRAY_USERNAME -PbintrayKey=BINTRAY_KEY -PdryRun=false

Where, the value BINTRAY_USERNAME is your username and BINTRAY_KEY is the previously your API key.

Submit to jCenter

When bintrayUpload succeeds, you will see the project you submitted in the bintray home page maven directory.

Click on the project name to go to the details page and find it in the lower right corner. Anter with clicking and complete project descriptions.

After submitting, the post will be sent after the successful review, and the review will be quick, provided they are working.

Waiting Approval

The rest is to wait for approval. After the audit is passed, our SDK is released to the jcenter repository.

4. Usage Example

In your project with gradle management, add following statements in module's build.gradle to import Carrier SDK:

dependencies {
    implementation 'org.elastos:carrier:5.2.4'
}

While in project with maven management, add the following statements as it's dependency:

<dependency>
  <groupId>org.elastos</groupId>
  <artifactId>carrier</artifactId>
  <version>5.2.4</version>
  <type>pom</type>
</dependency>

Clone this wiki locally