Skip to content

flamingock/flamingock-gradle-plugin

Repository files navigation

Flamingock Gradle Plugin

License Gradle Plugin Portal

Zero-boilerplate Flamingock configuration for Gradle projects.

This plugin simplifies Flamingock setup by automatically adding the required dependencies and annotation processors to your project.

Flamingock is a Change-as-Code platform for audited, synchronized evolution of distributed systems. Learn more at flamingock.io | Documentation | Main Project


Requirements

  • Gradle 7.4+
  • Java 8+

Installation

Add the plugin to your build.gradle.kts:

plugins {
    id("io.flamingock") version "1.0.0-beta.7"
}

flamingock {
    community()
}

Or in build.gradle (Groovy):

plugins {
    id 'io.flamingock' version '1.0.0-beta.7'
}

flamingock {
    community()
}

Configuration

flamingock {
    community()    // Required - enables Community edition
    mongock()      // Optional - Mongock migration support
    springboot()   // Optional - Spring Boot integration
    graalvm()      // Optional - GraalVM native image support
}

Configuration Options

Method Required Description
community() No Disables Flamingock cloud edition in favor of the community edition
springboot() No Adds Spring Boot integration and test support
graalvm() No Adds GraalVM native image support
mongock() No Adds support for migrating from Mongock

What Gets Added

The plugin automatically adds dependencies based on your configuration:

Always Added

annotationProcessor("io.flamingock:flamingock-processor:1.0.0-beta.7")

community()

implementation(platform("io.flamingock:flamingock-community-bom:1.0.0-beta.7"))
implementation("io.flamingock:flamingock-community")

mongock()

implementation("io.flamingock:mongock-support")
annotationProcessor("io.flamingock:mongock-support")

springboot()

implementation("io.flamingock:flamingock-springboot-integration")
testImplementation("io.flamingock:flamingock-springboot-test-support")

graalvm()

implementation("io.flamingock:flamingock-graalvm")

Example

A typical Spring Boot project with MongoDB:

plugins {
    java
    id("org.springframework.boot") version "3.2.0"
    id("io.spring.dependency-management") version "1.1.4"
    id("io.flamingock") version "1.0.0-beta.7"
}

flamingock {
    community()
    springboot()
}

dependencies {
    // Your MongoDB driver
    implementation("org.mongodb:mongodb-driver-sync:5.0.0")

    // Your Flamingock audit store (choose one)
    implementation("io.flamingock:flamingock-auditstore-mongodb-sync")
}

Then write your changes:

@Change(id = "user-events-v3")
public class _0001__RegisterUserEventSchema {
    @Apply
    public void apply(SchemaRegistryClient registry) {
        registry.register(
                "user-events",
                loadAvro("schemas/user-events-v3.avsc")
        );
    }
}

Links


License

Copyright 2024 Flamingock

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

About

Gradle plugin to configure Flamingock with zero boilerplate

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages