Android上传开源库到Bintray

主要是跟着一位博主的这篇博客进行操作的:Android 上传自己的开源库到Bintray(超简单哦)

这里只记录一下中间遇到的问题:

在工程主目录下的build.gredle中添加备注编译不通过:

classpath 'com.novoda:bintray-release:0.4.0'

 

在网上找寻答案是,Android Studio3.14以及以上的版本需要将引入

classpath 'com.novoda:bintray-release:0.8.0'

这里在贴一下两个build.gradle的完整的代码:

主工程:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.3'
        classpath 'com.novoda:bintray-release:0.8.0'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

Library: 

apply plugin: 'com.android.library'
apply plugin: 'com.novoda.bintray-release'

android {
    compileSdkVersion 28

    defaultConfig {
        minSdkVersion 11
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    lintOptions {
        abortOnError false
    }

}

allprojects {
    repositories {
        jcenter()
    }
    tasks.withType(Javadoc) {
        options {
            encoding "UTF-8"
            charSet 'UTF-8'
            links "http://docs.oracle.com/javase/7/docs/api"
        }
    }
}

publish {
    repoName = 'xiangdada'           //bintray仓库名
    userOrg = 'xiangdada'           //bintray注册的用户名
    groupId = 'com.xiangdada'            //compile引用时的第1部分groupId
    artifactId = 'network'       //compile引用时的第2部分项目名
    publishVersion = '1.0.0'       //compile引用时的第3部分版本号
    desc = 'description'
    website = '可写成github上面的代码地址路径'
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:28.0.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    api 'com.squareup.retrofit2:retrofit:2.5.0'
    api 'io.reactivex.rxjava2:rxjava:2.2.4'
    api 'io.reactivex.rxjava2:rxandroid:2.1.0'
    api 'com.squareup.retrofit2:converter-gson:2.5.0'
    api 'com.squareup.retrofit2:adapter-rxjava2:2.5.0'
    api 'com.google.code.gson:gson:2.8.5'
    api 'com.orhanobut:logger:2.2.0'
    api 'com.squareup.okhttp3:logging-interceptor:3.14.0'
}


 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值