Add AUTHORS file to the distribution

Signed-off-by: Graham <gpe@openrs2.dev>
bzip2
Graham 5 years ago
parent 4e7b107954
commit 18a6736b68
  1. 18
      all/build.gradle.kts

@ -1,4 +1,5 @@
import com.github.jk1.license.render.TextReportRenderer import com.github.jk1.license.render.TextReportRenderer
import java.nio.file.Files
plugins { plugins {
`maven-publish` `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 { licenseReport {
renderers = arrayOf(TextReportRenderer()) renderers = arrayOf(TextReportRenderer())
} }
@ -43,12 +58,13 @@ val distTasks = listOf(
) )
configure(tasks.filter { it.name in distTasks }) { configure(tasks.filter { it.name in distTasks }) {
dependsOn("generateLicenseReport") dependsOn("generateAuthors", "generateLicenseReport")
} }
distributions { distributions {
all { all {
contents { contents {
from("$buildDir/AUTHORS")
from("${rootProject.projectDir}/DCO") from("${rootProject.projectDir}/DCO")
from("${rootProject.projectDir}/LICENSE") from("${rootProject.projectDir}/LICENSE")
from("${rootProject.projectDir}/README.md") from("${rootProject.projectDir}/README.md")

Loading…
Cancel
Save