-
Notifications
You must be signed in to change notification settings - Fork 2
/
rat.xml
50 lines (50 loc) · 1.94 KB
/
rat.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?xml version="1.0" encoding="UTF-8"?>
<project name="rat" xmlns:rat="antlib:org.apache.rat.anttasks"
xmlns:if="ant:if" xmlns="antlib:org.apache.tools.ant">
<property environment="env" />
<condition property="support.dir" value="${env.SUPPORT_DIR}" else="${user.dir}/support">
<isset property="env.SUPPORT_DIR" />
</condition>
<target name="rat">
<rat:report reportFile="${user.dir}/RAT_report.txt">
<fileset dir="${user.dir}" defaultexcludes="yes">
<exclude name="RAT_report.txt" />
<excludesfile name="${user.dir}/.ratexcludes" />
<excludesfile name="${support.dir}/rat.excludes" />
</fileset>
</rat:report>
<fail message="RAT_report.txt not generated">
<condition>
<not>
<resourcecount count="1">
<fileset dir="${user.dir}" includes="RAT_report.txt" />
</resourcecount>
</not>
</condition>
</fail>
<loadfile property="report" srcfile="${user.dir}/RAT_report.txt">
<filterchain>
<tokenfilter>
<filetokenizer />
<replaceregex replace="" flags="s"
pattern="\s*Printing headers for text files without a valid license header.*" />
</tokenfilter>
</filterchain>
</loadfile>
<condition property="problems">
<not>
<contains string="${report}"
substring=" 0 Unknown Licenses" />
</not>
</condition>
<echo if:set="problems" message="${report}" />
<fail message="Unknown Licenses found">
<condition>
<not>
<contains string="${report}"
substring=" 0 Unknown Licenses" />
</not>
</condition>
</fail>
</target>
</project>