您的位置:首页 > 移动开发 > Android开发

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

2016-02-02 11:12 603 查看
详细步骤请参考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'


注:详细步骤还请参考如上网址。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: