All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.archguard.dsl.FatDslContext.kt Maven / Gradle / Ivy

Go to download

ArchGuard is a architecture governance tool which can analysis architecture in container, component, code level, create architecture fitness functions, and anaysis system dependencies..

There is a newer version: 2.1.5
Show newest version
package org.archguard.dsl

import org.archguard.dsl.action.ReactiveActionDecl
import org.archguard.dsl.design.LayeredArchDsl
import org.archguard.dsl.evolution.ReposDecl
import org.archguard.dsl.evolution.ScanModelDecl
import org.archguard.dsl.evolution.WebApiDecl
import org.archguard.dsl.insight.InsightDecl

class FatDslContext(
    var layered: LayeredArchDsl = LayeredArchDsl(),
    var repos: ReposDecl = ReposDecl(),
    var webapi: WebApiDecl = WebApiDecl(),
    var scan: ScanModelDecl? = null,
    var insight: InsightDecl? = null
) {

}

// todo: find a better way
val context = FatDslContext()

fun layered(init: LayeredArchDsl.() -> Unit): LayeredArchDsl {
    val layeredDecl = LayeredArchDsl()
    layeredDecl.init()
    context.layered = layeredDecl
    return layeredDecl
}

fun diagram(): ReactiveActionDecl {
    return ReactiveActionDecl()
}

fun repos(init: ReposDecl.() -> Unit): ReposDecl {
    val reposDecl = ReposDecl()
    reposDecl.init()
    context.repos = reposDecl
    return reposDecl
}

fun api(name: String, init: WebApiDecl.() -> Unit): WebApiDecl {
    val webApiDecl = WebApiDecl()
    webApiDecl.init()
    context.webapi = webApiDecl
    return webApiDecl
}

fun scan(name: String, init: ScanModelDecl.() -> Unit = {}): ScanModelDecl {
    val scanDecl = ScanModelDecl(name)
    scanDecl.init()
    context.scan = scanDecl
    return scanDecl
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy