Skip to content

Commit 16286c3

Browse files
committed
fix(buildSrc): Write new NuGet curations with the correct ID
ORT core changed the way to refer to NuGet packages [1]. Adapt for that when generating new NuGet curations. Existing NuGet curations will be migrated separately. [1]: oss-review-toolkit/ort#6046 Signed-off-by: Sebastian Schuberth <[email protected]>
1 parent d59112c commit 16286c3

File tree

6 files changed

+10
-8
lines changed

6 files changed

+10
-8
lines changed

tools/curations/buildSrc/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ repositories {
88

99
dependencies {
1010
implementation(libs.ortModel)
11+
implementation(libs.ortNuGetPackageManager)
1112

1213
// Leave out the versions so that the same versions as in ORT are used.
1314
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")

tools/curations/buildSrc/src/main/kotlin/GenerateAspNetCoreCurationsTask.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package org.ossreviewtoolkit.tools.curations
22

33
import org.gradle.api.tasks.TaskAction
4-
import org.ossreviewtoolkit.model.Identifier
4+
import org.ossreviewtoolkit.plugins.packagemanagers.nuget.utils.getIdentifierWithNamespace
55

66
open class GenerateAspNetCoreCurationsTask : BaseGenerateCurationsTask() {
77
@TaskAction
@@ -24,7 +24,7 @@ open class GenerateAspNetCoreCurationsTask : BaseGenerateCurationsTask() {
2424
&& !project.endsWith("Test")
2525
&& !path.endsWith("/ref")
2626
) {
27-
val id = Identifier("NuGet::$project")
27+
val id = getIdentifierWithNamespace("NuGet", project, "")
2828
data += PathCurationData(id, path, tag)
2929
}
3030
}

tools/curations/buildSrc/src/main/kotlin/GenerateAwsSdkForNetCurationsTask.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package org.ossreviewtoolkit.tools.curations
22

33
import org.gradle.api.tasks.TaskAction
4-
import org.ossreviewtoolkit.model.Identifier
4+
import org.ossreviewtoolkit.plugins.packagemanagers.nuget.utils.getIdentifierWithNamespace
55

66
open class GenerateAwsSdkForNetCurationsTask : BaseGenerateCurationsTask() {
77
private val fourDigitVersionRegex = Regex("""\d+\.\d+\.\d+\.\d+""")
@@ -23,7 +23,7 @@ open class GenerateAwsSdkForNetCurationsTask : BaseGenerateCurationsTask() {
2323
.removeSuffix(".csproj")
2424
.replace(targetFrameworkRegex, "")
2525
val path = it.substringBeforeLast("/")
26-
val id = Identifier("NuGet::$project")
26+
val id = getIdentifierWithNamespace("NuGet", project, "")
2727

2828
// The AWS SDK for .NET uses a four-part version number for all packages. However, Semver4j
2929
// does not support four-part version numbers. Therefore, remove the fourth digit.

tools/curations/buildSrc/src/main/kotlin/GenerateAzureSdkForNetCurationsTask.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package org.ossreviewtoolkit.tools.curations
22

33
import org.gradle.api.tasks.TaskAction
4-
import org.ossreviewtoolkit.model.Identifier
4+
import org.ossreviewtoolkit.plugins.packagemanagers.nuget.utils.getIdentifierWithNamespace
55

66
open class GenerateAzureSdkForNetCurationsTask : BaseGenerateCurationsTask() {
77
@TaskAction
@@ -11,7 +11,7 @@ open class GenerateAzureSdkForNetCurationsTask : BaseGenerateCurationsTask() {
1111
.forEach {
1212
val project = it.substringAfterLast("/").removeSuffix(".sln")
1313
val path = it.substringBeforeLast("/")
14-
val id = Identifier("NuGet::$project")
14+
val id = getIdentifierWithNamespace("NuGet", project, "")
1515

1616
createPathCuration(id, path)
1717
}

tools/curations/buildSrc/src/main/kotlin/GenerateDotNetRuntimeCurationsTask.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package org.ossreviewtoolkit.tools.curations
22

33
import org.gradle.api.tasks.TaskAction
4-
import org.ossreviewtoolkit.model.Identifier
4+
import org.ossreviewtoolkit.plugins.packagemanagers.nuget.utils.getIdentifierWithNamespace
55

66
open class GenerateDotNetRuntimeCurationsTask : BaseGenerateCurationsTask() {
77
@TaskAction
@@ -18,7 +18,7 @@ open class GenerateDotNetRuntimeCurationsTask : BaseGenerateCurationsTask() {
1818
.forEach {
1919
val project = it.substringAfterLast("/").removeSuffix(".sln")
2020
val path = it.substringBeforeLast("/")
21-
val id = Identifier("NuGet::$project")
21+
val id = getIdentifierWithNamespace("NuGet", project, "")
2222

2323
if ("System." in project || "Microsoft." in project) {
2424
data += PathCurationData(id, path, tag)

tools/curations/gradle/libs.versions.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ ort = "1.0.1"
33

44
[libraries]
55
ortModel = { module = "org.ossreviewtoolkit:model", version.ref = "ort" }
6+
ortNuGetPackageManager = { module = "org.ossreviewtoolkit.plugins.packagemanagers:nuget-package-manager", version.ref = "ort" }

0 commit comments

Comments
 (0)