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

group = 'hello.world'
version = '1.0.0'
sourceCompatibility = '17'
compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = 'UTF-8'

repositories {
    mavenCentral()
}

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

    // https://mvnrepository.com/artifact/org.springframework.data/spring-data-rest-core
    implementation group: 'org.springframework.data', name: 'spring-data-rest-core', version: '3.7.0'

    // https://mvnrepository.com/artifact/org.springframework.data/spring-data-rest-webmvc
    implementation group: 'org.springframework.data', name: 'spring-data-rest-webmvc', version: '3.7.0'

    // https://mvnrepository.com/artifact/com.h2database/h2
    implementation group: 'com.h2database', name: 'h2', version: '1.3.148'

    // https://mvnrepository.com/artifact/org.postgresql/postgresql
    implementation group: 'org.postgresql', name: 'postgresql', version: '42.4.0'

    // okhttp
    implementation("com.squareup.okhttp3:okhttp:4.10.0")

    // lombok
    compileOnly 'org.projectlombok:lombok:1.18.24'
    annotationProcessor 'org.projectlombok:lombok:1.18.24'

    implementation 'io.github.cdimascio:dotenv-java:2.2.4'

    testCompileOnly 'org.projectlombok:lombok:1.18.24'
    testAnnotationProcessor 'org.projectlombok:lombok:1.18.24'

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

sourceSets {
    main {
        java {
            srcDir 'server/src/main/'
        }
        resources {
            srcDir 'server/src/resources'
        }
    }
    test {
        java {
            srcDir 'server/src/test/java'
        }
        resources {
            srcDir 'server/src/test/resources'
        }
    }
}

processResources {
    duplicatesStrategy = DuplicatesStrategy.INCLUDE
}

test {
    defaultCharacterEncoding = 'UTF-8'
    useJUnitPlatform()
}
