-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Configure Gradle to configure IntelliJ to link issue and PR numbers to GitHub. This is implemented with a build.gradle file because we found it easier to manipulate XML with. A rewrite in Kotlin should be evaluated in the future. Closes: #229 PR: #262
- Loading branch information
Showing
2 changed files
with
28 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import groovy.xml.XmlUtil | ||
|
||
build { | ||
doLast { | ||
def ideaFolder = new File('.idea'); | ||
if(ideaFolder.exists() && ideaFolder.isDirectory()) { | ||
def xmlFile = new File(".idea/vcs.xml") | ||
def xml = new XmlSlurper().parse(xmlFile) | ||
xml.component.find {it.@name == 'IssueNavigationConfiguration'}.replaceNode {} | ||
xml.appendNode { | ||
component(name: "IssueNavigationConfiguration") { | ||
option(name: 'links') { | ||
list { | ||
IssueNavigationLink { | ||
option(name: "issueRegexp", value: '#(\\d+)') | ||
option(name: "linkRegexp", value: 'https://github.com/junit-pioneer/junit-pioneer/issues/$1') | ||
} | ||
} | ||
} | ||
} | ||
} | ||
xmlFile.withWriter {out-> | ||
XmlUtil.serialize(xml, out) | ||
} | ||
} | ||
} | ||
} |