plugins {
    id 'org.springframework.boot' version "${spring_boot_version}"
    id 'io.spring.dependency-management' version "${spring_dependency_management_version}"
    id 'com.google.cloud.tools.jib' version "${jib_version}"
    id 'java'
}

group = 'com.example'
sourceCompatibility = '11'

configurations {
    compileOnly {
        extendsFrom annotationProcessor
    }
}

repositories {
    mavenCentral()
}

jib {
    to {
        image = "example.com/${project.name}:${project.version}"
    }
}

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
    implementation 'org.springframework.boot:spring-boot-starter-web'
    implementation 'org.springframework.kafka:spring-kafka'

    implementation "com.eventstore:db-client-java:${eventstoredb_client_version}"
    implementation "io.grpc:grpc-api:${grpc_api_version}"
    implementation "org.postgresql:postgresql:${postgresql_version}"
    implementation "org.mapstruct:mapstruct:${mapstruct_version}"

    compileOnly 'org.projectlombok:lombok'
    annotationProcessor "org.projectlombok:lombok-mapstruct-binding:${lombok_mapstruct_binding_version}"
    annotationProcessor "org.mapstruct:mapstruct-processor:${mapstruct_version}"
    annotationProcessor 'org.projectlombok:lombok'

    testImplementation 'org.springframework.boot:spring-boot-starter-test'
    testImplementation 'org.springframework.kafka:spring-kafka-test'
    testRuntimeOnly 'com.h2database:h2'
}

test {
    useJUnitPlatform()
}
