| <?xml version="1.0" encoding="UTF-8"?> |
| <!-- |
| |
| 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 |
| |
| http://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 name="findbugs" basedir="."> |
| |
| <property name="bootclasspath.prepend" value="${nbplatform.active.dir}/java/modules/ext/nb-javac-api.jar" /> |
| |
| <target name="findbugs-init" depends="build-init"> |
| <property name="findbugs.home" location="${suite.dir}/external/findbugs"/> |
| <ant dir="${findbugs.home}" inheritall="false"/> |
| </target> |
| |
| <target name="findbugs" depends="build-init,jar,findbugs-init"> |
| <property name="report.dir" location="${suite.dir}/build/findbugs"/> |
| <mkdir dir="${report.dir}"/> |
| <property name="report.file" location="${report.dir}/${code.name.base.dashes}.xml"/> |
| <taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpath="${findbugs.home}/lib/findbugs-ant.jar"/> |
| |
| <path id="findbugs.class.path.ref"> |
| <path path="${module.run.classpath}"/> |
| <path path="${cp.extra}"/> |
| <path path="${cluster}/${module.jar}"/> |
| </path> |
| <pathconvert refid="findbugs.class.path.ref" property="findbugs.class.path"/> |
| |
| <echo>Findbugs module: ${code.name.base.dashes}</echo> |
| <findbugs home="${findbugs.home}" |
| output="xml" |
| outputFile="${report.file}" |
| failOnError="true" |
| jvmargs="-Xmx256m"> |
| <auxClasspath path="${findbugs.class.path}" /> |
| <sourcePath path="${src.dir}" /> |
| <class location="${build.classes.dir}" /> |
| </findbugs> |
| <condition property="findbugs.error" value="true"> |
| <isfileselected file="${report.file}"> |
| <size value="0"/> |
| </isfileselected> |
| </condition> |
| <antcall target="findbugs.delete"/> |
| </target> |
| |
| <target name="findbugs.delete" if="findbugs.error"> |
| <delete file="${report.file}" failonerror="false"/> |
| </target> |
| |
| <target name="-prepare-scripted-tests" depends="-check-scripted-tests" if="has.scripted.tests"> |
| <mkdir dir="build/test/scripted" /> |
| <copy todir="build/test/scripted"> |
| <fileset dir="test/scripted"/> |
| </copy> |
| <copy todir="build/test/scripted"> |
| <fileset dir="../test/scripted"/> |
| </copy> |
| <chmod dir="build/test/scripted" perm="u+x" includes="**/*" /> |
| </target> |
| |
| <target name="-check-scripted-tests" depends="build-init"> |
| <condition property="has.scripted.tests" value="true"> |
| <available file="test/scripted/config" /> |
| </condition> |
| </target> |
| |
| <target name="-jackpot-check-cp-exists" depends="init"> |
| <condition property="jackpot.cp.defined"> |
| <isreference refid="cp"/> |
| </condition> |
| </target> |
| |
| <target name="jackpot" depends="init,-jackpot-check-cp-exists" if="jackpot.cp.defined"> |
| <fail unless="jackpot.home">${jackpot.home} must be specified</fail> |
| <taskdef name="jackpot" classname="org.netbeans.modules.jackpot30.cmdline.ant.JackpotTask" classpath="${jackpot.home}/jackpot-ant.jar"/> |
| |
| <echo>Running Jackpot on module: ${code.name.base.dashes}</echo> |
| <jackpot jackpotHome="${jackpot.home}" source="${javac.source}"> |
| <src> |
| <pathelement path="${src.dir}" /> |
| </src> |
| <classpath> |
| <path refid="cp"/> |
| </classpath> |
| </jackpot> |
| </target> |
| </project> |