|
20 | 20 | package org.ossreviewtoolkit.scanner |
21 | 21 |
|
22 | 22 | import org.ossreviewtoolkit.model.ScannerDetails |
23 | | -import org.ossreviewtoolkit.utils.common.Options |
24 | 23 |
|
25 | 24 | import org.semver4j.Semver |
26 | 25 |
|
@@ -111,50 +110,5 @@ data class ScannerMatcherConfig( |
111 | 110 | ) { |
112 | 111 | companion object { |
113 | 112 | val EMPTY = ScannerMatcherConfig(null, null, null, null) |
114 | | - |
115 | | - /** |
116 | | - * The name of the property defining the regular expression for the scanner name as part of [ScannerMatcher]. |
117 | | - * The [scanner details][ScannerDetails] of the corresponding scanner must match the criteria. |
118 | | - */ |
119 | | - internal const val PROP_CRITERIA_NAME = "regScannerName" |
120 | | - |
121 | | - /** |
122 | | - * The name of the property defining the minimum version of the scanner as part of [ScannerMatcher]. The |
123 | | - * [scanner details][ScannerDetails] of the corresponding scanner must match the criteria. |
124 | | - */ |
125 | | - internal const val PROP_CRITERIA_MIN_VERSION = "minVersion" |
126 | | - |
127 | | - /** |
128 | | - * The name of the property defining the maximum version of the scanner as part of [ScannerMatcher]. The |
129 | | - * [scanner details][ScannerDetails] of the corresponding scanner must match the criteria. |
130 | | - */ |
131 | | - internal const val PROP_CRITERIA_MAX_VERSION = "maxVersion" |
132 | | - |
133 | | - /** |
134 | | - * The name of the property defining the configuration of the scanner as part of [ScannerMatcher]. The |
135 | | - * [scanner details][ScannerDetails] of the corresponding scanner must match the criteria. |
136 | | - */ |
137 | | - internal const val PROP_CRITERIA_CONFIGURATION = "configuration" |
138 | | - |
139 | | - private val properties = listOf( |
140 | | - PROP_CRITERIA_NAME, PROP_CRITERIA_MIN_VERSION, PROP_CRITERIA_MAX_VERSION, PROP_CRITERIA_CONFIGURATION |
141 | | - ) |
142 | | - |
143 | | - /** |
144 | | - * Create a [ScannerMatcherConfig] from the provided options. Return the created config and the options without |
145 | | - * the properties that are used to configure the matcher. |
146 | | - */ |
147 | | - fun create(options: Options): Pair<ScannerMatcherConfig, Options> { |
148 | | - val filteredOptions = options.filterKeys { it !in properties } |
149 | | - |
150 | | - val matcherConfig = ScannerMatcherConfig( |
151 | | - regScannerName = options[PROP_CRITERIA_NAME], |
152 | | - minVersion = options[PROP_CRITERIA_MIN_VERSION], |
153 | | - maxVersion = options[PROP_CRITERIA_MAX_VERSION], |
154 | | - configuration = options[PROP_CRITERIA_CONFIGURATION] |
155 | | - ) |
156 | | - |
157 | | - return matcherConfig to filteredOptions |
158 | | - } |
159 | 113 | } |
160 | 114 | } |
0 commit comments