Skip to content

Commit

Permalink
build - Preparing spotless license header option and adding license t…
Browse files Browse the repository at this point in the history
…emplates (#7015)

Preparing spotless license header option and adding license templates

Signed-off-by: Usman Saleem <[email protected]>
  • Loading branch information
usmansaleem authored Apr 30, 2024
1 parent eb6c349 commit 4dc08d4
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 1 deletion.
6 changes: 6 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,12 @@ allprojects {
importOrder 'org.hyperledger', 'java', ''
trimTrailingWhitespace()
endWithNewline()
// apply appropriate license header files.
// TODO: Remove checkSpdxLicense task and buildSrc when all files are formatted and updated via multiple PRs
// TODO: Uncomment following when all files are formatted and updated via multiple PRs
// licenseHeaderFile("${rootDir}/gradle/spotless/java.former.license").named("older").onlyIfContentMatches("^/\\*\\r?\\n.*Copyright ConsenSys AG\\.")
licenseHeaderFile("${rootDir}/gradle/spotless/java.former.date.license").named("older.year").onlyIfContentMatches("^/\\*\\r?\\n.* Copyright \\d{4} ConsenSys AG\\.")
// licenseHeaderFile("${rootDir}/gradle/spotless/java.current.license").named("current").onlyIfContentMatches("^(?!/\\*\\r?\\n \\*.*ConsenSys AG\\.)")
}
groovyGradle {
target '*.gradle'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
* specific language governing permissions and limitations under the License.
*
* SPDX-License-Identifier: Apache-2.0
*
*/
package org.hyperledger.besu.evmtool.exception;

Expand Down
14 changes: 14 additions & 0 deletions gradle/spotless/java.current.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* Copyright contributors to Hyperledger Besu.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*
* SPDX-License-Identifier: Apache-2.0
*/
14 changes: 14 additions & 0 deletions gradle/spotless/java.former.date.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* Copyright $YEAR ConsenSys AG.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*
* SPDX-License-Identifier: Apache-2.0
*/
14 changes: 14 additions & 0 deletions gradle/spotless/java.former.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* Copyright ConsenSys AG.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*
* SPDX-License-Identifier: Apache-2.0
*/

0 comments on commit 4dc08d4

Please sign in to comment.