diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index 0645278..d7f9785 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -8,4 +8,5 @@ repositories { dependencies { implementation 'com.github.spotbugs.snom:spotbugs-gradle-plugin:5.2.5' + implementation 'gradle.plugin.com.hierynomus.gradle.plugins:license-gradle-plugin:0.16.1' } diff --git a/buildSrc/src/main/groovy/tanzawa.java-conventions.gradle b/buildSrc/src/main/groovy/tanzawa.java-conventions.gradle index 47d4b86..855f29d 100644 --- a/buildSrc/src/main/groovy/tanzawa.java-conventions.gradle +++ b/buildSrc/src/main/groovy/tanzawa.java-conventions.gradle @@ -3,6 +3,7 @@ plugins { id 'checkstyle' id 'com.github.spotbugs' + id 'com.github.hierynomus.license' } if (hasProperty('mavenLocal')) { @@ -119,3 +120,11 @@ tasks.withType(Tar) { task -> task.archiveExtension = 'tar.gz' task.compression = Compression.GZIP } + +license { + def confDir = 'buildSrc/src/main/resources' + header rootProject.file("$confDir/source-header.txt") + mapping('java', 'SLASHSTAR_STYLE') + include('**/*.java') + ignoreFailures true +} diff --git a/buildSrc/src/main/resources/source-header.txt b/buildSrc/src/main/resources/source-header.txt new file mode 100755 index 0000000..5263e8b --- /dev/null +++ b/buildSrc/src/main/resources/source-header.txt @@ -0,0 +1,13 @@ +Copyright 2023-2024 Project Tsurugi. + +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. \ No newline at end of file diff --git a/modules/tgsql/core/build.gradle b/modules/tgsql/core/build.gradle index fdbd748..aa51510 100644 --- a/modules/tgsql/core/build.gradle +++ b/modules/tgsql/core/build.gradle @@ -39,3 +39,6 @@ test { systemProperty 'tanzawa.dot', findProperty('tanzawa.dot') ?: '' } +tasks.licenseMain { + dependsOn 'generateJflex' +}