Exclude junit-platform.properties from compiler test JAR
Presence of 'junit-platform.properties' in the JAR makes JUnit5 IDE tests run in parallel. The IDE infrastructure isn't prepared for this, and tests fail miserably with a variety of exceptions.
This commit is contained in:
@@ -230,7 +230,10 @@ fun Project.publishJarsForIde(projects: List<String>, libraryDependencies: List<
|
|||||||
|
|
||||||
fun Project.publishTestJarsForIde(projectNames: List<String>) {
|
fun Project.publishTestJarsForIde(projectNames: List<String>) {
|
||||||
idePluginDependency {
|
idePluginDependency {
|
||||||
publishTestJar(projectNames)
|
// Compiler test infrastructure should not affect test running in IDE.
|
||||||
|
// If required, the components should be registered on the IDE plugin side.
|
||||||
|
val excludedPaths = listOf("junit-platform.properties", "META-INF/services")
|
||||||
|
publishTestJar(projectNames, excludedPaths)
|
||||||
}
|
}
|
||||||
configurations.all {
|
configurations.all {
|
||||||
// Don't allow `ideaIC` from compiler to leak into Kotlin plugin modules. Compiler and
|
// Don't allow `ideaIC` from compiler to leak into Kotlin plugin modules. Compiler and
|
||||||
@@ -282,7 +285,7 @@ fun Project.publishProjectJars(projects: List<String>, libraryDependencies: List
|
|||||||
javadocJar()
|
javadocJar()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Project.publishTestJar(projects: List<String>) {
|
fun Project.publishTestJar(projects: List<String>, excludedPaths: List<String>) {
|
||||||
apply<JavaPlugin>()
|
apply<JavaPlugin>()
|
||||||
|
|
||||||
val fatJarContents by configurations.creating
|
val fatJarContents by configurations.creating
|
||||||
@@ -303,6 +306,8 @@ fun Project.publishTestJar(projects: List<String>) {
|
|||||||
from {
|
from {
|
||||||
fatJarContents.map(::zipTree)
|
fatJarContents.map(::zipTree)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
exclude(excludedPaths)
|
||||||
}
|
}
|
||||||
|
|
||||||
sourcesJar {
|
sourcesJar {
|
||||||
|
|||||||
Reference in New Issue
Block a user