build.gradle.kts

Fri, 30 Dec 2022 13:21:09 +0100

author
Mike Becker <universe@uap-core.de>
date
Fri, 30 Dec 2022 13:21:09 +0100
changeset 262
c357c4e69b9e
parent 258
564ae07a6def
child 272
edb6f12b334b
permissions
-rw-r--r--

make JSTL and postgres (optionally) runtime dependencies again

import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
    kotlin("jvm") version "1.7.21"
    war
}
group = "de.uapcore"
version = "1.0-SNAPSHOT"

repositories {
    mavenCentral()
}

tasks.withType<KotlinCompile>().configureEach {
    kotlinOptions.jvmTarget = "11"
}

tasks.jar {
    enabled = false
}

tasks.war {
    duplicatesStrategy = DuplicatesStrategy.WARN
    archiveFileName.set("lightpit.war")
    from("src/main/resources")
}

val libsAreProvided = true
kotlin {
    sourceSets {
        val main by getting {
            dependencies {
                arrayOf(
                    "jakarta.servlet.jsp.jstl:jakarta.servlet.jsp.jstl-api:3.0.0",
                    "org.glassfish.web:jakarta.servlet.jsp.jstl:3.0.1",
                    "org.postgresql:postgresql:42.5.1"
                ).forEach {
                    if (libsAreProvided) compileOnly(it) else implementation(it)
                }
                compileOnly("jakarta.servlet:jakarta.servlet-api:6.0.0")
                val flexmarkVersion = "0.64.0"
                implementation("com.vladsch.flexmark:flexmark:${flexmarkVersion}")
                implementation("com.vladsch.flexmark:flexmark-util-data:${flexmarkVersion}")
                implementation("com.vladsch.flexmark:flexmark-ext-tables:${flexmarkVersion}")
                implementation("com.vladsch.flexmark:flexmark-ext-gfm-strikethrough:${flexmarkVersion}")
                implementation("io.github.java-diff-utils:java-diff-utils:4.12")
            }
        }
    }
}

mercurial