From 18a6736b68afdeefe855ef7d2b12e4374e6840d1 Mon Sep 17 00:00:00 2001 From: Graham Date: Sun, 10 May 2020 14:05:39 +0100 Subject: [PATCH] Add AUTHORS file to the distribution Signed-off-by: Graham --- all/build.gradle.kts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/all/build.gradle.kts b/all/build.gradle.kts index c496ed69dc..29d21f1b3f 100644 --- a/all/build.gradle.kts +++ b/all/build.gradle.kts @@ -1,4 +1,5 @@ import com.github.jk1.license.render.TextReportRenderer +import java.nio.file.Files plugins { `maven-publish` @@ -29,6 +30,20 @@ tasks.shadowJar { } } +tasks.register("generateAuthors") { + inputs.dir("$rootDir/.git") + outputs.file("$buildDir/AUTHORS") + + doLast { + Files.newOutputStream(buildDir.toPath().resolve("AUTHORS")).use { out -> + exec { + commandLine("git", "shortlog", "-esn", "HEAD") + standardOutput = out + }.assertNormalExitValue() + } + } +} + licenseReport { renderers = arrayOf(TextReportRenderer()) } @@ -43,12 +58,13 @@ val distTasks = listOf( ) configure(tasks.filter { it.name in distTasks }) { - dependsOn("generateLicenseReport") + dependsOn("generateAuthors", "generateLicenseReport") } distributions { all { contents { + from("$buildDir/AUTHORS") from("${rootProject.projectDir}/DCO") from("${rootProject.projectDir}/LICENSE") from("${rootProject.projectDir}/README.md")