Skip to content

Commit

Permalink
build(Gradle): Move the Gradle package manager to its own plugin project
Browse files Browse the repository at this point in the history
This continues the effort started in be4bb69 to move plugin
implementations, here for the Gradle package manager. See [1] for more
context.

This temporarily adds the `gradle-package-manager` project as a
`funTest`-dependency because the `PubFunTest` relies on it. This will be
addressed when also moving the Pub package manager plugin.

[1]: #6602

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
  • Loading branch information
sschuberth committed Mar 13, 2023
1 parent ff0ca15 commit 4a743b5
Show file tree
Hide file tree
Showing 137 changed files with 127 additions and 67 deletions.
3 changes: 2 additions & 1 deletion analyzer/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ dependencies {
implementation(project(":utils:ort-utils"))
implementation(project(":utils:spdx-utils"))

implementation("org.gradle:gradle-tooling-api:${gradle.gradleVersion}")
implementation(libs.bundles.maven)

// The classes from the maven-resolver dependencies are not used directly but initialized by the Plexus IoC
Expand All @@ -61,6 +60,8 @@ dependencies {
}
}

funTestImplementation(project(":plugins:package-managers:gradle-package-manager"))

testImplementation(libs.mockk)
testImplementation(libs.wiremock)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ org.ossreviewtoolkit.analyzer.managers.Conan$Factory
org.ossreviewtoolkit.analyzer.managers.DotNet$Factory
org.ossreviewtoolkit.analyzer.managers.GoDep$Factory
org.ossreviewtoolkit.analyzer.managers.GoMod$Factory
org.ossreviewtoolkit.analyzer.managers.Gradle$Factory
org.ossreviewtoolkit.analyzer.managers.Maven$Factory
org.ossreviewtoolkit.analyzer.managers.Npm$Factory
org.ossreviewtoolkit.analyzer.managers.NuGet$Factory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ repository:
type: "Git"
url: "<REPLACE_URL>"
revision: "<REPLACE_REVISION>"
path: "analyzer/src/funTest/assets/projects/synthetic/gradle"
path: "plugins/package-managers/gradle/src/funTest/assets/projects/synthetic/gradle"
vcs_processed:
type: "Git"
url: "<REPLACE_URL_PROCESSED>"
revision: "<REPLACE_REVISION>"
path: "analyzer/src/funTest/assets/projects/synthetic/gradle"
path: "plugins/package-managers/gradle/src/funTest/assets/projects/synthetic/gradle"
config:
excludes:
paths:
- pattern: "analyzer/src/funTest/assets/projects/synthetic/gradle/lib-without-repo/build.gradle"
- pattern: "plugins/package-managers/gradle/src/funTest/assets/projects/synthetic/gradle/lib-without-repo/build.gradle"
reason: "OPTIONAL_COMPONENT_OF"
comment: "Project not delivered."
scopes:
Expand Down Expand Up @@ -54,7 +54,7 @@ analyzer:
result:
projects:
- id: "Gradle::Gradle-Example:"
definition_file_path: "analyzer/src/funTest/assets/projects/synthetic/gradle/build.gradle"
definition_file_path: "plugins/package-managers/gradle/src/funTest/assets/projects/synthetic/gradle/build.gradle"
declared_licenses: []
declared_licenses_processed: {}
vcs:
Expand All @@ -66,11 +66,11 @@ analyzer:
type: "Git"
url: "<REPLACE_URL_PROCESSED>"
revision: "<REPLACE_REVISION>"
path: "analyzer/src/funTest/assets/projects/synthetic/gradle"
path: "plugins/package-managers/gradle/src/funTest/assets/projects/synthetic/gradle"
homepage_url: ""
scopes: []
- id: "Gradle:org.ossreviewtoolkit.gradle.example:app:1.0.0"
definition_file_path: "analyzer/src/funTest/assets/projects/synthetic/gradle/app/build.gradle"
definition_file_path: "plugins/package-managers/gradle/src/funTest/assets/projects/synthetic/gradle/app/build.gradle"
declared_licenses: []
declared_licenses_processed: {}
vcs:
Expand All @@ -82,7 +82,7 @@ analyzer:
type: "Git"
url: "<REPLACE_URL_PROCESSED>"
revision: "<REPLACE_REVISION>"
path: "analyzer/src/funTest/assets/projects/synthetic/gradle/app"
path: "plugins/package-managers/gradle/src/funTest/assets/projects/synthetic/gradle/app"
homepage_url: ""
scopes:
- name: "compileClasspath"
Expand Down Expand Up @@ -112,7 +112,7 @@ analyzer:
- id: "Maven:org.apache.commons:commons-lang3:3.5"
- id: "Maven:org.apache.struts:struts2-assembly:2.5.14.1"
- id: "Gradle:org.ossreviewtoolkit.gradle.example:lib:1.0.0"
definition_file_path: "analyzer/src/funTest/assets/projects/synthetic/gradle/lib/build.gradle"
definition_file_path: "plugins/package-managers/gradle/src/funTest/assets/projects/synthetic/gradle/lib/build.gradle"
declared_licenses: []
declared_licenses_processed: {}
vcs:
Expand All @@ -124,7 +124,7 @@ analyzer:
type: "Git"
url: "<REPLACE_URL_PROCESSED>"
revision: "<REPLACE_REVISION>"
path: "analyzer/src/funTest/assets/projects/synthetic/gradle/lib"
path: "plugins/package-managers/gradle/src/funTest/assets/projects/synthetic/gradle/lib"
homepage_url: ""
scopes:
- name: "compileClasspath"
Expand Down Expand Up @@ -158,7 +158,7 @@ analyzer:
- id: "Maven:org.apache.commons:commons-lang3:3.5"
- id: "Maven:org.apache.struts:struts2-assembly:2.5.14.1"
- id: "Gradle:org.ossreviewtoolkit.gradle.example:lib-without-repo:1.0.0"
definition_file_path: "analyzer/src/funTest/assets/projects/synthetic/gradle/lib-without-repo/build.gradle"
definition_file_path: "plugins/package-managers/gradle/src/funTest/assets/projects/synthetic/gradle/lib-without-repo/build.gradle"
declared_licenses: []
declared_licenses_processed: {}
vcs:
Expand All @@ -170,7 +170,7 @@ analyzer:
type: "Git"
url: "<REPLACE_URL_PROCESSED>"
revision: "<REPLACE_REVISION>"
path: "analyzer/src/funTest/assets/projects/synthetic/gradle/lib-without-repo"
path: "plugins/package-managers/gradle/src/funTest/assets/projects/synthetic/gradle/lib-without-repo"
homepage_url: ""
scopes:
- name: "compileClasspath"
Expand Down
2 changes: 1 addition & 1 deletion cli/src/funTest/kotlin/OrtMainFunTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ import org.ossreviewtoolkit.utils.test.shouldNotBeNull
* A test for the main entry point of the application.
*/
class OrtMainFunTest : StringSpec() {
private val projectDir = File("../analyzer/src/funTest/assets/projects/synthetic")
private val projectDir = File("../plugins/package-managers/gradle/src/funTest/assets/projects/synthetic")
private val vcsDir = VersionControlSystem.forDirectory(projectDir)!!
private val vcsUrl = vcsDir.getRemoteUrl()
private val vcsRevision = vcsDir.getRevision()
Expand Down
1 change: 1 addition & 0 deletions plugins/package-managers/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ javaPlatform {
}

dependencies {
api(project(":plugins:package-managers:gradle-package-manager"))
api(project(":plugins:package-managers:python-package-manager"))
}

Expand Down
48 changes: 48 additions & 0 deletions plugins/package-managers/gradle/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* Copyright (C) 2023 The ORT Project Authors (see <https://github.com/oss-review-toolkit/ort/blob/main/NOTICE>)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* SPDX-License-Identifier: Apache-2.0
* License-Filename: LICENSE
*/

plugins {
// Apply core plugins.
`java-library`
}

repositories {
exclusiveContent {
forRepository {
maven("https://repo.gradle.org/gradle/libs-releases/")
}

filter {
includeGroup("org.gradle")
}
}
}

dependencies {
api(project(":analyzer"))

implementation(project(":downloader"))

implementation("org.gradle:gradle-tooling-api:${gradle.gradleVersion}")
implementation(libs.bundles.maven)

funTestImplementation(testFixtures(project(":analyzer")))

testImplementation(libs.mockk)
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ project_results:
<REPLACE_DEFINITION_FILE_PATH>:
- project:
id: "Gradle:org.ossreviewtoolkit.gradle.example:app:1.0.0"
definition_file_path: "analyzer/src/funTest/assets/projects/synthetic/gradle-android-cyclic/app/build.gradle"
definition_file_path: "plugins/package-managers/gradle/src/funTest/assets/projects/synthetic/gradle-android-cyclic/app/build.gradle"
declared_licenses: []
declared_licenses_processed: {}
vcs:
Expand All @@ -15,7 +15,7 @@ project_results:
type: "Git"
url: "<REPLACE_URL>"
revision: "<REPLACE_REVISION>"
path: "analyzer/src/funTest/assets/projects/synthetic/gradle-android-cyclic/app"
path: "plugins/package-managers/gradle/src/funTest/assets/projects/synthetic/gradle-android-cyclic/app"
homepage_url: ""
scope_names:
- "amazonDemoDebugAndroidTestCompileClasspath"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
project:
id: "Gradle:org.ossreviewtoolkit.gradle.example:app:1.0.0"
definition_file_path: "analyzer/src/funTest/assets/projects/synthetic/gradle-android/app/build.gradle"
definition_file_path: "plugins/package-managers/gradle/src/funTest/assets/projects/synthetic/gradle-android/app/build.gradle"
declared_licenses: []
declared_licenses_processed: {}
vcs:
Expand All @@ -13,7 +13,7 @@ project:
type: "Git"
url: "<REPLACE_URL>"
revision: "<REPLACE_REVISION>"
path: "analyzer/src/funTest/assets/projects/synthetic/gradle-android/app"
path: "plugins/package-managers/gradle/src/funTest/assets/projects/synthetic/gradle-android/app"
homepage_url: ""
scopes:
- name: "amazonDemoDebugAndroidTestCompileClasspath"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
project:
id: "Gradle:org.ossreviewtoolkit.gradle.example:lib:1.0.0"
definition_file_path: "analyzer/src/funTest/assets/projects/synthetic/gradle-android/lib/build.gradle"
definition_file_path: "plugins/package-managers/gradle/src/funTest/assets/projects/synthetic/gradle-android/lib/build.gradle"
declared_licenses: []
declared_licenses_processed: {}
vcs:
Expand All @@ -13,7 +13,7 @@ project:
type: "Git"
url: "<REPLACE_URL>"
revision: "<REPLACE_REVISION>"
path: "analyzer/src/funTest/assets/projects/synthetic/gradle-android/lib"
path: "plugins/package-managers/gradle/src/funTest/assets/projects/synthetic/gradle-android/lib"
homepage_url: ""
scopes:
- name: "demoDebugAndroidTestCompileClasspath"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
project:
id: "Gradle:org.ossreviewtoolkit.gradle.example:Gradle-Android-Example:1.0.0"
definition_file_path: "analyzer/src/funTest/assets/projects/synthetic/gradle-android/build.gradle"
definition_file_path: "plugins/package-managers/gradle/src/funTest/assets/projects/synthetic/gradle-android/build.gradle"
declared_licenses: []
declared_licenses_processed: {}
vcs:
Expand All @@ -13,7 +13,7 @@ project:
type: "Git"
url: "<REPLACE_URL>"
revision: "<REPLACE_REVISION>"
path: "analyzer/src/funTest/assets/projects/synthetic/gradle-android"
path: "plugins/package-managers/gradle/src/funTest/assets/projects/synthetic/gradle-android"
homepage_url: ""
scopes: []
packages: []
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
project:
id: "Gradle:org.ossreviewtoolkit.gradle.example:Gradle-BOM-Example:1.0.0"
definition_file_path: "analyzer/src/funTest/assets/projects/synthetic/gradle-bom/build.gradle"
definition_file_path: "plugins/package-managers/gradle/src/funTest/assets/projects/synthetic/gradle-bom/build.gradle"
declared_licenses: []
declared_licenses_processed: {}
vcs:
Expand All @@ -13,7 +13,7 @@ project:
type: "Git"
url: "<REPLACE_URL>"
revision: "<REPLACE_REVISION>"
path: "analyzer/src/funTest/assets/projects/synthetic/gradle-bom"
path: "plugins/package-managers/gradle/src/funTest/assets/projects/synthetic/gradle-bom"
homepage_url: ""
scopes:
- name: "compileClasspath"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
project:
id: "Gradle:org.ossreviewtoolkit.gradle.composite.example:my.project1:1.0.0"
definition_file_path: "analyzer/src/funTest/assets/projects/synthetic/gradle-composite/project1/build.gradle.kts"
definition_file_path: "plugins/package-managers/gradle/src/funTest/assets/projects/synthetic/gradle-composite/project1/build.gradle.kts"
declared_licenses: []
declared_licenses_processed: {}
vcs:
Expand All @@ -13,7 +13,7 @@ project:
type: "Git"
url: "<REPLACE_URL>"
revision: "<REPLACE_REVISION>"
path: "analyzer/src/funTest/assets/projects/synthetic/gradle-composite/project1"
path: "plugins/package-managers/gradle/src/funTest/assets/projects/synthetic/gradle-composite/project1"
homepage_url: ""
scopes:
- name: "compileClasspath"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
project:
id: "Gradle:org.ossreviewtoolkit.gradle.example:app:1.0.0"
definition_file_path: "analyzer/src/funTest/assets/projects/synthetic/gradle/app/build.gradle"
definition_file_path: "plugins/package-managers/gradle/src/funTest/assets/projects/synthetic/gradle/app/build.gradle"
declared_licenses: []
declared_licenses_processed: {}
vcs:
Expand All @@ -13,7 +13,7 @@ project:
type: "Git"
url: "<REPLACE_URL>"
revision: "<REPLACE_REVISION>"
path: "analyzer/src/funTest/assets/projects/synthetic/gradle/app"
path: "plugins/package-managers/gradle/src/funTest/assets/projects/synthetic/gradle/app"
homepage_url: ""
scopes:
- name: "compile"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
project:
id: "Gradle:org.ossreviewtoolkit.gradle.example:app:1.0.0"
definition_file_path: "analyzer/src/funTest/assets/projects/synthetic/gradle/app/build.gradle"
definition_file_path: "plugins/package-managers/gradle/src/funTest/assets/projects/synthetic/gradle/app/build.gradle"
declared_licenses: []
declared_licenses_processed: {}
vcs:
Expand All @@ -13,7 +13,7 @@ project:
type: "Git"
url: "<REPLACE_URL>"
revision: "<REPLACE_REVISION>"
path: "analyzer/src/funTest/assets/projects/synthetic/gradle/app"
path: "plugins/package-managers/gradle/src/funTest/assets/projects/synthetic/gradle/app"
homepage_url: ""
scopes:
- name: "compile"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
project:
id: "Gradle:org.ossreviewtoolkit.gradle.example:app:1.0.0"
definition_file_path: "analyzer/src/funTest/assets/projects/synthetic/gradle/app/build.gradle"
definition_file_path: "plugins/package-managers/gradle/src/funTest/assets/projects/synthetic/gradle/app/build.gradle"
declared_licenses: []
declared_licenses_processed: {}
vcs:
Expand All @@ -13,7 +13,7 @@ project:
type: "Git"
url: "<REPLACE_URL>"
revision: "<REPLACE_REVISION>"
path: "analyzer/src/funTest/assets/projects/synthetic/gradle/app"
path: "plugins/package-managers/gradle/src/funTest/assets/projects/synthetic/gradle/app"
homepage_url: ""
scopes:
- name: "compileClasspath"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
project:
id: "Gradle:org.ossreviewtoolkit.gradle.example:lib-without-repo:1.0.0"
definition_file_path: "analyzer/src/funTest/assets/projects/synthetic/gradle/lib-without-repo/build.gradle"
definition_file_path: "plugins/package-managers/gradle/src/funTest/assets/projects/synthetic/gradle/lib-without-repo/build.gradle"
declared_licenses: []
declared_licenses_processed: {}
vcs:
Expand All @@ -13,7 +13,7 @@ project:
type: "Git"
url: "<REPLACE_URL>"
revision: "<REPLACE_REVISION>"
path: "analyzer/src/funTest/assets/projects/synthetic/gradle/lib-without-repo"
path: "plugins/package-managers/gradle/src/funTest/assets/projects/synthetic/gradle/lib-without-repo"
homepage_url: ""
scopes:
- name: "compileClasspath"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
project:
id: "Gradle:org.ossreviewtoolkit.gradle.example:lib:1.0.0"
definition_file_path: "analyzer/src/funTest/assets/projects/synthetic/gradle/lib/build.gradle"
definition_file_path: "plugins/package-managers/gradle/src/funTest/assets/projects/synthetic/gradle/lib/build.gradle"
declared_licenses: []
declared_licenses_processed: {}
vcs:
Expand All @@ -13,7 +13,7 @@ project:
type: "Git"
url: "<REPLACE_URL>"
revision: "<REPLACE_REVISION>"
path: "analyzer/src/funTest/assets/projects/synthetic/gradle/lib"
path: "plugins/package-managers/gradle/src/funTest/assets/projects/synthetic/gradle/lib"
homepage_url: ""
scopes:
- name: "compileClasspath"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
project:
id: "Gradle::Gradle-Example:"
definition_file_path: "analyzer/src/funTest/assets/projects/synthetic/gradle/build.gradle"
definition_file_path: "plugins/package-managers/gradle/src/funTest/assets/projects/synthetic/gradle/build.gradle"
declared_licenses: []
declared_licenses_processed: {}
vcs:
Expand All @@ -13,7 +13,7 @@ project:
type: "Git"
url: "<REPLACE_URL>"
revision: "<REPLACE_REVISION>"
path: "analyzer/src/funTest/assets/projects/synthetic/gradle"
path: "plugins/package-managers/gradle/src/funTest/assets/projects/synthetic/gradle"
homepage_url: ""
scopes: []
packages: []
Loading

0 comments on commit 4a743b5

Please sign in to comment.