Skip to content

Commit

Permalink
Fix intellij gradle integration copyright configuration (#2234)
Browse files Browse the repository at this point in the history
Fix intellij gradle integration copyright configuration
  • Loading branch information
carterkozak authored Apr 28, 2022
1 parent 1492df5 commit ff286f6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions changelog/@unreleased/pr-2234.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: fix
fix:
description: Fix intellij gradle integration copyright configuration
links:
- https://github.com/palantir/gradle-baseline/pull/2234
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ class BaselineIdea extends AbstractBaselinePlugin {
}

private static void createOrUpdateCopyrightFile(Node node, File file, String fileName) {
def copyrightText = XmlUtil.escapeControlCharacters(XmlUtil.escapeXml(file.text.trim()))
def copyrightText = file.text.trim()
// Ensure that subsequent runs don't produce duplicate entries
Node copyrightNode = GroovyXmlUtils.matchOrCreateChild(node, "copyright")
Node noticeNode = GroovyXmlUtils.matchOrCreateChild(copyrightNode, "option", ["name": "notice"])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ class BaselineIdeaIntegrationTest extends AbstractPluginTest {

def apacheCopyright = new File(copyrightDir, "001_apache-2.0.xml").text
apacheCopyright.contains('<option name="myName" value="001_apache-2.0.txt"/>')
// Ensure correct xml encoding (not double-encoded)
apacheCopyright.contains('Apache License, Version 2.0 (the &quot;License&quot;)')

def palantirCopyright = new File(copyrightDir, "999_palantir.xml").text
palantirCopyright.contains('<option name="myName" value="999_palantir.txt"/>')
Expand Down

0 comments on commit ff286f6

Please sign in to comment.