Fix scripting discovery file recognition for directory dependencies

This commit is contained in:
Ilya Chernikov
2020-02-17 11:59:42 +01:00
parent 9ccda31189
commit 6a24268db1
@@ -112,8 +112,11 @@ private fun scriptTemplatesDiscoverySequence(
defferedDirDependencies.add(dep) // there is no way to know that the dependency is fully "used" so we add it to the list anyway defferedDirDependencies.add(dep) // there is no way to know that the dependency is fully "used" so we add it to the list anyway
val discoveryMarkers = File(dep, SCRIPT_DEFINITION_MARKERS_PATH).listFiles() val discoveryMarkers = File(dep, SCRIPT_DEFINITION_MARKERS_PATH).listFiles()
if (discoveryMarkers?.isEmpty() == false) { if (discoveryMarkers?.isEmpty() == false) {
val (foundDefinitionClasses, notFoundDefinitions) = discoveryMarkers.map { it.name } val (foundDefinitionClasses, notFoundDefinitions) = discoveryMarkers.map {
.partitionLoadDirDefinitions(dep, classpathWithLoader, hostConfiguration, messageReporter) it.name.removeSuffix(
SCRIPT_DEFINITION_MARKERS_EXTENSION_WITH_DOT
)
}.partitionLoadDirDefinitions(dep, classpathWithLoader, hostConfiguration, messageReporter)
foundDefinitionClasses.forEach { foundDefinitionClasses.forEach {
yield(it) yield(it)
} }