From 027404b80a0290830a158f95f5dd2a78fa894b35 Mon Sep 17 00:00:00 2001 From: Lanchon Date: Sun, 17 Nov 2019 19:33:15 -0300 Subject: [PATCH] Add 'checkCopyrightNotice' build task --- build.gradle | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/build.gradle b/build.gradle index 5936c17..24a9e17 100644 --- a/build.gradle +++ b/build.gradle @@ -118,6 +118,25 @@ signing { } } +task checkCopyrightNotice { + dependsOn { subprojects*.tasks.build } + def notice = "Copyright 2015-${new java.text.SimpleDateFormat('yyyy').format(new Date())}" + def checkNotice = { noticeFile -> + if (!file(noticeFile).text.contains(notice)) { + System.err.println "******************************** WARNING ********************************" + System.err.println "Expired copyright notice: ${noticeFile}" + System.err.println "***************************************************************************" + } + } + doLast { + checkNotice 'NOTICE.txt' + } +} + +build { + dependsOn checkCopyrightNotice +} + wrapper { distributionType = Wrapper.DistributionType.ALL }