Skip to content

Commit

Permalink
Make checkSpdxHeader task cross platform (hyperledger#5794)
Browse files Browse the repository at this point in the history
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
  • Loading branch information
fab-10 authored Aug 24, 2023
1 parent 139fc12 commit bab9c1d
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import groovy.transform.Memoized
import net.ltgt.gradle.errorprone.CheckSeverity

import java.text.SimpleDateFormat
import java.util.regex.Pattern

plugins {
id 'com.diffplug.spotless' version '6.12.0'
Expand Down Expand Up @@ -900,23 +901,25 @@ task manifestDockerRelease {
}
}

def sep = Pattern.quote(File.separator)

task checkSpdxHeader(type: CheckSpdxHeader) {
apply plugin: 'groovy'

rootPath = "${projectDir}"
spdxHeader = "* SPDX-License-Identifier: Apache-2.0"
filesRegex = "(.*.java)|(.*.groovy)"
excludeRegex = [
"(.*/generalstate/GeneralStateRegressionReferenceTest.*)",
"(.*/generalstate/GeneralStateReferenceTest.*)",
"(.*/generalstate/LegacyGeneralStateReferenceTest.*)",
"(.*/blockchain/BlockchainReferenceTest.*)",
"(.*/blockchain/LegacyBlockchainReferenceTest.*)",
"(.*/.gradle/.*)",
"(.*/.idea/.*)",
"(.*/out/.*)",
"(.*/build/.*)",
"(.*/src/[^/]+/generated/.*)"
"(.*${sep}generalstate${sep}GeneralStateRegressionReferenceTest.*)",
"(.*${sep}generalstate${sep}GeneralStateReferenceTest.*)",
"(.*${sep}generalstate${sep}LegacyGeneralStateReferenceTest.*)",
"(.*${sep}blockchain${sep}BlockchainReferenceTest.*)",
"(.*${sep}blockchain${sep}LegacyBlockchainReferenceTest.*)",
"(.*${sep}.gradle${sep}.*)",
"(.*${sep}.idea${sep}.*)",
"(.*${sep}out${sep}.*)",
"(.*${sep}build${sep}.*)",
"(.*${sep}src${sep}[^${sep}]+${sep}generated${sep}.*)"
].join("|")

}
Expand Down

0 comments on commit bab9c1d

Please sign in to comment.