mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-05 01:50:56 +07:00
[maven][IDEA-371747] import maven compiler args with weird names
GitOrigin-RevId: b56453b894746b7a8500d01c1d4cdfe7c4d34d0d
This commit is contained in:
committed by
intellij-monorepo-bot
parent
c11715a6b9
commit
c2de41bc55
@@ -311,12 +311,16 @@ class MavenCompilerConfigurator : MavenApplicableConfigurator(GROUP_ID, ARTIFACT
|
||||
}
|
||||
}
|
||||
}
|
||||
MavenJDOMUtil.findChildrenValuesByPath(element, "compilerArgs", "arg").forEach {
|
||||
val text = getResolvedText(it)
|
||||
element.getChild("compilerArgs")?.children?.forEach {
|
||||
val text = getResolvedText(it.text)
|
||||
if (text != null && !hasUnresolvedProperty(text)) {
|
||||
result.add(text)
|
||||
}
|
||||
}
|
||||
|
||||
MavenJDOMUtil.findChildrenValuesByPath(element, "compilerArgs", "arg").forEach {
|
||||
|
||||
}
|
||||
element.getChild("compilerArgument")?.textTrim?.let {
|
||||
val text = getResolvedText(it)
|
||||
if (text != null && !hasUnresolvedProperty(text)) {
|
||||
|
||||
@@ -1214,4 +1214,36 @@ class MavenCompilerImportingTest : MavenMultiVersionImportingTestCase() {
|
||||
"--add-exports", "java.base/sun.reflect.annotation=ALL-UNNAMED", "--add-exports", "java.base/sun.nio.ch=ALL-UNNAMED")
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestFor(issues = ["IDEA-371747"])
|
||||
fun testCompilerArgumentsWithWeirdNames() = runBlocking {
|
||||
importProjectAsync("""
|
||||
<groupId>test</groupId>
|
||||
<artifactId>project</artifactId>
|
||||
<version>1</version>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.12.1</version>
|
||||
<configuration>
|
||||
<release>17</release>
|
||||
<encoding>UTF-8</encoding>
|
||||
<source>17</source>
|
||||
<compilerArgs>
|
||||
<myWeirdName>-blablabla</myWeirdName>
|
||||
<anotherWeirdname>-qwerty</anotherWeirdname>
|
||||
</compilerArgs>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build> """.trimIndent())
|
||||
|
||||
assertModules("project")
|
||||
assertOrderedElementsAreEqual(ideCompilerConfiguration.getAdditionalOptions(getModule("project")),
|
||||
"-blablabla", "-qwerty")
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user