From c3bd9203be403006b189ea896e6f511abbbb5d8a Mon Sep 17 00:00:00 2001 From: "yuan.cheng" Date: Tue, 10 Apr 2018 11:32:09 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E5=A4=8D=E5=A4=A7?= =?UTF-8?q?=E5=9B=BE=E6=8A=A5=E9=94=99=E8=B7=AF=E5=BE=84=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E5=AE=9A=E4=BD=8D=E7=9A=84=E9=97=AE=E9=A2=98=20feat=EF=BC=9A?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=99=BD=E5=90=8D=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bintray.gradle | 2 +- .../com/smallsoho/mcplugin/image/ImagePlugin.groovy | 9 ++++++--- .../com/smallsoho/mcplugin/image/models/Config.groovy | 1 + 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/bintray.gradle b/bintray.gradle index a82cd50..f150177 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.2" +version = "0.1.3" Properties properties = new Properties() properties.load(project.rootProject.file('local.properties').newDataInputStream()) diff --git a/src/main/groovy/com/smallsoho/mcplugin/image/ImagePlugin.groovy b/src/main/groovy/com/smallsoho/mcplugin/image/ImagePlugin.groovy index c05cd08..395fea1 100644 --- a/src/main/groovy/com/smallsoho/mcplugin/image/ImagePlugin.groovy +++ b/src/main/groovy/com/smallsoho/mcplugin/image/ImagePlugin.groovy @@ -89,9 +89,12 @@ class ImagePlugin implements Plugin { def file = new File("${drawDir}") if (file.name.contains('drawable') || file.name.contains('mipmap')) { file.eachFile { imgFile -> - - if (mConfig.isCheck && ImageUtil.isBigImage(imgFile, mConfig.maxSize)) { - bigImgList.add(file.getPath() + file.getName()) + if (mConfig.whiteList.contains("${file.getName()}/${imgFile.getName()}".toString())) { + return + } + if (mConfig.isCheck && + ImageUtil.isBigImage(imgFile, mConfig.maxSize)) { + bigImgList.add(imgFile.getAbsolutePath()) } if (mConfig.isCompress) { CompressUtil.compressImg(imgFile) diff --git a/src/main/groovy/com/smallsoho/mcplugin/image/models/Config.groovy b/src/main/groovy/com/smallsoho/mcplugin/image/models/Config.groovy index f14ee28..136e375 100644 --- a/src/main/groovy/com/smallsoho/mcplugin/image/models/Config.groovy +++ b/src/main/groovy/com/smallsoho/mcplugin/image/models/Config.groovy @@ -7,4 +7,5 @@ class Config { def isWebpConvert = true def isJPGConvert = true def enableWhenDebug = true + Iterable whiteList = [] }