buildscript {
    ext {
        springBootVersion = '2.5.3'
    }
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath "org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}"
        classpath "io.spring.gradle:dependency-management-plugin:1.0.4.RELEASE"
    }
}

subprojects {
    apply plugin: 'java'
    apply plugin: 'idea'
    apply plugin: 'org.springframework.boot'
    apply plugin: 'io.spring.dependency-management'

    group 'org.example'
    version '1.0-SNAPSHOT'

    sourceCompatibility = '1.8'
    targetCompatibility = '1.8'
    compileJava.options.encoding = 'UTF-8'

    repositories {
        mavenCentral()
    }

    dependencies {
        compileOnly 'org.projectlombok:lombok'
        implementation group: 'org.redisson', name: 'redisson-spring-boot-starter', version: '3.16.1'
        compileOnly "io.netty:netty-resolver-dns-native-macos:4.1.59.Final:osx-x86_64"


        annotationProcessor 'org.projectlombok:lombok'
        annotationProcessor "org.springframework.boot:spring-boot-configuration-processor"

        testImplementation group: 'org.springframework.boot', name: 'spring-boot-starter-test'
        testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0'
        testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.0'
    }

    test {
        useJUnitPlatform()
    }
}

project(':remote-interface') {
    bootJar.enabled = false
    jar.enabled = true

    dependencies {
    }
}

project(':web') {
    dependencies {
        compileOnly project(':remote-interface')
        implementation 'org.springframework.boot:spring-boot-starter-web'
    }
}

project(':remote-worker') {
    dependencies {
        compileOnly project(':remote-interface')
    }
}