Skip to content

Commit

Permalink
refactor(bazel): Use a shorter name for the graph data model
Browse files Browse the repository at this point in the history
Signed-off-by: Frank Viernau <frank_viernau@epam.com>
  • Loading branch information
fviernau committed Jul 1, 2024
1 parent 8ea4205 commit 9318b6d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions plugins/package-managers/bazel/src/main/kotlin/Bazel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ class Bazel(
"mod", "graph", "--output", "json", "--disk_cache=", workingDir = projectDir
)

val node = JSON.decodeFromString<ModuleGraphNode>(modGraphProcess.stdout)
val node = JSON.decodeFromString<BazelModule>(modGraphProcess.stdout)
val devDeps = node.dependencies.filter { depDirectives[it.key]?.devDependency == true }.toSet()
val mainDeps = node.dependencies.toSet() - devDeps

Expand All @@ -189,7 +189,7 @@ class Bazel(
)
}

private fun parseModuleGraphNode(node: ModuleGraphNode): PackageReference =
private fun parseModuleGraphNode(node: BazelModule): PackageReference =
PackageReference(
id = Identifier(
type = managerName,
Expand Down
4 changes: 2 additions & 2 deletions plugins/package-managers/bazel/src/main/kotlin/BazelModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ internal fun parseLockfile(lockfile: File): Lockfile = json.decodeFromString<Loc
* The data model for the output of "bazel mod graph --output json".
*/
@Serializable
internal data class ModuleGraphNode(
internal data class BazelModule(
val key: String,
val name: String? = null,
val version: String? = null,
val dependencies: List<ModuleGraphNode> = emptyList()
val dependencies: List<BazelModule> = emptyList()
)

0 comments on commit 9318b6d

Please sign in to comment.