@@ -65,43 +65,46 @@ task checkstyleCI(type: Checkstyle) {
65
65
*/
66
66
def getChangedFiles () {
67
67
// Get the target and source branch
68
- def envTargetBranch = System . getenv(" TARGET_BRANCH" )
69
- def envSourceBranch = System . getenv(" WORKING_BRANCH" )
68
+ // def envTargetBranch = System.getenv("TARGET_BRANCH")
69
+ // def envSourceBranch = System.getenv("WORKING_BRANCH")
70
+ def modifiedFiles = System . getenv(" MODIFIED_FILES" )
70
71
71
- println " Target Branch: ${ envTargetBranch} "
72
- println " Source Branch: ${ envSourceBranch} "
72
+ println " Modified Files: ${ modifiedFiles} "
73
73
74
- // Compare to master if no branch specified
75
- def targetBranch
76
- if (project. hasProperty(" branch" )) {
77
- targetBranch = project. property(" branch" )
78
- } else {
79
- targetBranch = envTargetBranch ? " origin/${ envTargetBranch} " : getParentBranch()
80
- }
81
- def sourceBranch = envSourceBranch ? " origin/${ envSourceBranch} " : " "
74
+ // println "Target Branch: ${envTargetBranch}"
75
+ // println "Source Branch: ${envSourceBranch}"
82
76
83
- println " Merging ${ sourceBranch} into ${ targetBranch} "
77
+ // Compare to master if no branch specified
78
+ // def targetBranch
79
+ // if (project.hasProperty("branch")) {
80
+ // targetBranch = project.property("branch")
81
+ // } else {
82
+ // targetBranch = envTargetBranch ? "origin/${envTargetBranch}" : getParentBranch()
83
+ // }
84
+ // def sourceBranch = envSourceBranch ? "origin/${envSourceBranch}" : ""
85
+ //
86
+ // println "Merging ${sourceBranch} into ${targetBranch}"
84
87
85
88
// Get list of all changed files including status
86
- def systemOutStream = new ByteArrayOutputStream ()
87
- def command = " git diff --name-status --diff-filter=dr $targetBranch $sourceBranch "
88
- command. execute(). waitForProcessOutput(systemOutStream, System . err)
89
- def allFiles = systemOutStream. toString(). trim(). split(' \n ' )
90
- systemOutStream. close()
91
-
92
- // Remove the status prefix
93
- Pattern statusPattern = Pattern . compile(" (\\ w)\\ t+(.+)" )
89
+ // def systemOutStream = new ByteArrayOutputStream()
90
+ // def command = "git diff --name-status --diff-filter=dr $targetBranch $sourceBranch"
91
+ // command.execute().waitForProcessOutput(systemOutStream, System.err)
92
+ // def allFiles = systemOutStream.toString().trim().split('\n')
93
+ // systemOutStream.close()
94
+ //
95
+ // // Remove the status prefix
96
+ // Pattern statusPattern = Pattern.compile("(\\w)\\t+(.+)")
94
97
List<String > files = new ArrayList<> ()
95
98
96
- println " Changed files:"
99
+ // println "Changed files:"
97
100
98
- for (file in allFiles) {
99
- Matcher matcher = statusPattern. matcher(file)
100
- if (matcher. find()) {
101
- println " + ${ matcher.group(2)} "
102
- files. add(matcher. group(2 ))
103
- }
104
- }
101
+ // for (file in allFiles) {
102
+ // Matcher matcher = statusPattern.matcher(file)
103
+ // if (matcher.find()) {
104
+ // println "+ ${matcher.group(2)}"
105
+ // files.add(matcher.group(2))
106
+ // }
107
+ // }
105
108
106
109
// Return the list of touched files
107
110
files
0 commit comments