2020-07-12 23:23:16 +00:00
|
|
|
plugins {
|
2021-01-24 04:55:11 +00:00
|
|
|
id "jacoco"
|
2020-07-12 23:23:16 +00:00
|
|
|
id "java"
|
2021-01-24 04:55:11 +00:00
|
|
|
id "org.jetbrains.kotlin.jvm" version "1.4.20"
|
2020-08-22 16:08:09 +00:00
|
|
|
id "org.jetbrains.kotlin.kapt" version "1.4.0"
|
2020-07-12 23:23:16 +00:00
|
|
|
id "application"
|
|
|
|
id "com.github.johnrengelman.shadow" version "5.2.0"
|
2021-01-24 04:55:11 +00:00
|
|
|
id "com.diffplug.spotless" version "5.8.2"
|
2020-08-05 15:20:29 +00:00
|
|
|
id "dev.afanasev.sekret" version "0.0.7"
|
2020-07-12 23:23:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
group = "com.mangadex"
|
|
|
|
version = "git describe --tags --dirty".execute().text.trim()
|
2021-01-24 04:55:11 +00:00
|
|
|
mainClassName = "mdnet.Main"
|
2020-07-12 23:23:16 +00:00
|
|
|
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
jcenter()
|
|
|
|
}
|
|
|
|
|
|
|
|
configurations {
|
|
|
|
runtime.exclude group: "com.sun.mail", module: "javax.mail"
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2020-08-22 16:08:09 +00:00
|
|
|
compileOnly group: "dev.afanasev", name: "sekret-annotation", version: "0.0.7"
|
2020-07-12 23:23:16 +00:00
|
|
|
|
|
|
|
implementation group: "commons-io", name: "commons-io", version: "2.7"
|
2021-01-24 04:55:11 +00:00
|
|
|
implementation group: "org.apache.commons", name: "commons-compress", version: "1.20"
|
|
|
|
implementation group: "ch.qos.logback", name: "logback-classic", version: "1.3.0-alpha4"
|
|
|
|
|
|
|
|
implementation group: "io.micrometer", name: "micrometer-registry-prometheus", version: "1.6.2"
|
|
|
|
implementation group: "com.maxmind.geoip2", name: "geoip2", version: "2.15.0"
|
2020-07-12 23:23:16 +00:00
|
|
|
|
|
|
|
implementation group: "org.http4k", name: "http4k-core", version: "$http_4k_version"
|
|
|
|
implementation group: "org.http4k", name: "http4k-format-jackson", version: "$http_4k_version"
|
2021-01-24 04:55:11 +00:00
|
|
|
implementation group: "com.fasterxml.jackson.dataformat", name: "jackson-dataformat-yaml", version: "2.12.1"
|
|
|
|
implementation group: "com.fasterxml.jackson.datatype", name: "jackson-datatype-jsr310", version: "2.12.1"
|
2021-01-28 02:12:47 +00:00
|
|
|
implementation group: "org.http4k", name: "http4k-client-apache", version: "$http_4k_version"
|
2021-01-24 04:55:11 +00:00
|
|
|
implementation group: "org.http4k", name: "http4k-metrics-micrometer", version: "$http_4k_version"
|
2020-07-12 23:23:16 +00:00
|
|
|
implementation group: "org.http4k", name: "http4k-server-netty", version: "$http_4k_version"
|
2021-01-24 18:05:05 +00:00
|
|
|
implementation group: "io.netty", name: "netty-transport-native-epoll", version: "4.1.58.Final", classifier: "linux-x86_64"
|
|
|
|
implementation group: "io.netty.incubator", name: "netty-incubator-transport-native-io_uring", version: "0.0.3.Final", classifier: "linux-x86_64"
|
2021-01-24 04:55:11 +00:00
|
|
|
testImplementation group: "org.http4k", name: "http4k-testing-kotest", version: "$http_4k_version"
|
2020-08-22 16:08:09 +00:00
|
|
|
runtimeOnly group: "io.netty", name: "netty-tcnative-boringssl-static", version: "2.0.34.Final"
|
2020-07-12 23:23:16 +00:00
|
|
|
|
2021-01-24 04:55:11 +00:00
|
|
|
implementation group: "com.h2database", name: "h2", version: "1.4.200"
|
|
|
|
implementation "org.ktorm:ktorm-core:$ktorm_version"
|
|
|
|
implementation "org.ktorm:ktorm-jackson:$ktorm_version"
|
2020-07-12 23:23:16 +00:00
|
|
|
|
2020-08-11 19:12:01 +00:00
|
|
|
implementation "info.picocli:picocli:4.5.0"
|
|
|
|
kapt "info.picocli:picocli-codegen:4.5.0"
|
2021-01-24 04:55:11 +00:00
|
|
|
|
|
|
|
testImplementation "io.kotest:kotest-runner-junit5:$kotest_version"
|
|
|
|
testImplementation "io.kotest:kotest-assertions-core:$kotest_version"
|
|
|
|
testImplementation "io.mockk:mockk:1.10.4"
|
|
|
|
}
|
|
|
|
|
|
|
|
test {
|
|
|
|
useJUnitPlatform()
|
2020-08-11 19:12:01 +00:00
|
|
|
}
|
|
|
|
|
2021-01-24 04:55:11 +00:00
|
|
|
task testDev(type: Test) {
|
|
|
|
group = "verification"
|
|
|
|
useJUnitPlatform()
|
|
|
|
filter {
|
|
|
|
excludeTestsMatching '*SlowTest'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-08-11 19:12:01 +00:00
|
|
|
kapt {
|
|
|
|
arguments {
|
|
|
|
arg("project", "${project.group}/${project.name}")
|
|
|
|
}
|
2020-07-12 23:23:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
java {
|
|
|
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
|
|
|
targetCompatibility = JavaVersion.VERSION_1_8
|
|
|
|
}
|
|
|
|
|
2021-01-24 04:55:11 +00:00
|
|
|
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
|
|
|
|
kotlinOptions {
|
|
|
|
jvmTarget = "1.8"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-12 23:23:16 +00:00
|
|
|
spotless {
|
|
|
|
java {
|
|
|
|
targetExclude("build/generated/**/*")
|
|
|
|
eclipse()
|
|
|
|
removeUnusedImports()
|
|
|
|
trimTrailingWhitespace()
|
|
|
|
endWithNewline()
|
|
|
|
}
|
|
|
|
kotlin {
|
2021-01-25 02:25:49 +00:00
|
|
|
ktlint("0.40.0").userData(["disabled_rules": "no-wildcard-imports"])
|
|
|
|
licenseHeaderFile "license_header"
|
2020-07-12 23:23:16 +00:00
|
|
|
trimTrailingWhitespace()
|
|
|
|
endWithNewline()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.register("generateVersion", Copy) {
|
|
|
|
def templateContext = [version: version]
|
|
|
|
inputs.properties templateContext
|
|
|
|
from "src/template/java"
|
|
|
|
into "$buildDir/generated/java"
|
|
|
|
expand templateContext
|
|
|
|
}
|
|
|
|
|
|
|
|
sourceSets.main.java.srcDir generateVersion.outputs.files
|
2020-08-07 23:20:39 +00:00
|
|
|
|
|
|
|
tasks.register("depsize") {
|
|
|
|
description = 'Prints dependencies for "default" configuration'
|
|
|
|
doLast() {
|
|
|
|
listConfigurationDependencies(configurations.default)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-01-24 04:55:11 +00:00
|
|
|
tasks.register("depsizeAll") {
|
2020-08-07 23:20:39 +00:00
|
|
|
description = 'Prints dependencies for all available configurations'
|
|
|
|
doLast() {
|
|
|
|
configurations
|
|
|
|
.findAll { it.isCanBeResolved() }
|
|
|
|
.each { listConfigurationDependencies(it) }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
def listConfigurationDependencies(Configuration configuration) {
|
|
|
|
def formatStr = "%,10.2f"
|
|
|
|
|
|
|
|
def size = configuration.collect { it.length() / (1024 * 1024) }.sum()
|
|
|
|
|
|
|
|
def out = new StringBuffer()
|
|
|
|
out << "\nConfiguration name: \"${configuration.name}\"\n"
|
|
|
|
if (size) {
|
|
|
|
out << 'Total dependencies size:'.padRight(65)
|
|
|
|
out << "${String.format(formatStr, size)} Mb\n\n"
|
|
|
|
|
|
|
|
configuration.sort { -it.length() }
|
|
|
|
.each {
|
|
|
|
out << "${it.name}".padRight(65)
|
|
|
|
out << "${String.format(formatStr, (it.length() / 1024))} kb\n"
|
|
|
|
}
|
|
|
|
} else {
|
2021-01-24 04:55:11 +00:00
|
|
|
out << 'No dependencies found'
|
2020-08-07 23:20:39 +00:00
|
|
|
}
|
|
|
|
println(out)
|
|
|
|
}
|