@@ -65,43 +65,46 @@ task checkstyleCI(type: Checkstyle) {
6565 */
6666def getChangedFiles () {
6767 // 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" )
7071
71- println " Target Branch: ${ envTargetBranch} "
72- println " Source Branch: ${ envSourceBranch} "
72+ println " Modified Files: ${ modifiedFiles} "
7373
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}"
8276
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}"
8487
8588 // 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+(.+)")
9497 List<String > files = new ArrayList<> ()
9598
96- println " Changed files:"
99+ // println "Changed files:"
97100
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+ // }
105108
106109 // Return the list of touched files
107110 files
0 commit comments