1<?xml version="1.0" encoding="UTF-8"?>
2<!--***********************************************************
3 *
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements.  See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership.  The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License.  You may obtain a copy of the License at
11 *
12 *   http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied.  See the License for the
18 * specific language governing permissions and limitations
19 * under the License.
20 *
21 ***********************************************************-->
22<project name="Check OpenOffice License Files" default="buildsources"
23         xmlns:rat="antlib:org.apache.rat.anttasks"
24         xmlns="antlib:org.apache.tools.ant">
25  <description>
26    Check over Apache OpenOffice source files for license headers.
27  </description>
28  <property name="version" value="AOO 4.0"/>
29  <property environment="env"/>
30  <property name="src-dir" location="${env.SRC_ROOT}/.."/>
31
32  <!-- Run the rat scan on a fileset whose ecludes are defined by main/rat-excludes.
33       Note that ant adds a list of default excludes like **/*~ or **/.svn.
34       For the complete list see here: http://ant.apache.org/manual/dirtasks.html#defaultexcludes
35  -->
36  <target name="buildsources"
37          depends="taskdef"
38          description="runs the tasks over OpenOffice tree.">
39    <tstamp/>
40    <echo level="info">
41      Timestamp: ${DSTAMP} ${TSTAMP}
42    </echo>
43    <rat:report format="xml" reportFile="${RAT_SCAN_OUTPUT}">
44      <fileset dir="${src-dir}" id="included-files">
45        <excludesfile name="${src-dir}/main/rat-excludes"/>
46        <excludesfile name="${src-dir}/main/rat-excludes-solver"/>
47        <exclude name=".buildbot-sourcedata"/>
48      </fileset>
49    </rat:report>
50  </target>
51
52  <!-- The negative file list of files that are excluded from scanning.
53       It can be used to control the exclude list.
54  -->
55  <fileset dir="${src-dir}" id="excluded-files">
56    <includesfile name="${src-dir}/main/rat-excludes"/>
57    <include name=".buildbot-sourcedata"/>
58  </fileset>
59  <fileset dir="${src-dir}" id="excluded-solver">
60    <includesfile name="${src-dir}/main/rat-excludes-solver"/>
61  </fileset>
62  <property name="excluded-files-property" refid="excluded-files"/>
63  <property name="excluded-solver-property" refid="excluded-solver"/>
64  <target name="show-excluded-files"
65          depends="taskdef"
66          description="create a list of the files excluded from the rat scan.">
67    <echo file="${EXCLUDED_FILES_OUTPUT}" append="false">
68Excluded files (without local or global solvers)
69------------------------------------------------
70
71    </echo>
72    <echo file="${EXCLUDED_FILES_OUTPUT}" append="true">
73${excluded-files-property}
74    </echo>
75    <echo file="${EXCLUDED_FILES_OUTPUT}" append="true">
76
77
78Excluded files of local and global solvers
79------------------------------------------
80
81    </echo>
82    <echo file="${EXCLUDED_SOLVER_OUTPUT}" append="true">
83      ${excluded-solver-property}
84    </echo>
85  </target>
86
87  <!-- Import the rat scan as ant command.
88  -->
89  <target name="taskdef">
90    <typedef resource="org/apache/rat/anttasks/antlib.xml"
91             uri="antlib:org.apache.rat.anttasks">
92      <classpath>
93        <fileset dir="${RAT_JAR_HOME}">
94          <include name="**/apache-rat*.jar"/>
95          <include name="**/commons-*.jar"/>
96        </fileset>
97      </classpath>
98    </typedef>
99  </target>
100
101</project>