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.

[1]: #6602

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
  • Loading branch information
sschuberth committed Mar 9, 2023
1 parent 968a136 commit 0426748
Show file tree
Hide file tree
Showing 136 changed files with 112 additions and 66 deletions.
13 changes: 0 additions & 13 deletions analyzer/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,13 @@ plugins {
`java-test-fixtures`
}

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

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

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

implementation(project(":downloader"))
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 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
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: []
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:gradle-unsupported-version:1.0.0"
definition_file_path: "analyzer/src/funTest/assets/projects/synthetic/gradle-unsupported-version/build.gradle"
definition_file_path: "plugins/package-managers/gradle/src/funTest/assets/projects/synthetic/gradle-unsupported-version/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-unsupported-version"
path: "plugins/package-managers/gradle/src/funTest/assets/projects/synthetic/gradle-unsupported-version"
homepage_url: ""
scopes: []
packages: []
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-library/app/build.gradle"
definition_file_path: "plugins/package-managers/gradle/src/funTest/assets/projects/synthetic/gradle-library/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-library/app"
path: "plugins/package-managers/gradle/src/funTest/assets/projects/synthetic/gradle-library/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:1.0.0"
definition_file_path: "analyzer/src/funTest/assets/projects/synthetic/gradle-library/lib/build.gradle"
definition_file_path: "plugins/package-managers/gradle/src/funTest/assets/projects/synthetic/gradle-library/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-library/lib"
path: "plugins/package-managers/gradle/src/funTest/assets/projects/synthetic/gradle-library/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-library/build.gradle"
definition_file_path: "plugins/package-managers/gradle/src/funTest/assets/projects/synthetic/gradle-library/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-library"
path: "plugins/package-managers/gradle/src/funTest/assets/projects/synthetic/gradle-library"
homepage_url: ""
scopes: []
packages: []
Loading

0 comments on commit 0426748

Please sign in to comment.