Android Studio上传项目作为lib到jcenter中

详细步骤请参考http://www.open-open.com/lib/view/open1435109824278.html

本文讲解示例为萌萌哒天团app

第一步

再添加之前必须在项目的根gradle中添加classpath,方能引入bintray的插件

classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2'
classpath 'com.github.dcendents:android-maven-plugin:1.2'

第二步

如下是lib的gradle文件

apply plugin: 'com.android.library'

android {
    compileSdkVersion 17
    buildToolsVersion "22.0.1"

    defaultConfig {
        minSdkVersion 8
        targetSdkVersion 17
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}
ext {
    bintrayRepo = 'maven'
    bintrayName = 'alipay_lib'

    publishedGroupId = 'com.yan'
    libraryName = 'alipay_lib'
    artifact = 'alipay_lib'

    libraryDescription = 'A wrapper for Facebook Native Like Button (LikeView) on Android'

    siteUrl = 'https://github.com/nuuneoi/FBLikeAndroid'
    gitUrl = 'https://github.com/nuuneoi/FBLikeAndroid.git'

    libraryVersion = '0.9.5'

    developerId = 'AndroidKing'
    developerName = 'yan'
    developerEmail = '******'

    licenseName = 'The Apache Software License, Version 2.0'
    licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
    allLicenses = ["Apache-2.0"]
}
apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle'
apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/bintrayv1.gradle'

第三步

在确保已经上传jcenter后,添加如下依赖

compile 'com.yan:alipay_lib:0.9.5'


注:详细步骤还请参考如上网址。

你可能感兴趣的:(Android Studio上传项目作为lib到jcenter中)