diff --git a/analyzer/src/funTest/kotlin/PackageManagerFunTest.kt b/analyzer/src/funTest/kotlin/PackageManagerFunTest.kt index 65bf665b13011..2ce1d014f77f7 100644 --- a/analyzer/src/funTest/kotlin/PackageManagerFunTest.kt +++ b/analyzer/src/funTest/kotlin/PackageManagerFunTest.kt @@ -103,7 +103,7 @@ class PackageManagerFunTest : WordSpec({ "conan-txt/conanfile.txt" ) managedFilesByName["GoMod"] should containExactly("gomod/go.mod") - managedFilesByName["Gradle"] should containExactlyInAnyOrder( + managedFilesByName["GradleInspector"] should containExactlyInAnyOrder( "gradle-groovy/build.gradle", "gradle-kotlin/build.gradle.kts" ) @@ -139,7 +139,7 @@ class PackageManagerFunTest : WordSpec({ val managedFiles = PackageManager.findManagedFiles( projectDir, setOf( - PackageManagerFactory.ALL.getValue("Gradle"), + PackageManagerFactory.ALL.getValue("GradleInspector"), PackageManagerFactory.ALL.getValue("Pip"), PackageManagerFactory.ALL.getValue("Sbt") ) @@ -149,7 +149,7 @@ class PackageManagerFunTest : WordSpec({ val managedFilesByName = managedFiles.groupByName(projectDir) - managedFilesByName["Gradle"] should containExactlyInAnyOrder( + managedFilesByName["GradleInspector"] should containExactlyInAnyOrder( "gradle-groovy/build.gradle", "gradle-kotlin/build.gradle.kts" ) @@ -178,7 +178,7 @@ class PackageManagerFunTest : WordSpec({ val managedFilesByName = PackageManager.findManagedFiles(rootDir, excludes = excludes).groupByName(rootDir) - managedFilesByName["Gradle"] should containExactlyInAnyOrder( + managedFilesByName["GradleInspector"] should containExactlyInAnyOrder( "gradle-groovy/build.gradle", "gradle-kotlin/build.gradle.kts" ) @@ -193,7 +193,7 @@ class PackageManagerFunTest : WordSpec({ val managedFiles = PackageManager.findManagedFiles(projectDir, excludes = excludes) val managedFilesByName = managedFiles.groupByName(projectDir) - managedFilesByName["Gradle"] should containExactly( + managedFilesByName["GradleInspector"] should containExactly( "gradle-kotlin/build.gradle.kts" ) } diff --git a/plugins/package-managers/gradle-inspector/README.md b/plugins/package-managers/gradle-inspector/README.md index 904406e2d756f..29c252ed36441 100644 --- a/plugins/package-managers/gradle-inspector/README.md +++ b/plugins/package-managers/gradle-inspector/README.md @@ -1,17 +1,10 @@ # GradleInspector -The [GradleInspector] is an alternative analyzer for projects that use the Gradle package manager. -It is supposed to address [several] [shortcomings] of the "legacy" [Gradle] analyzer, but to not interfere with it, the [GradleInspector] is disabled by default. +The [GradleInspector] is the new analyzer for projects that use the Gradle package manager. +It is supposed to address [several] [shortcomings] of the "legacy" [Gradle] analyzer, which is disabled by default now. -## Usage - -As the [GradleInspector] is disabled by default, it needs to be enabled explicitly (along with any other package managers that should be enabled): - -```shell -ort -P ort.analyzer.enabledPackageManagers=GradleInspector[,...] analyze -``` - -It is recommended to *not* also enable the "legacy" [Gradle] analyzer at the same time, as both analyzers would find the same definition files. +> [!NOTE] +> It is *not* recommended to also enable the "legacy" [Gradle] analyzer at the same time, as both analyzers would find the same definition files. ## Implementation diff --git a/plugins/package-managers/gradle-inspector/src/main/kotlin/GradleInspector.kt b/plugins/package-managers/gradle-inspector/src/main/kotlin/GradleInspector.kt index 51704f6620ce4..642b31cac9534 100644 --- a/plugins/package-managers/gradle-inspector/src/main/kotlin/GradleInspector.kt +++ b/plugins/package-managers/gradle-inspector/src/main/kotlin/GradleInspector.kt @@ -104,7 +104,7 @@ class GradleInspector( analyzerConfig: AnalyzerConfiguration, repoConfig: RepositoryConfiguration ) : PackageManager(name, analysisRoot, analyzerConfig, repoConfig) { - class Factory : AbstractPackageManagerFactory("GradleInspector", isEnabledByDefault = false) { + class Factory : AbstractPackageManagerFactory("GradleInspector") { // Gradle prefers Groovy ".gradle" files over Kotlin ".gradle.kts" files, but "build" files have to come before // "settings" files as we should consider "settings" files only if the same directory does not also contain a // "build" file. diff --git a/plugins/package-managers/gradle/src/main/kotlin/Gradle.kt b/plugins/package-managers/gradle/src/main/kotlin/Gradle.kt index 194c62f280e15..d671d4cd851f5 100644 --- a/plugins/package-managers/gradle/src/main/kotlin/Gradle.kt +++ b/plugins/package-managers/gradle/src/main/kotlin/Gradle.kt @@ -93,7 +93,7 @@ class Gradle( const val OPTION_GRADLE_VERSION = "gradleVersion" } - class Factory : AbstractPackageManagerFactory("Gradle") { + class Factory : AbstractPackageManagerFactory("Gradle", isEnabledByDefault = false) { // Gradle prefers Groovy ".gradle" files over Kotlin ".gradle.kts" files, but "build" files have to come before // "settings" files as we should consider "settings" files only if the same directory does not also contain a // "build" file. diff --git a/plugins/package-managers/pub/src/main/kotlin/Pub.kt b/plugins/package-managers/pub/src/main/kotlin/Pub.kt index 78292c59451ee..34797a5871a90 100644 --- a/plugins/package-managers/pub/src/main/kotlin/Pub.kt +++ b/plugins/package-managers/pub/src/main/kotlin/Pub.kt @@ -134,7 +134,7 @@ class Pub( private val flutterAbsolutePath = flutterHome.resolve("bin") - private val gradleFactory = PackageManagerFactory.ALL["Gradle"] + private val gradleFactory = PackageManagerFactory.ALL["GradleInspector"] private data class ParsePackagesResult( val packages: Map,