Make checkSpdxHeader task cross platform (#5794)

Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
pull/5803/head
Fabio Di Fabio 1 year ago committed by GitHub
parent 139fc121cc
commit bab9c1d111
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 23
      build.gradle

@ -18,6 +18,7 @@ import groovy.transform.Memoized
import net.ltgt.gradle.errorprone.CheckSeverity import net.ltgt.gradle.errorprone.CheckSeverity
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.regex.Pattern
plugins { plugins {
id 'com.diffplug.spotless' version '6.12.0' id 'com.diffplug.spotless' version '6.12.0'
@ -900,6 +901,8 @@ task manifestDockerRelease {
} }
} }
def sep = Pattern.quote(File.separator)
task checkSpdxHeader(type: CheckSpdxHeader) { task checkSpdxHeader(type: CheckSpdxHeader) {
apply plugin: 'groovy' apply plugin: 'groovy'
@ -907,16 +910,16 @@ task checkSpdxHeader(type: CheckSpdxHeader) {
spdxHeader = "* SPDX-License-Identifier: Apache-2.0" spdxHeader = "* SPDX-License-Identifier: Apache-2.0"
filesRegex = "(.*.java)|(.*.groovy)" filesRegex = "(.*.java)|(.*.groovy)"
excludeRegex = [ excludeRegex = [
"(.*/generalstate/GeneralStateRegressionReferenceTest.*)", "(.*${sep}generalstate${sep}GeneralStateRegressionReferenceTest.*)",
"(.*/generalstate/GeneralStateReferenceTest.*)", "(.*${sep}generalstate${sep}GeneralStateReferenceTest.*)",
"(.*/generalstate/LegacyGeneralStateReferenceTest.*)", "(.*${sep}generalstate${sep}LegacyGeneralStateReferenceTest.*)",
"(.*/blockchain/BlockchainReferenceTest.*)", "(.*${sep}blockchain${sep}BlockchainReferenceTest.*)",
"(.*/blockchain/LegacyBlockchainReferenceTest.*)", "(.*${sep}blockchain${sep}LegacyBlockchainReferenceTest.*)",
"(.*/.gradle/.*)", "(.*${sep}.gradle${sep}.*)",
"(.*/.idea/.*)", "(.*${sep}.idea${sep}.*)",
"(.*/out/.*)", "(.*${sep}out${sep}.*)",
"(.*/build/.*)", "(.*${sep}build${sep}.*)",
"(.*/src/[^/]+/generated/.*)" "(.*${sep}src${sep}[^${sep}]+${sep}generated${sep}.*)"
].join("|") ].join("|")
} }

Loading…
Cancel
Save