From 8420be154e33b0189cf80c37e0962e9f3f90fa41 Mon Sep 17 00:00:00 2001 From: Klaus Lehner <172195+klu2@users.noreply.github.com> Date: Tue, 5 Jul 2022 07:24:41 +0200 Subject: [PATCH 1/3] add method addWithCustomTags --- .../structurizr/kotlin/StructurizrExtension.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/kotlin/io/cloudflight/architecture/structurizr/kotlin/StructurizrExtension.kt b/src/main/kotlin/io/cloudflight/architecture/structurizr/kotlin/StructurizrExtension.kt index 233e3dd..310d3e7 100644 --- a/src/main/kotlin/io/cloudflight/architecture/structurizr/kotlin/StructurizrExtension.kt +++ b/src/main/kotlin/io/cloudflight/architecture/structurizr/kotlin/StructurizrExtension.kt @@ -135,3 +135,11 @@ class ElementConfiguration { } data class Dependency(val element: Element, val description: String, val technology: String, val interactionStyle: InteractionStyle? = null) + +/** + * Adds the given [container] to this [DeploymentNode] and also adds all tags which are not part of [Container.getDefaultTags] + */ +fun DeploymentNode.addWithCustomTags(container: Container) { + this.add(container) + this.addTags(*container.tagsAsSet.subtract(container.defaultTags).toTypedArray()) +} \ No newline at end of file From 87290738153667861a275692ba2d9249fe3625cc Mon Sep 17 00:00:00 2001 From: Klaus Lehner <172195+klu2@users.noreply.github.com> Date: Tue, 5 Jul 2022 07:31:59 +0200 Subject: [PATCH 2/3] add tags to the ContainerInstance --- .../architecture/structurizr/kotlin/StructurizrExtension.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/io/cloudflight/architecture/structurizr/kotlin/StructurizrExtension.kt b/src/main/kotlin/io/cloudflight/architecture/structurizr/kotlin/StructurizrExtension.kt index 310d3e7..a5cc16f 100644 --- a/src/main/kotlin/io/cloudflight/architecture/structurizr/kotlin/StructurizrExtension.kt +++ b/src/main/kotlin/io/cloudflight/architecture/structurizr/kotlin/StructurizrExtension.kt @@ -140,6 +140,7 @@ data class Dependency(val element: Element, val description: String, val technol * Adds the given [container] to this [DeploymentNode] and also adds all tags which are not part of [Container.getDefaultTags] */ fun DeploymentNode.addWithCustomTags(container: Container) { - this.add(container) - this.addTags(*container.tagsAsSet.subtract(container.defaultTags).toTypedArray()) + this.add(container).apply { + addTags(*container.tagsAsSet.subtract(container.defaultTags).toTypedArray()) + } } \ No newline at end of file From f1e0d4d88f7eaff80b99a1e7407e8c4ffcd4d7eb Mon Sep 17 00:00:00 2001 From: Klaus Lehner <172195+klu2@users.noreply.github.com> Date: Tue, 5 Jul 2022 08:50:42 +0200 Subject: [PATCH 3/3] update version --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b74fd86..f32b366 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ repositories { } dependencies { - implementation("io.cloudflight.structurizr:structurizr-autoconfigure:1.0.0") + implementation("io.cloudflight.structurizr:structurizr-autoconfigure:1.0.1") } ````