mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[kotlin] Replace Java version with placeholders in testNewModuleInJavaProject to make it work on any version
^KTIJ-29188 Fixed Merge-request: IJ-MR-130054 Merged-by: Victoria Petrakovich <Victoria.Petrakovich@jetbrains.com> GitOrigin-RevId: ab7c48fbf745e6bdb5047ee4111a85f8397659d8
This commit is contained in:
committed by
intellij-monorepo-bot
parent
3b91d4d47c
commit
8867b57c84
+15
-1
@@ -329,7 +329,8 @@ class MavenNewKotlinModuleTest : MavenNewProjectWizardTestCase(), NewKotlinProje
|
||||
}
|
||||
|
||||
override fun postprocessOutputFile(relativePath: String, fileContents: String): String {
|
||||
return substituteArtifactsVersions(fileContents)
|
||||
val result = substituteCompilerSourceAndTargetLevels(fileContents)
|
||||
return substituteArtifactsVersions(result)
|
||||
}
|
||||
|
||||
override fun getTestFolderName(): String {
|
||||
@@ -367,4 +368,17 @@ class MavenNewKotlinModuleTest : MavenNewProjectWizardTestCase(), NewKotlinProje
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
private fun substituteCompilerSourceAndTargetLevels(fileContents: String): String {
|
||||
val compilerSourceRegex = Regex("<maven.compiler.source>(\\d\\d)")
|
||||
val compilerTargetRegex = Regex("<maven.compiler.target>(\\d\\d)")
|
||||
var result = fileContents
|
||||
if (result.contains(compilerSourceRegex)) {
|
||||
result = result.replace(compilerSourceRegex, "<maven.compiler.source>VERSION")
|
||||
}
|
||||
if (result.contains(compilerTargetRegex)) {
|
||||
result = result.replace(compilerTargetRegex, "<maven.compiler.target>VERSION")
|
||||
}
|
||||
return result
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -13,8 +13,8 @@
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<maven.compiler.source>VERSION</maven.compiler.source>
|
||||
<maven.compiler.target>VERSION</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user