Android库依赖项

时间:2017-04-11 08:06:53

标签: java android dependencies android-volley android-library

我正在做一个android库项目。 图书馆项目已经编制了一些第三方图书馆,如Volley。 当用户使用库时,用户也需要编译齐射。如果用户没有编译,用户的应用程序将找不到凌空代码。 但我不想用户编译齐射库,只需编译我的库。有解决方案吗?

我的图书馆gradle

apply plugin: 'com.android.library'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        minSdkVersion 14
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"

        consumerProguardFiles 'proguard-rules.pro'

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

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

dependencies {
    compile 'com.squareup:seismic:1.0.1'
    compile 'com.android.volley:volley:1.0.0'
    compile "com.android.support:appcompat-v7:23.0.1"
    compile "com.android.support:recyclerview-v7:23.0.1"
    compile "com.android.support:support-v4:23.0.1"
    compile "com.android.support:support-annotations:23.0.1"
    compile "com.android.support:design:23.0.1"
}

有一个示例应用程序gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"

    defaultConfig {

        minSdkVersion 15
        targetSdkVersion 25
        versionCode 108
        versionName "3.1"

    }

    signingConfigs {
        debug {
            storeFile file("debug.jks")
            storePassword 'develop'
            keyAlias "develop"
            keyPassword "develop"
        }
    }

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

        debug {
            applicationIdSuffix ".debug"
            minifyEnabled false
            shrinkResources false
            signingConfig signingConfigs.debug
        }
    }
    lintOptions {
        disable 'MissingTranslation'
        abortOnError false
    }
    allprojects {
        repositories {
            jcenter()
            maven { url "https://jitpack.io" }
        }
    }
}

dependencies {
    compile 'com.android.support:design:25.2.0'
    compile 'com.android.support:recyclerview-v7:25.2.0'
    compile 'org.jsoup:jsoup:1.10.2'
    compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.6.0'
    compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
    compile 'com.soundcloud.android:android-crop:1.0.1@aar'
    compile 'com.getkeepsafe.taptargetview:taptargetview:1.8.0'
    compile 'com.squareup:seismic:1.0.1'<<<<<<<<<<<<<<<<<<<< I need to hide this
    compile 'com.android.volley:volley:1.0.0'<<<<<<<<<<<<<<< I need to hide this
    compile project(':mylibrary')

}

0 个答案:

没有答案