plugins {
    id "org.springframework.boot" version "3.0.1" apply true
    id "io.spring.dependency-management" version "1.1.0"
    id 'java'
}

ext {
    set('springCloudVersion', "2022.0.0")
}

group = 'edu.vandy.pubsub'
version = '0.0.1-SNAPSHOT'

configurations {
    compileOnly {
        extendsFrom annotationProcessor
    }
}

repositories {
    mavenCentral()
}

dependencies {
    implementation("org.springframework.boot:spring-boot-starter-web")
    implementation 'org.springframework.boot:spring-boot-starter-webflux'
    implementation 'org.springframework:spring-jdbc:5.3.14'
    implementation 'com.squareup.retrofit2:retrofit:2.9.0'
    implementation 'com.jakewharton.retrofit:retrofit2-reactor-adapter:2.1.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
    implementation 'org.springframework.boot:spring-boot-starter-validation'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'
    testImplementation 'io.projectreactor:reactor-test'
}

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'
}

test {
    useJUnitPlatform()
}
