-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add option to show like FG, prevent space in mappings search, add JEI…
… and Cloth Config
- Loading branch information
Showing
10 changed files
with
174 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
backend/src/main/kotlin/me/shedaniel/linkie/web/deps/CombinedDeps.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package me.shedaniel.linkie.web.deps | ||
|
||
import kotlinx.coroutines.coroutineScope | ||
import kotlinx.coroutines.joinAll | ||
import kotlinx.coroutines.launch | ||
import me.shedaniel.linkie.utils.info | ||
|
||
class CombinedDeps( | ||
name: String, | ||
vararg val deps: Deps, | ||
) : Deps(name) { | ||
override suspend fun provideData(): Map<VersionIdentifier, Data> = coroutineScope { | ||
data class Inner( | ||
val mavens: MutableSet<MavenData> = mutableSetOf(), | ||
val dependencies: MutableList<Dependency> = mutableListOf(), | ||
) | ||
|
||
val datas = mutableMapOf<VersionIdentifier, Inner>() | ||
deps.map { | ||
launch { | ||
try { | ||
info("Started dep cycle: ${it.name}") | ||
it.provideData().also { data -> | ||
data.forEach { (versionId, d) -> | ||
val inner = datas.getOrPut(versionId, ::Inner) | ||
inner.mavens.addAll(d.mavens) | ||
inner.dependencies.addAll(d.dependencies) | ||
} | ||
info("Completed dep cycle: ${it.name}") | ||
} | ||
} catch (e: Exception) { | ||
e.printStackTrace() | ||
} | ||
} | ||
}.joinAll() | ||
return@coroutineScope datas.mapValues { (_, inner) -> | ||
Data( | ||
mavens = inner.mavens.toList(), | ||
dependencies = inner.dependencies | ||
) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.