Skip to content

Commit

Permalink
build: Include platform projects when running from Gradle or the IDE
Browse files Browse the repository at this point in the history
Use a Gradle 8.4 `dependencyScope` [1] to extend the `runtimeClasspath`
with the `pluginClasspath`. This improves the solution from 1708ac3 by
supporting to run ORT from Gradle or the IDE with platform projects /
plugins in the classpath, but still do not publish them as part of the
"dependencyManagement" in the POM. See [2] for context.

[1]: https://docs.gradle.org/8.4/release-notes.html#easier-to-create-role-focused-configurations
[2]: gradle/gradle#10861 (comment)

Signed-off-by: Sebastian Schuberth <[email protected]>
sschuberth committed Oct 25, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 1367f39 commit 52e90c1
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions cli/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -22,19 +22,12 @@ plugins {
id("ort-application-conventions")
}

configurations {
create("pluginClasspath")
}
configurations.dependencyScope("pluginClasspath")
configurations["runtimeClasspath"].extendsFrom(configurations["pluginClasspath"])

application {
applicationName = "ort"
mainClass = "org.ossreviewtoolkit.cli.OrtMainKt"

applicationDistribution.from(configurations["pluginClasspath"]) {
// Copy to "lib" instead of "plugin" to avoid duplicate dependency artifacts for core plugins.
into("lib")
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
}

dependencies {

0 comments on commit 52e90c1

Please sign in to comment.