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 = [] }