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

group 'com.giorgimode.spotmystatus'
version '0.0.1'

repositories {
    mavenCentral()
}

version = "${baseVersion}"
sourceCompatibility = '11'

configurations {
    compileOnly {
        extendsFrom annotationProcessor
    }
}

repositories {
    mavenCentral()
}


test {
    environment "artifact.version", "$version"
    useJUnitPlatform()
}

dependencies {
    implementation(
            'org.springframework.boot:spring-boot-starter-validation',
            'org.springframework.boot:spring-boot-starter-validation',
            'org.springframework.boot:spring-boot-starter-data-jpa',
            'org.springframework.boot:spring-boot-starter-cache',
            'com.github.ben-manes.caffeine:caffeine:2.8.5',
            'org.liquibase:liquibase-core',
            'org.postgresql:postgresql',
            'com.google.guava:guava:29.0-jre',
            'org.springframework.boot:spring-boot-starter-actuator',
            'org.springframework.boot:spring-boot-starter-web',
            'org.apache.commons:commons-lang3:3.11',
            'org.springframework.boot:spring-boot-starter-actuator',
            'org.springframework.boot:spring-boot-starter-security',
            'org.springframework.boot:spring-boot-starter-oauth2-client',
            'org.springframework.boot:spring-boot-starter-thymeleaf',
    )

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

    testCompile 'org.junit.jupiter:junit-jupiter:5.7.0'
    testImplementation 'com.h2database:h2'
    testImplementation 'org.mockito:mockito-junit-jupiter:3.5.15'
    testImplementation('org.springframework.boot:spring-boot-starter-test') {
        exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
        exclude group: 'junit', module: 'junit'
    }
}

task copyTask(type: Copy) {
    from '../frontend/.'
    into 'build/resources/main/static'
}

bootJar {
    dependsOn copyTask
}
project.archivesBaseName = 'spotmystatus'