From f3ffaafe0fabe1221f63326635c9576bfb516e5e Mon Sep 17 00:00:00 2001 From: Lanchon Date: Sun, 17 Nov 2019 19:38:09 -0300 Subject: [PATCH] Refactor into 'check-copyright.gradle' --- build.gradle | 19 +------------------ check-copyright.gradle | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 18 deletions(-) create mode 100644 check-copyright.gradle diff --git a/build.gradle b/build.gradle index 24a9e17..ce8ddd8 100644 --- a/build.gradle +++ b/build.gradle @@ -118,24 +118,7 @@ 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 -} +apply from: 'check-copyright.gradle' wrapper { distributionType = Wrapper.DistributionType.ALL diff --git a/check-copyright.gradle b/check-copyright.gradle new file mode 100644 index 0000000..bd40c71 --- /dev/null +++ b/check-copyright.gradle @@ -0,0 +1,28 @@ +/* + * multidexlib2 - Copyright 2015-2019 Rodrigo Balerdi + * (GNU General Public License version 3 or later) + * + * multidexlib2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published + * by the Free Software Foundation, either version 3 of the License, + * or (at your option) any later version. + */ + +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 +}