From 86a8d3e4430d6ac41770b74cc5a0ea1b869e2d77 Mon Sep 17 00:00:00 2001 From: Robert Stupp Date: Sat, 22 Jan 2022 08:55:32 +0100 Subject: [PATCH] [build] Maintain developers + contributors in separate files --- build.gradle.kts | 51 +++++++++++++++++++++++++---------------- gradle/contributors.csv | 0 gradle/developers.csv | 5 ++++ 3 files changed, 36 insertions(+), 20 deletions(-) create mode 100644 gradle/contributors.csv create mode 100644 gradle/developers.csv diff --git a/build.gradle.kts b/build.gradle.kts index e0ec2a89..7178758d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -90,26 +90,37 @@ allprojects { inceptionYear.set("2021") url.set("https://github.com/projectnessie/cel-java") developers { - developer { - id.set("snazy") - name.set("Robert Stupp") - url.set("https://github.com/snazy") - } - developer { - id.set("nastra") - name.set("Eduard Tudenhoefner") - url.set("https://github.com/nastra") - } - developer { - id.set("rymurr") - name.set("Ryan Murray") - url.set("https://github.com/rymurr") - } - developer { - id.set("laurentgo") - name.set("Laurent Goujon") - url.set("https://github.com/laurentgo") - } + file(rootProject.file("gradle/developers.csv")) + .readLines() + .map { line -> line.trim() } + .filter { line -> !line.isEmpty() && !line.startsWith("#") } + .forEach { line -> + val args = line.split(",") + if (args.size < 3) { + throw GradleException("gradle/developers.csv contains invalid line '${line}'") + } + developer { + id.set(args[0]) + name.set(args[1]) + url.set(args[2]) + } + } + } + contributors { + file(rootProject.file("gradle/contributors.csv")) + .readLines() + .map { line -> line.trim() } + .filter { line -> !line.isEmpty() && !line.startsWith("#") } + .forEach { line -> + val args = line.split(",") + if (args.size > 2) { + throw GradleException("gradle/contributors.csv contains invalid line '${line}'") + } + contributor { + name.set(args[1]) + url.set(args[2]) + } + } } organization { name.set("Project Nessie") diff --git a/gradle/contributors.csv b/gradle/contributors.csv new file mode 100644 index 00000000..e69de29b diff --git a/gradle/developers.csv b/gradle/developers.csv new file mode 100644 index 00000000..880dbd11 --- /dev/null +++ b/gradle/developers.csv @@ -0,0 +1,5 @@ +snazy,Robert Stupp,https://github.com/snazy +nastra,Eduard Tudenhoefner,https://github.com/nastra +rymurr,Ryan Murray,https://github.com/rymurr +laurentgo,Laurent Goujon,https://github.com/laurentgo +