/*
 * This file was generated by the Gradle 'init' task.
 */

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

configurations {
    compileOnly {
        extendsFrom annotationProcessor
    }
}

repositories {
    mavenCentral()
}

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-webflux'
    implementation 'org.springframework.boot:spring-boot-starter-web'
    implementation 'org.springframework.security:spring-security-rsocket'
    implementation 'org.springframework.security:spring-security-messaging'
    implementation 'org.springframework.boot:spring-boot-starter-security'
    implementation 'org.junit.jupiter:junit-jupiter'
    implementation 'org.springframework.boot:spring-boot-starter-validation'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'
    implementation 'org.springframework.boot:spring-boot-starter-rsocket'
    compileOnly 'org.projectlombok:lombok:1.18.20'
    annotationProcessor 'org.projectlombok:lombok:1.18.20'
    testImplementation 'io.projectreactor:reactor-test:3.4.8'
}

group = 'zippyisms'
version = '1.1.0'
description = 'ex1'

tasks.withType(JavaCompile) {
    options.encoding = 'UTF-8'
}

test {
    useJUnitPlatform()
}

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

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

dependencyManagement {
    imports {
        mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
    }
}
