From a176fc543b08525239e6be5e917f9309fc3b061b Mon Sep 17 00:00:00 2001 From: Sebastian Schuberth Date: Thu, 23 Nov 2023 18:37:27 +0100 Subject: [PATCH] perf(requirements): Limit scanning to sub-types By default, `SubTypes` and `TypesAnnotated` are used [1], but the former is enough here. [1]: https://github.com/ronmamo/reflections?tab=readme-ov-file#scan Signed-off-by: Sebastian Schuberth --- .../requirements/src/main/kotlin/RequirementsCommand.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/commands/requirements/src/main/kotlin/RequirementsCommand.kt b/plugins/commands/requirements/src/main/kotlin/RequirementsCommand.kt index 8334b1b9bd2ff..a1e8593b219ca 100644 --- a/plugins/commands/requirements/src/main/kotlin/RequirementsCommand.kt +++ b/plugins/commands/requirements/src/main/kotlin/RequirementsCommand.kt @@ -38,6 +38,7 @@ import org.ossreviewtoolkit.utils.common.CommandLineTool import org.ossreviewtoolkit.utils.spdx.scanCodeLicenseTextDir import org.reflections.Reflections +import org.reflections.scanners.Scanners import org.semver4j.Semver @@ -141,7 +142,7 @@ class RequirementsCommand : OrtCommand( } private fun getToolsByCategory(): Map> { - val reflections = Reflections("org.ossreviewtoolkit") + val reflections = Reflections("org.ossreviewtoolkit", Scanners.SubTypes) val classes = reflections.getSubTypesOf(CommandLineTool::class.java) val tools = mutableMapOf>()