From 484e1590dcbd8adb51b12acaa938a621b2e93013 Mon Sep 17 00:00:00 2001 From: habbyge Date: Mon, 11 Jan 2021 11:22:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../task/RemoveUnusedResourcesTask.groovy | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/matrix/matrix-android/matrix-gradle-plugin/src/main/groovy/com/tencent/matrix/plugin/task/RemoveUnusedResourcesTask.groovy b/matrix/matrix-android/matrix-gradle-plugin/src/main/groovy/com/tencent/matrix/plugin/task/RemoveUnusedResourcesTask.groovy index 2ad4f95f9..10e16feb2 100644 --- a/matrix/matrix-android/matrix-gradle-plugin/src/main/groovy/com/tencent/matrix/plugin/task/RemoveUnusedResourcesTask.groovy +++ b/matrix/matrix-android/matrix-gradle-plugin/src/main/groovy/com/tencent/matrix/plugin/task/RemoveUnusedResourcesTask.groovy @@ -295,30 +295,30 @@ public class RemoveUnusedResourcesTask extends DefaultTask { } private void readResourceTxtFile(File resTxtFile, Map resourceMap, Map[]> styleableMap) throws IOException { - BufferedReader bufferedReader = new BufferedReader(new FileReader(resTxtFile)); - String line = bufferedReader.readLine(); - boolean styleable = false; - String styleableName = ""; + BufferedReader bufferedReader = new BufferedReader(new FileReader(resTxtFile)) + String line = bufferedReader.readLine() + boolean styleable = false + String styleableName = "" ArrayList styleableAttrs = new ArrayList<>(); try { while (line != null) { - String[] columns = line.split(" "); + String[] columns = line.split(" ") if (columns.length >= 4) { - final String resourceName = "R." + columns[1] + "." + columns[2]; + final String resourceName = "R." + columns[1] + "." + columns[2] if (!columns[0].endsWith("[]") && columns[3].startsWith("0x")) { if (styleable) { - styleable = false; - styleableName = ""; + styleable = false + styleableName = "" } - final String resId = parseResourceId(columns[3]); + final String resId = parseResourceId(columns[3]) if (!Util.isNullOrNil(resId)) { - resourceMap.put(resourceName, Integer.decode(resId)); + resourceMap.put(resourceName, Integer.decode(resId)) } } else if (columns[1].equals("styleable")) { if (columns[0].endsWith("[]")) { if (columns.length > 5) { - styleableAttrs.clear(); - styleable = true; + styleableAttrs.clear() + styleable = true styleableName = "R." + columns[1] + "." + columns[2]; for (int i = 4; i < columns.length - 1; i++) { if (columns[i].endsWith(",")) {