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