apply plugin: 'spring-boot'

ext {
    logbackLoglevel = "DEBUG"
}

dependencies {
    compile "org.springframework.boot:spring-boot-devtools"
}

def profiles = 'dev'
if (project.hasProperty('no-liquibase')) {
    profiles += ',no-liquibase'
}

bootRun {
    args = []
}
<% if (!skipClient) { %>
war {
    webAppDirName = '<%= CLIENT_MAIN_SRC_DIR %>'
}

task gulpConstantDev(type: GulpTask) {
    args = ["ngconstant:dev", "--no-notification"]
}<% } %>

processResources {
    filesMatching('**/logback-spring.xml') {
        filter {
            it.replace('#logback.loglevel#', logbackLoglevel)
        }
    }
    <%_ if (applicationType === 'monolith') { _%>
    filesMatching('**/application.yml') {
    <%_ } _%>
    <%_ if (applicationType === 'microservice' || applicationType === 'gateway' || applicationType === 'uaa') { _%>
    filesMatching('**/bootstrap.yml') {
    <%_ } _%>
        filter {
            it.replace('#spring.profiles.active#', profiles)
        }
    }
}

<% if (!skipClient) { %>
processResources.dependsOn gulpConstantDev<% } %>
