Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix intellij gradle integration copyright configuration #2234

Merged
merged 2 commits into from
Apr 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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