13d781bd6SAndre Fischer<?xml version="1.0" encoding="UTF-8"?>
23d781bd6SAndre Fischer<!--***********************************************************
33d781bd6SAndre Fischer *
43d781bd6SAndre Fischer * Licensed to the Apache Software Foundation (ASF) under one
53d781bd6SAndre Fischer * or more contributor license agreements.  See the NOTICE file
63d781bd6SAndre Fischer * distributed with this work for additional information
73d781bd6SAndre Fischer * regarding copyright ownership.  The ASF licenses this file
83d781bd6SAndre Fischer * to you under the Apache License, Version 2.0 (the
93d781bd6SAndre Fischer * "License"); you may not use this file except in compliance
103d781bd6SAndre Fischer * with the License.  You may obtain a copy of the License at
113d781bd6SAndre Fischer *
123d781bd6SAndre Fischer *   http://www.apache.org/licenses/LICENSE-2.0
133d781bd6SAndre Fischer *
143d781bd6SAndre Fischer * Unless required by applicable law or agreed to in writing,
153d781bd6SAndre Fischer * software distributed under the License is distributed on an
163d781bd6SAndre Fischer * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
173d781bd6SAndre Fischer * KIND, either express or implied.  See the License for the
183d781bd6SAndre Fischer * specific language governing permissions and limitations
193d781bd6SAndre Fischer * under the License.
203d781bd6SAndre Fischer *
213d781bd6SAndre Fischer ***********************************************************-->
223d781bd6SAndre Fischer<project name="Check OpenOffice License Files" default="buildsources"
233d781bd6SAndre Fischer         xmlns:rat="antlib:org.apache.rat.anttasks"
243d781bd6SAndre Fischer         xmlns="antlib:org.apache.tools.ant">
253d781bd6SAndre Fischer  <description>
263d781bd6SAndre Fischer    Check over Apache OpenOffice source files for license headers.
273d781bd6SAndre Fischer  </description>
28*62c80a07SJuergen Schmidt  <property name="version" value="AOO 4.1.0"/>
293d781bd6SAndre Fischer  <property environment="env"/>
303d781bd6SAndre Fischer  <property name="src-dir" location="${env.SRC_ROOT}/.."/>
313d781bd6SAndre Fischer
323d781bd6SAndre Fischer  <!-- Run the rat scan on a fileset whose ecludes are defined by main/rat-excludes.
333d781bd6SAndre Fischer       Note that ant adds a list of default excludes like **/*~ or **/.svn.
343d781bd6SAndre Fischer       For the complete list see here: http://ant.apache.org/manual/dirtasks.html#defaultexcludes
353d781bd6SAndre Fischer  -->
363d781bd6SAndre Fischer  <target name="buildsources"
373d781bd6SAndre Fischer          depends="taskdef"
383d781bd6SAndre Fischer          description="runs the tasks over OpenOffice tree.">
39*62c80a07SJuergen Schmidt    <tstamp>
40*62c80a07SJuergen Schmidt      <format property="scan.time" pattern="MM/dd/yyyy hh:mm aa"/>
41*62c80a07SJuergen Schmidt    </tstamp>
423d781bd6SAndre Fischer    <echo level="info">
43*62c80a07SJuergen Schmidt      Timestamp: ${scan.time}
443d781bd6SAndre Fischer    </echo>
453d781bd6SAndre Fischer    <rat:report format="xml" reportFile="${RAT_SCAN_OUTPUT}">
463d781bd6SAndre Fischer      <fileset dir="${src-dir}" id="included-files">
473d781bd6SAndre Fischer        <excludesfile name="${src-dir}/main/rat-excludes"/>
483d781bd6SAndre Fischer        <excludesfile name="${src-dir}/main/rat-excludes-solver"/>
493d781bd6SAndre Fischer        <exclude name=".buildbot-sourcedata"/>
503d781bd6SAndre Fischer      </fileset>
513d781bd6SAndre Fischer    </rat:report>
523d781bd6SAndre Fischer  </target>
533d781bd6SAndre Fischer
543d781bd6SAndre Fischer  <!-- The negative file list of files that are excluded from scanning.
553d781bd6SAndre Fischer       It can be used to control the exclude list.
563d781bd6SAndre Fischer  -->
573d781bd6SAndre Fischer  <fileset dir="${src-dir}" id="excluded-files">
583d781bd6SAndre Fischer    <includesfile name="${src-dir}/main/rat-excludes"/>
593d781bd6SAndre Fischer    <include name=".buildbot-sourcedata"/>
603d781bd6SAndre Fischer  </fileset>
613d781bd6SAndre Fischer  <fileset dir="${src-dir}" id="excluded-solver">
623d781bd6SAndre Fischer    <includesfile name="${src-dir}/main/rat-excludes-solver"/>
633d781bd6SAndre Fischer  </fileset>
643d781bd6SAndre Fischer  <property name="excluded-files-property" refid="excluded-files"/>
653d781bd6SAndre Fischer  <property name="excluded-solver-property" refid="excluded-solver"/>
663d781bd6SAndre Fischer  <target name="show-excluded-files"
673d781bd6SAndre Fischer          depends="taskdef"
683d781bd6SAndre Fischer          description="create a list of the files excluded from the rat scan.">
693d781bd6SAndre Fischer    <echo file="${EXCLUDED_FILES_OUTPUT}" append="false">
703d781bd6SAndre FischerExcluded files (without local or global solvers)
713d781bd6SAndre Fischer------------------------------------------------
723d781bd6SAndre Fischer
733d781bd6SAndre Fischer    </echo>
743d781bd6SAndre Fischer    <echo file="${EXCLUDED_FILES_OUTPUT}" append="true">
753d781bd6SAndre Fischer${excluded-files-property}
763d781bd6SAndre Fischer    </echo>
773d781bd6SAndre Fischer    <echo file="${EXCLUDED_FILES_OUTPUT}" append="true">
783d781bd6SAndre Fischer
793d781bd6SAndre Fischer
803d781bd6SAndre FischerExcluded files of local and global solvers
813d781bd6SAndre Fischer------------------------------------------
823d781bd6SAndre Fischer
833d781bd6SAndre Fischer    </echo>
843d781bd6SAndre Fischer    <echo file="${EXCLUDED_SOLVER_OUTPUT}" append="true">
853d781bd6SAndre Fischer      ${excluded-solver-property}
863d781bd6SAndre Fischer    </echo>
873d781bd6SAndre Fischer  </target>
883d781bd6SAndre Fischer
893d781bd6SAndre Fischer  <!-- Import the rat scan as ant command.
903d781bd6SAndre Fischer  -->
913d781bd6SAndre Fischer  <target name="taskdef">
923d781bd6SAndre Fischer    <typedef resource="org/apache/rat/anttasks/antlib.xml"
933d781bd6SAndre Fischer             uri="antlib:org.apache.rat.anttasks">
943d781bd6SAndre Fischer      <classpath>
953d781bd6SAndre Fischer        <fileset dir="${RAT_JAR_HOME}">
963d781bd6SAndre Fischer          <include name="**/apache-rat*.jar"/>
973d781bd6SAndre Fischer          <include name="**/commons-*.jar"/>
983d781bd6SAndre Fischer        </fileset>
993d781bd6SAndre Fischer      </classpath>
1003d781bd6SAndre Fischer    </typedef>
1013d781bd6SAndre Fischer  </target>
1023d781bd6SAndre Fischer
103*62c80a07SJuergen Schmidt</project>
104