Implement filePathPattern in the script configuration with handling
also - tests - extending kdoc for the definitions
This commit is contained in:
committed by
Natalia Selezneva
parent
dface77b5c
commit
0cc40440fb
+9
-1
@@ -120,7 +120,15 @@ abstract class ScriptDefinition : UserDataHolderBase() {
|
||||
)
|
||||
}
|
||||
|
||||
override fun isScript(file: File): Boolean = file.name.endsWith(".$fileExtension")
|
||||
private val filePathPattern by lazy {
|
||||
compilationConfiguration[ScriptCompilationConfiguration.filePathPattern]?.takeIf { it.isNotBlank() }
|
||||
}
|
||||
|
||||
override fun isScript(file: File): Boolean =
|
||||
file.name.endsWith(".$fileExtension") &&
|
||||
(filePathPattern?.let {
|
||||
Regex(it).matches(file.path)
|
||||
} ?: true)
|
||||
|
||||
override val fileExtension: String get() = compilationConfiguration[ScriptCompilationConfiguration.fileExtension]!!
|
||||
|
||||
|
||||
Reference in New Issue
Block a user