Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor MavenImportListener in MavenUtils #49

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ import org.jetbrains.idea.maven.project.MavenProjectsManager
import org.jetbrains.packagesearch.api.v3.ApiPackage
import org.jetbrains.packagesearch.api.v3.ApiRepository
import org.jetbrains.packagesearch.api.v3.search.buildPackageTypes
import org.jetbrains.packagesearch.api.v3.search.javaApi
import org.jetbrains.packagesearch.api.v3.search.javaRuntime
import org.jetbrains.packagesearch.api.v3.search.jvmMavenPackages
import org.jetbrains.packagesearch.maven.POM_XML_NAMESPACE
import org.jetbrains.packagesearch.maven.ProjectObjectModel
Expand All @@ -63,10 +61,16 @@ val commonScopes = listOf("compile", "provided", "runtime", "test", "system", "i

val Project.mavenImportFlow
get() = messageBus.flow(MavenImportListener.TOPIC) {
MavenImportListener { _, _ ->
trySend(Unit)
object : MavenImportListener {
override fun importFinished(
importedProjects: MutableCollection<MavenProject>,
newModules: MutableList<Module>,
) {
trySend(Unit)
}
}
}

context(ProjectContext)
fun getModuleChangesFlow(pomPath: Path): Flow<Unit> = merge(
watchExternalFileChanges(mavenSettingsFilePath),
Expand Down
Loading