plugins {
    id "org.springframework.boot" version "2.7.3"
    id "io.spring.dependency-management" version "1.0.13.RELEASE"
    id 'java'
}

version = '0.0.1-SNAPSHOT'

configurations {
    compileOnly {
        extendsFrom annotationProcessor
    }
}

repositories {
    mavenCentral()
}

compileJava {
    options.compilerArgs.addAll(
            ['--enable-preview',
             '--add-modules', 'jdk.incubator.concurrent'
            ])
}

tasks.withType(JavaCompile).configureEach {
    options.compilerArgs += ['--enable-preview',
                             '--add-modules', 'jdk.incubator.concurrent']
}

tasks.withType(Test).configureEach {
    jvmArgs += '--enable-preview'
    jvmArgs += '--add-modules'
    jvmArgs += 'jdk.incubator.concurrent'
}

tasks.withType(JavaExec).configureEach {
    jvmArgs += '--enable-preview'
}

dependencies {
    implementation 'org.apache.httpcomponents:httpcore:4.4.1'
    implementation 'org.apache.httpcomponents:httpclient:4.5.13'
    implementation 'org.springframework.boot:spring-boot-starter-web'
    implementation 'org.junit.jupiter:junit-jupiter'
    implementation 'org.springframework.boot:spring-boot-starter-validation'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'
}

test {
    useJUnitPlatform()
}
