From cd66803f412fa3ad989236833600314906412f35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CsmallSohoSolo=E2=80=9D?= Date: Thu, 12 Oct 2017 12:52:20 +0800 Subject: [PATCH] =?UTF-8?q?Bug=20fix=20=E4=BF=AE=E5=A4=8D=E4=BA=86module?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E4=BD=BF=E7=94=A8=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README-CN.md | 3 ++- README.md | 3 ++- bintray.gradle | 2 +- publish.gradle | 2 +- .../com/smallsoho/mcplugin/image/ImagePlugin.groovy | 1 + .../smallsoho/mcplugin/image/utils/AndroidUtil.groovy | 10 +--------- 6 files changed, 8 insertions(+), 13 deletions(-) diff --git a/README-CN.md b/README-CN.md index 52f9b40..46e7a95 100644 --- a/README-CN.md +++ b/README-CN.md @@ -27,6 +27,7 @@ McImage是无侵入式的全量压缩资源图片插件 > v0.0.2以后的用户更新到0.0.2以上需要升级你的mctools文件夹,已经上传到release。 +- 0.1.1 : Bug fix,修复了在module中apply无法编译通过的问题,修复了enableWhenDebug开关无法使用的问题 - 0.0.4 : 添加了自动识别操作系统的支持,去掉了webpQuality选项(设置不好对图片压缩会肉眼可见,强制使用默认值),优化了Log写法 - 0.0.3 : 添加了对webp的支持。会在压缩之后自动将你符合规则的图片转换为webp格式,并且会比对大小,如果转换之后更大则舍弃转换,并且插件对API 14 和API 18的webp问题进行了处理,具体问题请google查询。 - 0.0.2 : 完善了日志的输出 @@ -41,7 +42,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.smallsoho.mobcase:McImage:0.1.0' + classpath 'com.smallsoho.mobcase:McImage:0.1.1' } } ``` diff --git a/README.md b/README.md index e56dec2..0a854a8 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ Used algorithm > The user use v0.0.2 update plugin need update your mctools dir together. +- 0.1.1 : Bug fix(Fix the problem not work for module and fix the problem of enableWhenDebug not work) - 0.0.4 : Add auto choose system future.Remove webpQualitu config (Set inappropriate will result the img lossless) - 0.0.3 : Add webp ! It will auto convert your png (without alpha in min API < 18 and not work in min API < 14) and jpg to webp if it will become more small. - 0.0.2 : Improve the log. @@ -43,7 +44,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.smallsoho.mobcase:McImage:0.1.0' + classpath 'com.smallsoho.mobcase:McImage:0.1.1' } } ``` diff --git a/bintray.gradle b/bintray.gradle index 1fd78b7..2790eb1 100644 --- a/bintray.gradle +++ b/bintray.gradle @@ -4,7 +4,7 @@ apply plugin: 'com.jfrog.bintray' def siteUrl = 'https://github.com/Aweme/McImage' def gitUrl = 'https://github.com/Aweme/McImage.git' group = "com.smallsoho.mobcase" -version = "0.1.0" +version = "0.1.1" Properties properties = new Properties() properties.load(project.rootProject.file('local.properties').newDataInputStream()) diff --git a/publish.gradle b/publish.gradle index 5bf49a6..c759c1a 100644 --- a/publish.gradle +++ b/publish.gradle @@ -2,7 +2,7 @@ apply plugin: 'maven' apply plugin: 'signing' def DEBUG = false -def VERSION = '0.0.4-SNAPSHOT' +def VERSION = '0.1.1-SNAPSHOT' def GROUP = 'com.smallsoho.mobcase' def ARTIFACT = 'McImage' diff --git a/src/main/groovy/com/smallsoho/mcplugin/image/ImagePlugin.groovy b/src/main/groovy/com/smallsoho/mcplugin/image/ImagePlugin.groovy index c47a166..c05cd08 100644 --- a/src/main/groovy/com/smallsoho/mcplugin/image/ImagePlugin.groovy +++ b/src/main/groovy/com/smallsoho/mcplugin/image/ImagePlugin.groovy @@ -5,6 +5,7 @@ import com.smallsoho.mcplugin.image.compress.CompressUtil import com.smallsoho.mcplugin.image.models.Config import com.smallsoho.mcplugin.image.utils.FileUtil import com.smallsoho.mcplugin.image.utils.ImageUtil + import com.smallsoho.mcplugin.image.webp.WebpUtils import org.gradle.api.GradleException import org.gradle.api.Plugin diff --git a/src/main/groovy/com/smallsoho/mcplugin/image/utils/AndroidUtil.groovy b/src/main/groovy/com/smallsoho/mcplugin/image/utils/AndroidUtil.groovy index 9ffd3ef..1887388 100644 --- a/src/main/groovy/com/smallsoho/mcplugin/image/utils/AndroidUtil.groovy +++ b/src/main/groovy/com/smallsoho/mcplugin/image/utils/AndroidUtil.groovy @@ -1,19 +1,11 @@ package com.smallsoho.mcplugin.image.utils -import com.android.build.gradle.AppPlugin -import com.android.build.gradle.BaseExtension import org.gradle.api.Project class AndroidUtil { - static BaseExtension getAndroidExtension(Project project) { - AppPlugin plugin = project.plugins.getPlugin(AppPlugin) - return plugin.extension - } - - static int getMinSdkVersion(Project project) { - return getAndroidExtension(project).defaultConfig.minSdkVersion.apiLevel + return project.android.defaultConfig.minSdkVersion.apiLevel } }