mirror of https://github.com/apache/cassandra
95 lines
4.6 KiB
XML
95 lines
4.6 KiB
XML
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
<!--
|
|
~ Licensed to the Apache Software Foundation (ASF) under one
|
|
~ or more contributor license agreements. See the NOTICE file
|
|
~ distributed with this work for additional information
|
|
~ regarding copyright ownership. The ASF licenses this file
|
|
~ to you 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
|
|
~
|
|
~ https://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.
|
|
-->
|
|
<project basedir="." name="apache-cassandra--rat-tasks"
|
|
xmlns:artifact="antlib:org.apache.maven.artifact.ant"
|
|
xmlns:rat="antlib:org.apache.rat.anttasks">
|
|
|
|
<!--
|
|
License audit tool
|
|
-->
|
|
|
|
<condition property="rat.enabled">
|
|
<available file=".gitignore" />
|
|
</condition>
|
|
|
|
<target name="_rat_init" depends="maven-ant-tasks-init">
|
|
<artifact:dependencies pathId="rat.classpath">
|
|
<dependency groupId="org.apache.rat" artifactId="apache-rat-tasks" version="0.6" />
|
|
<remoteRepository refid="central"/>
|
|
<remoteRepository refid="apache"/>
|
|
</artifact:dependencies>
|
|
<typedef uri="antlib:org.apache.rat.anttasks" classpathref="rat.classpath"/>
|
|
</target>
|
|
|
|
<target name="rat-check" depends="_rat_init" if="${rat.enabled}" description="License checks on source" >
|
|
<rat:report reportFile="${build.dir}/rat.txt">
|
|
<fileset dir="."
|
|
includes="**/*.java,**/*.py,**/*.sh,**/.xml,**/*.spec,**/*.md,**/*.iml,**/*.bat,**/*.btm,**/*.cql,**/*.css,**/*.g,**/*.hmtl,**/*.jflex,**/*.jks,**/*.mod,**/*.name,**/*.pom,**/*.textile,**/*.yml,**/*.yaml"
|
|
excludesfile=".gitignore">
|
|
<!-- Config files with not much creativity -->
|
|
<exclude name="**/metrics-reporter-config-sample.yaml"/>
|
|
<exclude name="**/cassandra.yaml"/>
|
|
<exclude name="**/cassandra-murmur.yaml"/>
|
|
<exclude name="**/cassandra-seeds.yaml"/>
|
|
<exclude name="**/test/conf/cassandra.yaml"/>
|
|
<exclude name="**/test/conf/cassandra_encryption.yaml"/>
|
|
<exclude name="**/test/conf/cdc.yaml"/>
|
|
<exclude name="**/test/conf/commitlog_compression_LZ4.yaml"/>
|
|
<exclude name="**/test/conf/commitlog_compression_Zstd.yaml"/>
|
|
<exclude name="**/test/conf/system_keyspaces_directory.yaml"/>
|
|
<exclude name="**/test/conf/unit-test-conf/test-native-port.yaml"/>
|
|
<exclude name="**/test/data/jmxdump/cassandra-3.0-jmx.yaml"/>
|
|
<exclude name="**/test/data/jmxdump/cassandra-3.11-jmx.yaml"/>
|
|
<exclude name="**/test/data/jmxdump/cassandra-4.0-jmx.yaml"/>
|
|
<exclude name="**/tools/cqlstress-counter-example.yaml"/>
|
|
<exclude name="**/tools/cqlstress-example.yaml"/>
|
|
<exclude name="**/tools/cqlstress-insanity-example.yaml"/>
|
|
<exclude name="**/tools/cqlstress-lwt-example.yaml"/>
|
|
<!-- NOTICE files -->
|
|
<exclude NAME="**/NOTICE.md"/>
|
|
<!-- LICENSE files -->
|
|
<exclude NAME="**/LICENSE.md"/>
|
|
</fileset>
|
|
</rat:report>
|
|
<fail message="Some files have missing or incorrect license information. Check RAT report in ${build.dir}/rat.txt for more details!">
|
|
<condition>
|
|
<and>
|
|
<not>
|
|
<resourcecontains resource="${build.dir}/rat.txt" substring="0 Unknown Licenses" casesensitive="false" />
|
|
</not>
|
|
</and>
|
|
</condition>
|
|
</fail>
|
|
</target>
|
|
|
|
<target name="_write_java_license_headers" depends="_rat_init">
|
|
<java classname="org.apache.rat.Report" fork="true"
|
|
output="${build.dir}/rat-report.log">
|
|
<classpath refid="rat.classpath" />
|
|
<arg value="-a" />
|
|
<arg value="--force" />
|
|
<arg value="interface/thrift" />
|
|
</java>
|
|
</target>
|
|
|
|
<target name="write-java-license-headers" unless="without.rat" description="Add missing java license headers">
|
|
<antcall target="_write_java_license_headers" />
|
|
</target>
|
|
</project> |