Skip to content

Commit

Permalink
Fix #6992 Add SPDX checking for copyright/license (java)
Browse files Browse the repository at this point in the history
Signed-off-by: Nigel Jones <nigel.l.jones+git@gmail.com>
  • Loading branch information
planetf1 committed Mar 7, 2023
1 parent 7f52283 commit df8b95e
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
12 changes: 12 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ plugins {
id 'dev.jacomet.logging-capabilities' version "0.11.0"
// This plugin helps resolve jakarta/javax dev.jacomet.logging-capabilities
id 'org.gradlex.java-ecosystem-capabilities' version "1.1"
id 'checkstyle'
}


Expand All @@ -29,6 +30,7 @@ allprojects {
version = '4.0-SNAPSHOT'

// Mostly java, so default to this for now
apply plugin: 'checkstyle'
apply plugin: 'java'
apply plugin: 'jacoco'
apply plugin: 'org.gradlex.java-ecosystem-capabilities'
Expand Down Expand Up @@ -423,6 +425,14 @@ allprojects {
task printSubDependencies(type: DependencyReportTask) {}
task findDependency(type: DependencyInsightReportTask) {}

// Checking of headers etc
checkstyle {
toolVersion = '10.7.0'
// Whilst initially adding, soft warnings only, as there are fixes needed
ignoreFailures = true
showViolations = true
}

} // end of allProjects

// Whilst all modules have their own javadoc, we only build
Expand Down Expand Up @@ -524,5 +534,7 @@ dependencyAnalysis {
}
}



// Always run dependency check for every regular build
build.dependsOn("buildHealth")
17 changes: 17 additions & 0 deletions config/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">
<module name="Checker">
<module name="TreeWalker">


<module name="Regexp">
<property name="format" value="/\*[ ]{1,}SPDX-License-Identifier: Apache-2\.0"/>
</module>

<module name="Regexp">
<property name="format" value="/\*[ ]{1,}Copyright Contributors to the( ODPi)? Egeria project"/>
</module>
</module>
</module>
2 changes: 2 additions & 0 deletions config/checkstyle/java.header
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
^/* SPDX-License-Identifier: Apache-2.0 */$
^/* Copyright Contributors to the ODPi Egeria project. */$

0 comments on commit df8b95e

Please sign in to comment.