plugins {
    id 'org.springframework.boot' version '2.7.0'
    id 'io.spring.dependency-management' version '1.0.11.RELEASE'
    id 'java'
}

ext {
    jimmerVersion = "0.9.111"
}

group 'org.babyfish.jimmer.example.kt'
version jimmerVersion

repositories {
    mavenCentral()
}

dependencies {

    implementation "org.babyfish.jimmer:jimmer-spring-boot-starter:${jimmerVersion}"
    annotationProcessor "org.babyfish.jimmer:jimmer-apt:${jimmerVersion}"

    implementation "org.springframework.boot:spring-boot-starter-web"

    /*
     * Optional runtime dependency: jimmer-client-swagger.
     *
     * Generally speaking, even if you remove the dependency,
     * the functionality is normal, that why it is optional.
     *
     * Without this dependency, the `/openapi.html` uses external links:
     *     'https://unpkg.com/swagger-ui-dist@${version}/swagger-ui.css' and
     *     'https://unpkg.com/swagger-ui-dist@${version}/swagger-ui-bundle.js'.
     *
     * However, You may be in a restricted network environment so that
     * such external links are not accessible. If you are in trouble with this,
     * please add this runtime dependency to use the embedded css and js.
     */
    runtimeOnly "org.babyfish.jimmer:jimmer-client-swagger:${jimmerVersion}"

    implementation 'org.springframework.boot:spring-boot-starter-web'

    runtimeOnly 'com.h2database:h2:2.1.212'

    testImplementation "org.springframework.boot:spring-boot-starter-test"
}

java {
    sourceCompatibility = JavaVersion.VERSION_1_8
    targetCompatibility = JavaVersion.VERSION_1_8
}

tasks.named('test') {
    useJUnitPlatform()
}
