Gradle version bump, and fiddling with some gradle config. Add a 'hardReset' Gradle task. Add a 'docker remove' task.

This commit is contained in:
Adam 2022-03-09 21:40:40 +01:00
parent a9782a4d90
commit e630ce3702
19 changed files with 77 additions and 52 deletions

View file

@ -15,13 +15,12 @@ object Versions {
const val kotlin = "1.6.10"
const val gradleNodePlugin = "3.2.1"
const val gradleDockerComposePlugin = "0.15.0"
const val gradleDockerComposePlugin = "0.15.1"
const val kotlinXSerialization = "1.3.2"
const val kvision = "5.8.1"
const val semver = "1.1.2"
const val http4k = "4.19.1.0"
const val jsoup = "1.14.3"
const val kotest = "5.1.0"
}
@ -54,7 +53,10 @@ dependencies {
implementation("org.http4k:http4k-core")
implementation("org.http4k:http4k-client-okhttp")
implementation("org.jsoup:jsoup:${Versions.jsoup}")
// https://github.com/gradle/gradle/issues/15383#issuecomment-779893192
// https://youtrack.jetbrains.com/issue/IDEA-262280#focus=Comments-27-5397040.0-0
// implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location))
}

View file

@ -13,8 +13,6 @@ dependencyResolutionManagement {
mavenCentral()
jitpack()
gradlePluginPortal()
// maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev/")
// maven("https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven")
// Declare the Node.js download repository
ivy("https://nodejs.org/dist/") {
@ -32,25 +30,15 @@ dependencyResolutionManagement {
}
pluginManagement {
repositories {
gradlePluginPortal()
mavenCentral()
jitpack()
// maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev/")
}
}
}
fun RepositoryHandler.jitpack() {
maven("https://jitpack.io") {
// content {
// includeGroup("com.github.aSemy")
// includeGroup("com.github.adamko-dev")
// includeGroup("com.github.adamko-dev.kotka-streams")
// includeGroup("dev.adamko.kotka")
// }
}
maven("https://jitpack.io")
}

View file

@ -1,21 +1,30 @@
package dev.adamko.kafkatorio
import org.gradle.api.internal.tasks.userinput.UserInputHandler
import org.gradle.kotlin.dsl.support.serviceOf
plugins {
idea
base
idea
}
group = "${rootProject.group}.${project.name}"
group = rootProject.group
version = rootProject.version
idea {
module {
isDownloadSources = true
isDownloadJavadoc = true
}
}
tasks.withType<WriteProperties>().configureEach {
encoding = Charsets.UTF_8.name()
comment = " Do not edit manually. This file was created with task '$name'"
}
val hardReset by tasks.registering(Delete::class) {
group = rootProject.name
doFirst("hardResetConfirmation") {
val answer = project.serviceOf<UserInputHandler>()
.askYesNoQuestion("Are you sure you want to permanently delete Kafkatorio data?")
if (answer != true) {
throw GradleException("Aborting hard reset")
}
}
}

View file

@ -31,6 +31,16 @@ val dockerDown by tasks.registering(Exec::class) {
commandLine = parseSpaceSeparatedArgs(""" docker-compose down """)
}
val dockerRemove by tasks.registering(Exec::class) {
group = dockerComposeTaskGroup
logging.captureStandardOutput(LogLevel.LIFECYCLE)
workingDir = dockerSrcDir.asFile
commandLine = parseSpaceSeparatedArgs(""" docker-compose rm --stop -v -f """)
}
afterEvaluate {
tasks.named("processRun") { dependsOn(dockerUp, dockerEnv) }
tasks.named("processKill") { dependsOn(dockerDown) }