Skip to content

Commit

Permalink
分离Picasso、Fresco、Glide
Browse files Browse the repository at this point in the history
  • Loading branch information
VeiZhang committed Oct 9, 2018
1 parent 863df33 commit f6d76ee
Show file tree
Hide file tree
Showing 23 changed files with 388 additions and 13 deletions.
1 change: 1 addition & 0 deletions Fresco/.gitignore
@@ -0,0 +1 @@
/build
99 changes: 99 additions & 0 deletions Fresco/build.gradle
@@ -0,0 +1,99 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 26

defaultConfig {
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"

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

}

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

}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation 'com.android.support:appcompat-v7:26.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'
implementation 'com.facebook.fresco:fresco:1.9.0'
compileOnly project(':ImageLoaderLibrary')
}

/*********************上传jCenter依赖*********************/
apply plugin: 'com.novoda.bintray-release'

buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.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
}
}

/**避免中文注释:编码GBK的不可映射字符**/
tasks.withType(Javadoc) {
options {
encoding "UTF-8"
charSet 'UTF-8'
links "http://docs.oracle.com/javase/7/docs/api"
}
}

/**避免Javadocs错误:找不到引用**/
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
options.addStringOption('encoding', 'UTF-8')
}

/**发布到我的Bintray仓库**/
def user = getPropertyValue('bintrayUser')
def key = getPropertyValue('bintrayKey')
def org = getPropertyValue('userOrg')

publish {
bintrayUser = user
bintrayKey = key
dryRun = false
userOrg = org
groupId = 'com.excellence'
artifactId = 'imageloader-fresco'
publishVersion = '1.0.0'
desc = 'Fresco图片加载器'
website = 'https://github.com/VeiZhang/ImageLoader'
licences = ['Apache-2.0']
}

/**读取bintray.key文件的key**/
def getPropertyValue(String key) {
if (key == null || key.length() == 0)
return null

File file = project.rootProject.file('../../bintray.key')
if (!file.exists())
return null

InputStream inputStream = file.newDataInputStream()
Properties properties = new Properties()
properties.load(inputStream)

//读取Key
return properties.getProperty(key)
}
21 changes: 21 additions & 0 deletions Fresco/proguard-rules.pro
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
2 changes: 2 additions & 0 deletions Fresco/src/main/AndroidManifest.xml
@@ -0,0 +1,2 @@
<manifest package="com.excellence.imageloader.fresco"
xmlns:android="http://schemas.android.com/apk/res/android"/>
@@ -1,4 +1,4 @@
package com.excellence.imageloader.strategy;
package com.excellence.imageloader.fresco;

import android.content.Context;
import android.support.annotation.NonNull;
Expand Down
2 changes: 2 additions & 0 deletions Fresco/src/main/res/values/strings.xml
@@ -0,0 +1,2 @@
<resources>
</resources>
1 change: 1 addition & 0 deletions Glide/.gitignore
@@ -0,0 +1 @@
/build
100 changes: 100 additions & 0 deletions Glide/build.gradle
@@ -0,0 +1,100 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 26

defaultConfig {
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"

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

}

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

}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation 'com.android.support:appcompat-v7:26.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'
implementation 'com.github.bumptech.glide:glide:4.8.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
compileOnly project(':ImageLoaderLibrary')
}

/*********************上传jCenter依赖*********************/
apply plugin: 'com.novoda.bintray-release'

buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.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
}
}

/**避免中文注释:编码GBK的不可映射字符**/
tasks.withType(Javadoc) {
options {
encoding "UTF-8"
charSet 'UTF-8'
links "http://docs.oracle.com/javase/7/docs/api"
}
}

/**避免Javadocs错误:找不到引用**/
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
options.addStringOption('encoding', 'UTF-8')
}

/**发布到我的Bintray仓库**/
def user = getPropertyValue('bintrayUser')
def key = getPropertyValue('bintrayKey')
def org = getPropertyValue('userOrg')

publish {
bintrayUser = user
bintrayKey = key
dryRun = false
userOrg = org
groupId = 'com.excellence'
artifactId = 'imageloader-glide'
publishVersion = '1.0.0'
desc = 'Glide图片加载器'
website = 'https://github.com/VeiZhang/ImageLoader'
licences = ['Apache-2.0']
}

/**读取bintray.key文件的key**/
def getPropertyValue(String key) {
if (key == null || key.length() == 0)
return null

File file = project.rootProject.file('../../bintray.key')
if (!file.exists())
return null

InputStream inputStream = file.newDataInputStream()
Properties properties = new Properties()
properties.load(inputStream)

//读取Key
return properties.getProperty(key)
}
21 changes: 21 additions & 0 deletions Glide/proguard-rules.pro
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
2 changes: 2 additions & 0 deletions Glide/src/main/AndroidManifest.xml
@@ -0,0 +1,2 @@
<manifest package="com.excellence.imageloader.glide"
xmlns:android="http://schemas.android.com/apk/res/android"/>
@@ -1,4 +1,4 @@
package com.excellence.imageloader.strategy;
package com.excellence.imageloader.glide;

import android.content.Context;
import android.graphics.drawable.Drawable;
Expand All @@ -17,9 +17,9 @@
import com.excellence.imageloader.ImageLoader;
import com.excellence.imageloader.ImageLoaderOptions;
import com.excellence.imageloader.listener.IListener;
import com.excellence.imageloader.utils.GlideApp;
import com.excellence.imageloader.utils.GlideRequest;
import com.excellence.imageloader.utils.GlideRequests;
import com.excellence.imageloader.glide.utils.GlideApp;
import com.excellence.imageloader.glide.utils.GlideRequest;
import com.excellence.imageloader.glide.utils.GlideRequests;

import java.io.File;

Expand Down
@@ -1,4 +1,4 @@
package com.excellence.imageloader.utils;
package com.excellence.imageloader.glide.utils;

import android.view.View;

Expand Down
2 changes: 2 additions & 0 deletions Glide/src/main/res/values/strings.xml
@@ -0,0 +1,2 @@
<resources>
</resources>
4 changes: 0 additions & 4 deletions ImageLoaderLibrary/build.gradle
Expand Up @@ -29,10 +29,6 @@ dependencies {
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'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.facebook.fresco:fresco:1.9.0'
implementation 'com.github.bumptech.glide:glide:4.8.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1'
}

/*********************上传jCenter依赖*********************/
Expand Down
1 change: 1 addition & 0 deletions Picasso/.gitignore
@@ -0,0 +1 @@
/build

0 comments on commit f6d76ee

Please sign in to comment.