Skip to content

archguard/archguard-gradle-plugin

Repository files navigation

ArchGuard Gradle Scanner plugin

Pre Merge Checks Gradle Plugin Portal

Gradle Kotlin sample:

plugins {
    id("org.archguard.scanner") version "$version"
}

archguard {
    serverUrl = "http://localhost:8088"
    language = "java"
    path += "../"
    output = listOf("json")
    systemId = "0"
    // support for multiple scan
    type = listOf("source_code", "sca")
    features = listOf("apicalls", "datamap")

    slots {
        create("slot") {
            identifier = "rule"
            host = "https://github.com/archguard/archguard/releases/download/v2.0.0-beta.5"
            version = "2.0.0-beta.5"
            jar = "rule-webapi-2.0.0-beta.5-all.jar"
            className = "org.archguard.linter.rule.webapi.WebApiRuleSlot"
        }
    }
}

Composite Build 📦

This template is using a Gradle composite build to build, test and publish the plugin. This means that you don't need to run Gradle twice to test the changes on your Gradle plugin (no more publishToMavenLocal tricks or so).

The included build is inside the plugin-build folder.

preMerge task

A preMerge task on the top level build is already provided in the template. This allows you to run all the check tasks both in the top level and in the included build.

You can easily invoke it with:

./gradlew preMerge

If you need to invoke a task inside the included build with:

./gradlew -p plugin-build <task-name>

Dependency substitution

Please note that the project relies on module name/group in order for dependency substitution to work properly. If you change only the plugin ID everything will work as expected. If you change module name/group, things might break and you probably have to specify a substitution rule.

Publishing 🚀

This template is ready to let you publish to Gradle Portal.

The Publish Plugin to Portal Github Action will take care of the publishing whenever you push a tag.

Please note that you need to configure two secrets: GRADLE_PUBLISH_KEY and GRADLE_PUBLISH_SECRET with the credetials you can get from your profile on the Gradle Portal.

100% Kotlin 🅺

This template is designed to use Kotlin everywhere. The build files are written using Gradle Kotlin DSL as well as the Plugin DSL to setup the build.

Dependencies are centralized inside the libs.versions.toml.

Moreover, a minimalistic Gradle Plugin is already provided in Kotlin to let you easily start developing your own around it.

Static Analysis 🔍

This template is using ktlint with the ktlint-gradle plugin to format your code. To reformat all the source code as well as the buildscript you can run the ktlintFormat gradle task.

This template is also using detekt to analyze the source code, with the configuration that is stored in the detekt.yml file (the file has been generated with the detektGenerateConfig task).

CI ⚙️

This template is using GitHub Actions as CI. You don't need to setup any external service and you should have a running CI once you start using this template.

There are currently the following workflows available:

Contributing 🤝

Feel free to open a issue or submit a pull request for any bugs/improvements.

License 📄

This template is licensed under the MIT License - see the License file for details. Please note that the generated template is offering to start with a MIT license but you can change it to whatever you wish, as long as you attribute under the MIT terms that you're using the template.

About

The Gradle plugin of Archguard scanner

Resources

License

Stars

Watchers

Forks

Packages

No packages published