[6.1.0] bash note
This commit is contained in:
@@ -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<String>()
|
||||
def commitKotlinFiles = new ArrayList<String>()
|
||||
|
||||
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<String>()
|
||||
// def commitKotlinFiles = new ArrayList<String>()
|
||||
//
|
||||
// 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())
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user