fix(detector): Fixing fallback rules for NPM, NuGet, Gemlock, Git, Swift, Xcode
@@ -77,17 +77,19 @@ public class DetectorRuleFactory {
rules.addDetector(DetectorType.XCODE, detector -> {
detector.entryPoint(XcodeProjectDetectable.class);
detector.entryPoint(XcodeWorkspaceDetectable.class);
- }).notSelfNestable();
+ }).allEntryPointsFallbackToNext()
+ .notSelfNestable();
rules.addDetector(DetectorType.SWIFT, detector -> {
detector.entryPoint(SwiftPackageResolvedDetectable.class);
detector.entryPoint(SwiftCliDetectable.class);
- }).nestableExceptTo(DetectorType.XCODE);
+ }).allEntryPointsFallbackToNext()
+ .nestableExceptTo(DetectorType.XCODE);
rules.addDetector(DetectorType.CONAN, detector -> {
detector.entryPoint(ConanLockfileDetectable.class);
detector.entryPoint(ConanCliDetectable.class);
- });
+ }).allEntryPointsFallbackToNext();
rules.addDetector(DetectorType.CONDA, detector -> {
detector.entryPoint(CondaCliDetectable.class);
@@ -162,7 +164,8 @@ public class DetectorRuleFactory {
detector.entryPoint(NpmPackageLockDetectable.class);
detector.entryPoint(NpmShrinkwrapDetectable.class);
detector.entryPoint(NpmCliDetectable.class);
- }).yieldsTo(DetectorType.LERNA, DetectorType.YARN, DetectorType.PNPM);
+ }).allEntryPointsFallbackToNext()
+ .yieldsTo(DetectorType.LERNA, DetectorType.YARN, DetectorType.PNPM);
rules.addDetector(DetectorType.PNPM, detector -> {
detector.entryPoint(PnpmLockDetectable.class)
@@ -170,9 +173,11 @@ public class DetectorRuleFactory {
}).yieldsTo(DetectorType.LERNA);
rules.addDetector(DetectorType.NUGET, detector -> {
- detector.entryPoint(NugetSolutionDetectable.class);
- detector.entryPoint(NugetProjectDetectable.class);
- detector.entryPoint(NugetProjectInspectorDetectable.class);
+ detector.entryPoint(NugetSolutionDetectable.class)
+ .fallback(NugetProjectInspectorDetectable.class);
+
+ detector.entryPoint(NugetProjectDetectable.class)
+ .fallback(NugetProjectInspectorDetectable.class);
});
rules.addDetector(DetectorType.POETRY, detector -> {
@@ -188,12 +193,12 @@ public class DetectorRuleFactory {
rules.addDetector(DetectorType.RUBYGEMS, detector -> {
detector.entryPoint(GemlockDetectable.class);
detector.entryPoint(GemspecParseDetectable.class);
- });
+ }).allEntryPointsFallbackToNext();
rules.addDetector(DetectorType.GIT, detector -> {
detector.entryPoint(GitDetectable.class);
detector.entryPoint(GitParseDetectable.class); //TODO: Is this necessary?
- });
+ }).allEntryPointsFallbackToNext();
rules.addDetector(DetectorType.SBT, detector -> {
detector.entryPoint(SbtDetectable.class);
