autonomouslogic/dynamo-mapper

View on GitHub
build.gradle

Summary

Maintainability
Test Coverage
plugins {
    id "java"
    id "groovy"
    id "idea"
    id "org.danilopianini.git-sensitive-semantic-versioning-gradle-plugin" version "3.1.7"
    id "io.freefair.lombok" version "8.6"
    id "jacoco"
    id "maven-publish"
    id "signing"
    id "io.github.gradle-nexus.publish-plugin" version "1.3.0"
    id "com.diffplug.spotless" version "6.25.0"
}

group "com.autonomouslogic.dynamomapper"

sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11

repositories {
    mavenCentral()
}

dependencies {
    implementation "software.amazon.awssdk:dynamodb:2.25.65"
    implementation "com.fasterxml.jackson.core:jackson-databind:2.17.1"

    testImplementation "org.junit.jupiter:junit-jupiter-api:5.10.2"
    testImplementation "org.junit.jupiter:junit-jupiter-params:5.10.2"
    testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.10.2"
    testImplementation "org.mockito:mockito-core:5.12.0"

    testImplementation "commons-codec:commons-codec:1.17.0"
    testImplementation "software.amazon.awssdk:sts:2.25.65"
    testImplementation "com.amazonaws:aws-java-sdk-sts:1.12.735"
    testImplementation "software.amazon.awssdk:dynamodb-enhanced:2.25.65"
    testImplementation "com.amazonaws:aws-java-sdk-dynamodb:1.12.735"
    testImplementation "org.apache.commons:commons-math3:3.6.1"
    testImplementation "com.autonomouslogic.jacksonobjectstream:jackson-object-stream:0.2.21"
    testImplementation "org.apache.commons:commons-lang3:3.14.0"
}

task codegen(type: com.autonomouslogic.dynamomapper.codegen.Codegen) {
    group "build"
}

sourceSets {
    integrationTest {
        java.srcDir "src/integrationTest/java"
        resources.srcDir "src/integrationTest/resources"
        compileClasspath += main.output + test.output
        runtimeClasspath += main.output + test.output
    }
}

configurations {
    integrationTestImplementation.extendsFrom testImplementation
    integrationTestRuntimeOnly.extendsFrom testRuntimeOnly
}

processIntegrationTestResources {
    duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}

test {
    useJUnitPlatform()

    testLogging {
        events = [ "FAILED", "PASSED", "SKIPPED" ]
        showExceptions = true
        exceptionFormat = "FULL"
        showExceptions = true
        showCauses = true
        showStackTraces = true
    }

    dependsOn codegen
}

task integrationTest(type: Test, description: "Runs the integration tests", group: "verification") {
    testClassesDirs = sourceSets.integrationTest.output.classesDirs
    classpath = sourceSets.integrationTest.runtimeClasspath

    useJUnitPlatform()

    testLogging {
        events = [ "FAILED", "PASSED", "SKIPPED" ]
        showExceptions = true
        exceptionFormat = "FULL"
        showExceptions = true
        showCauses = true
        showStackTraces = true
    }

    dependsOn codegen
}

jacocoTestReport {
    executionData(test, integrationTest)
    reports {
        xml.required = true
        html.required = true
    }
}

java {
    withJavadocJar()
    withSourcesJar()
}

publishing {
    publications {
        mavenJava(MavenPublication) {
            pom {
                name = "Dynamo Mapper"
                description = "An object mapper for AWS DynamoDB using Jackson."
                url = "https://github.com/autonomouslogic/dynamo-mapper"
                licenses {
                    license {
                        name = "MIT-0"
                        url = "https://spdx.org/licenses/MIT-0.html"
                    }
                }
                developers {
                    developer {
                        id = "kennethjor"
                        name = "Kenneth Jørgensen"
                        email = "kenneth@autonomouslogic.com"
                    }
                }
                scm {
                    connection = "scm:git:git://github.com:autonomouslogic/dynamo-mapper.git"
                    developerConnection = "scm:git:ssh://github.com:autonomouslogic/sedynamo-mapper.git"
                    url = "https://github.com/autonomouslogic/dynamo-mapper"
                }
            }
            from(components.java)
        }
    }
}

signing {
    sign publishing.publications.mavenJava
}

nexusPublishing {
    repositories {
        sonatype()
    }
}

spotless {
    java {
        target "src/**/*.java", "buildSrc/**/*.java"
        palantirJavaFormat()
        indentWithTabs()
    }

    groovyGradle {
        indentWithTabs()
    }
}