diff --git a/imperium-build-logic/src/main/kotlin/GenerateImperiumChangelog.kt b/imperium-build-logic/src/main/kotlin/GenerateImperiumChangelog.kt index c7443a7b..a13b5b80 100644 --- a/imperium-build-logic/src/main/kotlin/GenerateImperiumChangelog.kt +++ b/imperium-build-logic/src/main/kotlin/GenerateImperiumChangelog.kt @@ -17,8 +17,8 @@ open class GenerateImperiumChangelog : DefaultTask() { @TaskAction fun generate() { val git = project.rootProject.extensions.getByType().git()!! - val latest = git.repository.resolve("v" + project.rootProject.file("VERSION.txt").readText().trim()) - val head = git.repository.resolve(Constants.HEAD) + val latest = git.repository.resolve("v" + project.rootProject.file("VERSION.txt").readText().trim())!! + val head = git.repository.resolve(Constants.HEAD)!! target.get().asFile.writer().buffered().use { writer -> git.log().addRange(latest, head).call().forEach { commit -> val message = commit.shortMessage ?: return@forEach diff --git a/imperium-discord/build.gradle.kts b/imperium-discord/build.gradle.kts index 6c3bc8bb..7fc287bd 100644 --- a/imperium-discord/build.gradle.kts +++ b/imperium-discord/build.gradle.kts @@ -37,15 +37,9 @@ application { mainClass = "com.xpdustry.imperium.discord.ImperiumDiscordKt" } -val generateChangelog by tasks.registering(GenerateImperiumChangelog::class) { - target = temporaryDir.resolve("imperium-changelog.txt") -} - tasks.shadowJar { archiveFileName.set("imperium-discord.jar") - from(generateChangelog) - doFirst { val file = temporaryDir.resolve("imperium-version.txt") file.writeText(project.version.toString())