From 572656a19f5534d707917176ba6d16ae209f46ae Mon Sep 17 00:00:00 2001 From: zhongchao Date: Sat, 7 Oct 2023 10:20:39 +0800 Subject: [PATCH] [6.1.0] bash note --- codequality/code_inspect_increment.gradle | 77 ++++++++++++----------- 1 file changed, 39 insertions(+), 38 deletions(-) diff --git a/codequality/code_inspect_increment.gradle b/codequality/code_inspect_increment.gradle index 60baf24322..5893cd5223 100644 --- a/codequality/code_inspect_increment.gradle +++ b/codequality/code_inspect_increment.gradle @@ -27,12 +27,13 @@ def getResultFromCmd(String cmd) { standardOutput = out }.assertNormalExitValue() } else { - project.exec { - ExecSpec execSpec -> - executable 'bash' - args '-c', "$cmd" - standardOutput = out - }.assertNormalExitValue() + // jenkins 打包出异常,需要区分linux和macOS +// project.exec { +// ExecSpec execSpec -> +// executable 'bash' +// args '-c', "$cmd" +// standardOutput = out +// }.assertNormalExitValue() } return out.toString().trim() } @@ -149,38 +150,38 @@ def saveCommitFiles(Object[] commitFiles) { task runCodeInspectIncrement { - group = "codeInspect" - description = "存储增量文件" - def commitJavaFiles = new ArrayList() - def commitKotlinFiles = new ArrayList() - - def commitFiles = new Object[0] - if (isIncrement) { - commitFiles = getCommitFiles() - } else { - commitFiles = getAllFiles() - } - saveCommitFiles(commitFiles) - if (commitFiles != null && commitFiles.length > 0) { - def projectStartPath = getProjectStartPath() - for (String s : commitFiles) { - def commitFile = s.toString().trim() - if (commitFile.endsWith('.kt')) { - commitKotlinFiles.add(commitFile.substring(projectStartPath.length() + 1)) - } else if (commitFile.endsWith('.java')) { - commitJavaFiles.add(commitFile.substring(projectStartPath.length() + 1)) - } - } - } - if (!commitKotlinFiles.isEmpty()) { - logger.lifecycle("${project.name} commitKotlinFiles:$commitKotlinFiles") - } - if (!commitJavaFiles.isEmpty()) { - logger.lifecycle("${project.name} commitJavaFiles:$commitJavaFiles") - } - project.setProperty("commitKotlinFiles", commitKotlinFiles) - project.setProperty("commitJavaFiles", commitJavaFiles) - project.setProperty("commitAuthor", getCommitAuthor()) +// group = "codeInspect" +// description = "存储增量文件" +// def commitJavaFiles = new ArrayList() +// def commitKotlinFiles = new ArrayList() +// +// def commitFiles = new Object[0] +// if (isIncrement) { +// commitFiles = getCommitFiles() +// } else { +// commitFiles = getAllFiles() +// } +// saveCommitFiles(commitFiles) +// if (commitFiles != null && commitFiles.length > 0) { +// def projectStartPath = getProjectStartPath() +// for (String s : commitFiles) { +// def commitFile = s.toString().trim() +// if (commitFile.endsWith('.kt')) { +// commitKotlinFiles.add(commitFile.substring(projectStartPath.length() + 1)) +// } else if (commitFile.endsWith('.java')) { +// commitJavaFiles.add(commitFile.substring(projectStartPath.length() + 1)) +// } +// } +// } +// if (!commitKotlinFiles.isEmpty()) { +// logger.lifecycle("${project.name} commitKotlinFiles:$commitKotlinFiles") +// } +// if (!commitJavaFiles.isEmpty()) { +// logger.lifecycle("${project.name} commitJavaFiles:$commitJavaFiles") +// } +// project.setProperty("commitKotlinFiles", commitKotlinFiles) +// project.setProperty("commitJavaFiles", commitJavaFiles) +// project.setProperty("commitAuthor", getCommitAuthor()) }