File tree Expand file tree Collapse file tree 5 files changed +23
-23
lines changed
plugins/package-curation-providers/api/src/main/kotlin Expand file tree Collapse file tree 5 files changed +23
-23
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ import org.ossreviewtoolkit.downloader.VersionControlSystem
38
38
import org.ossreviewtoolkit.model.OrtResult
39
39
import org.ossreviewtoolkit.model.config.OrtConfiguration
40
40
import org.ossreviewtoolkit.model.config.OrtConfigurationWrapper
41
- import org.ossreviewtoolkit.model.config.PackageCurationProviderConfiguration
41
+ import org.ossreviewtoolkit.model.config.PluginConfiguration
42
42
import org.ossreviewtoolkit.model.config.REFERENCE_CONFIG_FILENAME
43
43
import org.ossreviewtoolkit.model.readValue
44
44
import org.ossreviewtoolkit.model.writeValue
@@ -70,7 +70,7 @@ class OrtMainFunTest : StringSpec() {
70
70
OrtConfigurationWrapper (
71
71
OrtConfiguration (
72
72
packageCurationProviders = listOf (
73
- PackageCurationProviderConfiguration (
73
+ PluginConfiguration (
74
74
type = " File" ,
75
75
config = mapOf (" path" to projectDir.resolve(" gradle/curations.yml" ).path)
76
76
)
Original file line number Diff line number Diff line change @@ -85,9 +85,9 @@ data class OrtConfiguration(
85
85
* the priority of the providers: Providers that appear earlier in the list can overwrite curations for the same
86
86
* package from providers that appear later in the list.
87
87
*/
88
- val packageCurationProviders : List <PackageCurationProviderConfiguration > = listOf(
89
- PackageCurationProviderConfiguration (type = "DefaultDir "),
90
- PackageCurationProviderConfiguration (type = "DefaultFile ")
88
+ val packageCurationProviders : List <PluginConfiguration > = listOf(
89
+ PluginConfiguration (type = "DefaultDir "),
90
+ PluginConfiguration (type = "DefaultFile ")
91
91
),
92
92
93
93
/* *
Original file line number Diff line number Diff line change @@ -23,26 +23,26 @@ import com.sksamuel.hoplite.ConfigAlias
23
23
24
24
import org.ossreviewtoolkit.utils.common.Plugin
25
25
26
- data class PackageCurationProviderConfiguration (
26
+ data class PluginConfiguration (
27
27
/* *
28
- * The [type][Plugin.type] of the package curation provider .
28
+ * The [type][Plugin.type] of the plugin to configure .
29
29
*/
30
30
@ConfigAlias(" name" )
31
31
val type : String ,
32
32
33
33
/* *
34
- * A unique identifier for the package curation provider.
34
+ * A unique identifier for the plugin instance to be created, to distinguish plugins of the same type but with
35
+ * different configuration.
35
36
*/
36
37
val id : String = type,
37
38
38
39
/* *
39
- * Whether this curation provider is enabled.
40
+ * A flag to indicate whether this plugin should be enabled or not .
40
41
*/
41
42
val enabled : Boolean = true ,
42
43
43
44
/* *
44
- * The configuration of the package curation provider. See the specific implementation for available configuration
45
- * options.
45
+ * The configuration of the plugin. See the specific implementations for available configuration options.
46
46
*/
47
47
val config : Map <String , String > = emptyMap()
48
48
)
Original file line number Diff line number Diff line change @@ -64,24 +64,24 @@ class OrtConfigurationTest : WordSpec({
64
64
}
65
65
66
66
ortConfig.packageCurationProviders should containExactly(
67
- PackageCurationProviderConfiguration (type = "DefaultFile "),
68
- PackageCurationProviderConfiguration (type = "DefaultDir "),
69
- PackageCurationProviderConfiguration (
67
+ PluginConfiguration (type = "DefaultFile "),
68
+ PluginConfiguration (type = "DefaultDir "),
69
+ PluginConfiguration (
70
70
type = "File ",
71
71
id = "SomeCurationsFile ",
72
72
config = mapOf("path" to "/some-path/curations.yml", "mustExist" to "true")
73
73
),
74
- PackageCurationProviderConfiguration (
74
+ PluginConfiguration (
75
75
type = "File ",
76
76
id = "SomeCurationsDir ",
77
77
config = mapOf("path" to "/some-path/curations-dir", "mustExist" to "false")
78
78
),
79
- PackageCurationProviderConfiguration (type = "OrtConfig ", enabled = true),
80
- PackageCurationProviderConfiguration (
79
+ PluginConfiguration (type = "OrtConfig ", enabled = true),
80
+ PluginConfiguration (
81
81
type = "ClearlyDefined ",
82
82
config = mapOf("serverUrl" to "https://api.clearlydefined.io", "minTotalLicenseScore" to "80")
83
83
),
84
- PackageCurationProviderConfiguration (
84
+ PluginConfiguration (
85
85
type = "SW360 ",
86
86
config = mapOf(
87
87
"restUrl" to "https://your-sw360-rest-url",
Original file line number Diff line number Diff line change 20
20
package org.ossreviewtoolkit.plugins.packagecurationproviders.api
21
21
22
22
import org.ossreviewtoolkit.model.ResolvedPackageCurations.Companion.REPOSITORY_CONFIGURATION_PROVIDER_ID
23
- import org.ossreviewtoolkit.model.config.PackageCurationProviderConfiguration
23
+ import org.ossreviewtoolkit.model.config.PluginConfiguration
24
24
import org.ossreviewtoolkit.model.utils.PackageCurationProvider
25
25
import org.ossreviewtoolkit.utils.common.ConfigurablePluginFactory
26
26
import org.ossreviewtoolkit.utils.common.Plugin
@@ -34,12 +34,12 @@ interface PackageCurationProviderFactory<CONFIG> : ConfigurablePluginFactory<Pac
34
34
val ALL = Plugin .getAll<PackageCurationProviderFactory <* >>()
35
35
36
36
/* *
37
- * Return a new (identifier, provider instance) tuple for each
38
- * [enabled][PackageCurationProviderConfiguration.enabled] provider configuration in [configurations] ordered
39
- * highest-priority first. The given [configurations] must be ordered highest-priority first as well.
37
+ * Return a new (identifier, provider instance) tuple for each [enabled][PluginConfiguration.enabled] provider
38
+ * configuration in [configurations] ordered highest-priority first. The given [configurations] must be ordered
39
+ * highest-priority first as well.
40
40
*/
41
41
fun create (
42
- configurations : List <PackageCurationProviderConfiguration >
42
+ configurations : List <PluginConfiguration >
43
43
): List <Pair <String , PackageCurationProvider >> =
44
44
configurations.filter {
45
45
it.enabled
You can’t perform that action at this time.
0 commit comments