Skip to content

Commit 90f9993

Browse files
committed
refactor: Move Go package managers to their own plugin project
Signed-off-by: Sebastian Schuberth <[email protected]>
1 parent b330f35 commit 90f9993

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+92
-49
lines changed

analyzer/build.gradle.kts

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,12 @@
1717
* License-Filename: LICENSE
1818
*/
1919

20-
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
21-
2220
plugins {
2321
// Apply core plugins.
2422
`java-test-fixtures`
2523

2624
// Apply precompiled plugins.
2725
id("ort-library-conventions")
28-
29-
// Apply third-party plugins.
30-
alias(libs.plugins.kotlinSerialization)
3126
}
3227

3328
dependencies {
@@ -46,18 +41,10 @@ dependencies {
4641
// container automatically. They are required on the classpath for Maven dependency resolution to work.
4742
implementation(libs.bundles.mavenResolver)
4843

49-
implementation(libs.bundles.kotlinxSerialization)
5044
implementation(libs.kotlinxCoroutines)
5145
implementation(libs.log4jApi)
5246
implementation(libs.semver4j)
5347

54-
implementation(libs.toml4j)
55-
constraints {
56-
implementation("com.google.code.gson:gson:2.10.1") {
57-
because("Earlier versions have vulnerabilities.")
58-
}
59-
}
60-
6148
funTestImplementation(platform(project(":plugins:package-managers")))
6249

6350
// Only the Java plugin's built-in "test" source set automatically depends on the test fixtures.
@@ -70,16 +57,3 @@ dependencies {
7057

7158
testImplementation(libs.mockk)
7259
}
73-
74-
// Must not opt-in for "compileTestFixturesKotlin" as it does not have kotlinx-serialization in the classpath.
75-
listOf("compileKotlin", "compileTestKotlin").forEach {
76-
tasks.named<KotlinCompile>(it) {
77-
val customCompilerArgs = listOf(
78-
"-opt-in=kotlinx.serialization.ExperimentalSerializationApi"
79-
)
80-
81-
compilerOptions {
82-
freeCompilerArgs.addAll(customCompilerArgs)
83-
}
84-
}
85-
}
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
org.ossreviewtoolkit.analyzer.managers.GoDep$Factory
2-
org.ossreviewtoolkit.analyzer.managers.GoMod$Factory
31
org.ossreviewtoolkit.analyzer.managers.Maven$Factory
42
org.ossreviewtoolkit.analyzer.managers.Sbt$Factory
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/*
2+
* Copyright (C) 2023 The ORT Project Authors (see <https://github.com/oss-review-toolkit/ort/blob/main/NOTICE>)
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*
16+
* SPDX-License-Identifier: Apache-2.0
17+
* License-Filename: LICENSE
18+
*/
19+
20+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
21+
22+
plugins {
23+
// Apply precompiled plugins.
24+
id("ort-library-conventions")
25+
26+
// Apply third-party plugins.
27+
alias(libs.plugins.kotlinSerialization)
28+
}
29+
30+
dependencies {
31+
api(project(":analyzer"))
32+
api(project(":model"))
33+
api(project(":utils:common-utils")) {
34+
because("This is a CommandLineTool.")
35+
}
36+
37+
api(libs.semver4j) {
38+
because("This is a CommandLineTool.")
39+
}
40+
41+
implementation(project(":downloader"))
42+
implementation(project(":utils:ort-utils"))
43+
implementation(project(":utils:spdx-utils"))
44+
45+
implementation(libs.bundles.kotlinxSerialization)
46+
implementation(libs.toml4j)
47+
constraints {
48+
implementation("com.google.code.gson:gson:2.10.1") {
49+
because("Earlier versions have vulnerabilities.")
50+
}
51+
}
52+
53+
funTestImplementation(testFixtures(project(":analyzer")))
54+
}
55+
56+
tasks.withType<KotlinCompile>().configureEach {
57+
val customCompilerArgs = listOf(
58+
"-opt-in=kotlinx.serialization.ExperimentalSerializationApi"
59+
)
60+
61+
compilerOptions {
62+
freeCompilerArgs.addAll(customCompilerArgs)
63+
}
64+
}

analyzer/src/funTest/assets/projects/synthetic/glide-expected-output.yml renamed to plugins/package-managers/go/src/funTest/assets/projects/synthetic/glide-expected-output.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
project:
3-
id: "GoDep::github.com/oss-review-toolkit/ort/analyzer/src/funtest/assets/projects/synthetic/godep/glide:<REPLACE_REVISION>"
4-
definition_file_path: "analyzer/src/funTest/assets/projects/synthetic/godep/glide/glide.yaml"
3+
id: "GoDep::github.com/oss-review-toolkit/ort/plugins/package-managers/go/src/funtest/assets/projects/synthetic/godep/glide:<REPLACE_REVISION>"
4+
definition_file_path: "plugins/package-managers/go/src/funTest/assets/projects/synthetic/godep/glide/glide.yaml"
55
declared_licenses: []
66
declared_licenses_processed: {}
77
vcs:

analyzer/src/funTest/assets/projects/synthetic/godep-expected-output.yml renamed to plugins/package-managers/go/src/funTest/assets/projects/synthetic/godep-expected-output.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
project:
3-
id: "GoDep::github.com/oss-review-toolkit/ort/analyzer/src/funtest/assets/projects/synthetic/godep/lockfile:<REPLACE_REVISION>"
4-
definition_file_path: "analyzer/src/funTest/assets/projects/synthetic/godep/lockfile/Gopkg.toml"
3+
id: "GoDep::github.com/oss-review-toolkit/ort/plugins/package-managers/go/src/funtest/assets/projects/synthetic/godep/lockfile:<REPLACE_REVISION>"
4+
definition_file_path: "plugins/package-managers/go/src/funTest/assets/projects/synthetic/godep/lockfile/Gopkg.toml"
55
declared_licenses: []
66
declared_licenses_processed: {}
77
vcs:

0 commit comments

Comments
 (0)