Skip to content

Commit

Permalink
add gradle dependecies manager
Browse files Browse the repository at this point in the history
  • Loading branch information
JsonChao committed May 17, 2018
1 parent d5f8189 commit cfb7fdd
Show file tree
Hide file tree
Showing 11 changed files with 159 additions and 192 deletions.
32 changes: 0 additions & 32 deletions .idea/assetWizardSettings.xml

This file was deleted.

Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
22 changes: 0 additions & 22 deletions .idea/compiler.xml

This file was deleted.

3 changes: 0 additions & 3 deletions .idea/copyright/profiles_settings.xml

This file was deleted.

9 changes: 0 additions & 9 deletions .idea/dictionaries/quchao.xml

This file was deleted.

1 change: 0 additions & 1 deletion .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions .idea/inspectionProfiles/profiles_settings.xml

This file was deleted.

26 changes: 4 additions & 22 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

113 changes: 59 additions & 54 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ apply plugin: 'org.greenrobot.greendao'


android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
buildToolsVersion rootProject.ext.android["buildToolsVersion"]
// signingConfigs {
// release {
// storeFile file(RELEASE_STORE_FILE)
Expand All @@ -18,12 +18,12 @@ android {
// }
defaultConfig {
applicationId "json.chao.com.wanandroid"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 4
versionName "1.2.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
renderscriptTargetApi 21
minSdkVersion rootProject.ext.android["minSdkVersion"]
targetSdkVersion rootProject.ext.android["targetSdkVersion"]
versionCode rootProject.ext.android["versionCode"]
versionName rootProject.ext.android["versionName"]
testInstrumentationRunner rootProject.ext.android["androidJUnitRunner"]
renderscriptTargetApi rootProject.ext.android["renderscriptTargetApi"]
renderscriptSupportModeEnabled true // Enable RS support
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
Expand Down Expand Up @@ -72,70 +72,75 @@ dependencies {
})

//base
implementation "com.android.support:appcompat-v7:$rootProject.supportLibraryVersion"
implementation "com.android.support:cardview-v7:$rootProject.supportLibraryVersion"
implementation "com.android.support:support-v4:$rootProject.supportLibraryVersion"
implementation "com.android.support:design:$rootProject.supportLibraryVersion"
implementation "com.android.support.constraint:constraint-layout:$rootProject.constraintVersion"
implementation rootProject.ext.dependencies["appcompat-v7"]
implementation rootProject.ext.dependencies["cardview-v7"]
implementation rootProject.ext.dependencies["support-v4"]
implementation rootProject.ext.dependencies["design"]
implementation rootProject.ext.dependencies["constraint-layout"]

//ui
implementation "com.scwang.smartrefresh:SmartRefreshLayout:$rootProject.smartrefreshVersion"
implementation "com.scwang.smartrefresh:SmartRefreshHeader:$rootProject.smartrefreshVersion"
implementation "com.youth.banner:banner:$rootProject.bannerVersion"
implementation "com.flyco.tablayout:FlycoTabLayout_Lib:$rootProject.tablayoutVersion"
implementation "q.rorbin:VerticalTabLayout:$rootProject.verticalTabLayoutVersion"
implementation "com.hyman:flowlayout-lib:$rootProject.flowlayoutVersion"
implementation 'com.just.agentweb:agentweb:4.0.2'
implementation rootProject.ext.dependencies["SmartRefreshLayout"]
implementation rootProject.ext.dependencies["SmartRefreshHeader"]
implementation rootProject.ext.dependencies["banner"]
implementation rootProject.ext.dependencies["FlycoTabLayout_Lib"]
implementation rootProject.ext.dependencies["VerticalTabLayout"]
implementation rootProject.ext.dependencies["flowlayout-lib"]
implementation rootProject.ext.dependencies["agentweb"]

//net
implementation "com.google.code.gson:gson:$rootProject.gsonVersion"
implementation "com.squareup.okhttp3:okhttp:$rootProject.okhttpVersion"
implementation "com.squareup.okhttp3:logging-interceptor:$rootProject.okhttpVersion"
implementation "com.squareup.retrofit2:retrofit:$rootProject.retrofitVersion"
implementation "com.squareup.retrofit2:converter-gson:$rootProject.retrofitVersion"
implementation "com.squareup.retrofit2:adapter-rxjava2:$rootProject.retrofitVersion"
implementation "com.github.bumptech.glide:glide:$rootProject.glideVersion"
annotationProcessor "com.github.bumptech.glide:compiler:$rootProject.glideVersion"
implementation rootProject.ext.dependencies["gson"]
implementation rootProject.ext.dependencies["okhttp"]
implementation rootProject.ext.dependencies["logging-interceptor"]
implementation rootProject.ext.dependencies["retrofit"]
implementation rootProject.ext.dependencies["converter-gson"]
implementation rootProject.ext.dependencies["adapter-rxjava2"]
implementation rootProject.ext.dependencies["glide"]
annotationProcessor rootProject.ext.dependencies["glide_compiler"]

//dao
implementation "org.greenrobot:greendao:$rootProject.greendaoVersion"
implementation rootProject.ext.dependencies["greendao"]

//rx
implementation "io.reactivex.rxjava2:rxjava:$rootProject.rxjavaVersion"
implementation "io.reactivex.rxjava2:rxandroid:$rootProject.rxandroidVersion"
implementation "com.jakewharton.rxbinding2:rxbinding:$rootProject.rxbindingVersion"
implementation "com.tbruyelle.rxpermissions2:rxpermissions:$rootProject.rxpermissionsVersion"
implementation rootProject.ext.dependencies["rxjava"]
implementation rootProject.ext.dependencies["rxandroid"]
implementation rootProject.ext.dependencies["rxbinding"]
implementation rootProject.ext.dependencies["rxpermissions"]

//di
implementation "com.google.dagger:dagger:$rootProject.daggerVersion"
annotationProcessor "com.google.dagger:dagger-compiler:$rootProject.daggerVersion"
implementation 'com.google.dagger:dagger-android:2.15'
implementation 'com.google.dagger:dagger-android-support:2.15'
annotationProcessor 'com.google.dagger:dagger-android-processor:2.15'
implementation "org.glassfish:javax.annotation:$rootProject.javaxVersion"
implementation "com.jakewharton:butterknife:$rootProject.butterknifeVersion"
annotationProcessor "com.jakewharton:butterknife-compiler:$rootProject.butterknifeVersion"
implementation rootProject.ext.dependencies["dagger"]
annotationProcessor rootProject.ext.dependencies["dagger-compiler"]
implementation rootProject.ext.dependencies["dagger-android"]
implementation rootProject.ext.dependencies["dagger-android-support"]
annotationProcessor rootProject.ext.dependencies["dagger-android-processor"]
implementation rootProject.ext.dependencies["javax_annotation"]
implementation rootProject.ext.dependencies["butterknife"]
annotationProcessor rootProject.ext.dependencies["butterknife-compiler"]

//multidex
implementation "com.android.support:multidex:$rootProject.multidexVersion"
implementation rootProject.ext.dependencies["multidex"]

//other
implementation "com.airbnb.android:lottie:$rootProject.lottieVersion"
implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.34'
implementation "me.yokeyword:fragmentation:$rootProject.fragmentationVersion"
implementation "me.yokeyword:fragmentation-swipeback:$rootProject.fragmentationVersion"
implementation 'com.tencent.bugly:crashreport_upgrade:latest.release'
implementation "com.orhanobut:logger:$rootProject.loggerVersion"
implementation "com.github.githubwing:ByeBurger:$rootProject.ByeBurgerVersion"
implementation rootProject.ext.dependencies["lottie"]
implementation rootProject.ext.dependencies["BaseRecyclerViewAdapterHelper"]
implementation rootProject.ext.dependencies["fragmentation"]
implementation rootProject.ext.dependencies["fragmentation-swipeback"]
implementation rootProject.ext.dependencies["crashreport_upgrade"]
implementation rootProject.ext.dependencies["logger"]
implementation rootProject.ext.dependencies["ByeBurger"]

//canary
debugImplementation "com.squareup.leakcanary:leakcanary-android:$rootProject.leakcanaryVersion"
releaseImplementation "com.squareup.leakcanary:leakcanary-android-no-op:$rootProject.leakcanaryVersion"
testImplementation "com.squareup.leakcanary:leakcanary-android-no-op:$rootProject.leakcanaryVersion"
debugImplementation rootProject.ext.dependencies["leakcanary-android"]
releaseImplementation rootProject.ext.dependencies["leakcanary-android-no-op"]
testImplementation rootProject.ext.dependencies["leakcanary-android-no-op"]



//unit test
testImplementation "junit:junit:$rootProject.junitVersion"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
testImplementation rootProject.ext.dependencies["junit"]
androidTestImplementation rootProject.ext.dependencies["runner"]

implementation rootProject.ext.dependencies["kotlin-stdlib"]

}

//解决支持库版本不兼容问题
Expand Down
43 changes: 1 addition & 42 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

apply from: "config.gradle"
buildscript {
ext.kotlin_version = '1.2.10'
repositories {
Expand Down Expand Up @@ -34,44 +34,3 @@ allprojects {
task clean(type: Delete) {
delete rootProject.buildDir
}

// Define versions in a single place
ext {
// Sdk and tools
compileSdkVersion = 27
buildToolsVersion = '27.0.3'
minSdkVersion = 21
targetSdkVersion = 25

// App dependencies
supportLibraryVersion = '27.1.1'
loggerVersion = '2.1.1'
leakcanaryVersion = '1.5.4'
gsonVersion = '2.8.2'
okhttpVersion = '3.9.0'
retrofitVersion = '2.3.0'
glideVersion = '4.0.0'
greendaoVersion = '3.2.2'
fragmentationVersion = '1.1.9'
rxjavaVersion = '2.1.5'
rxandroidVersion = '2.0.1'
rxbindingVersion = '2.1.0'
rxpermissionsVersion = '0.9.5@aar'
daggerVersion = '2.15'
javaxVersion = '10.0-b28'
butterknifeVersion = '8.8.1'
multidexVersion = '1.0.3'
lottieVersion = '2.3.0'
constraintVersion = '1.0.2'
ByeBurgerVersion = '1.2.3'
aviVersion = '2.1.3'
smartrefreshVersion = '1.0.5.1'
bannerVersion = '1.4.10'
tablayoutVersion = '2.1.2@aar'
verticalTabLayoutVersion = '1.2.5'
flowlayoutVersion = '1.1.2'

//Test dependencies
junitVersion = '4.12'

}
Loading

0 comments on commit cfb7fdd

Please sign in to comment.