private static Collection<ResourceFile> findModuleRootDirectoriesHelper(ResourceFile rootDir,
			Collection<ResourceFile> moduleRootDirs, int remainingDepth) {
		if (!rootDir.exists() || remainingDepth <= 0) {
			return moduleRootDirs;
		}

		ResourceFile[] subDirs = rootDir.listFiles(ResourceFile::isDirectory);
		if (subDirs == null) {
			throw new RuntimeException("Failed to read directory: " + rootDir);
		}

		for (ResourceFile subDir : subDirs) {
			if ("build".equals(subDir.getName())) {
				continue; // ignore all "build" directories
			}
			if (ModuleUtilities.isModuleDirectory(subDir)) {
				moduleRootDirs.add(subDir);
			}
			else {
				findModuleRootDirectoriesHelper(subDir, moduleRootDirs, remainingDepth - 1);
			}
		}
		return moduleRootDirs;
	}
Searches the given root directory for module root directories.  Adds any discovered module
root directories to the given collection.

@param rootDir The directory to start looking for module root directories in.
@param moduleRootDirs A collection to add discovered module root directories to.
@return The given collection with any discovered modules added.
Ghidra/Framework/Utility/src/main/java/utility/module/ModuleUtilities.java