Skip to content

Commit

Permalink
perf(requirements): Limit scanning to sub-types
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
sschuberth committed Nov 26, 2023
1 parent 805a6e7 commit a176fc5
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -141,7 +142,7 @@ class RequirementsCommand : OrtCommand(
}

private fun getToolsByCategory(): Map<String, List<CommandLineTool>> {
val reflections = Reflections("org.ossreviewtoolkit")
val reflections = Reflections("org.ossreviewtoolkit", Scanners.SubTypes)
val classes = reflections.getSubTypesOf(CommandLineTool::class.java)

val tools = mutableMapOf<String, MutableList<CommandLineTool>>()
Expand Down

0 comments on commit a176fc5

Please sign in to comment.