|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CheckStyleTask | Line # 55 | 0% |
0.0
|
2,352 | 125 | 48 | 48 | 0.38 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CheckStyleTask.FormatterType | Line # 511 | 0% |
0.0
|
2 | 1 | 1 | 1 | 1 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CheckStyleTask.Formatter | Line # 527 | 0% |
0.0
|
210 | 15 | 14 | 14 | 0.93 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CheckStyleTask.Property | Line # 618 | 0% |
0.0
|
30 | 5 | 5 | 5 | 1 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CheckStyleTask.Listener | Line # 657 | 0% |
0.0
|
6 | 2 | 2 | 2 | 1 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| No Tests | |||
| 1 | //////////////////////////////////////////////////////////////////////////////// | |
| 2 | // checkstyle: Checks Java source code for adherence to a set of rules. | |
| 3 | // Copyright (C) 2001-2005 Oliver Burn | |
| 4 | // | |
| 5 | // This library is free software; you can redistribute it and/or | |
| 6 | // modify it under the terms of the GNU Lesser General Public | |
| 7 | // License as published by the Free Software Foundation; either | |
| 8 | // version 2.1 of the License, or (at your option) any later version. | |
| 9 | // | |
| 10 | // This library is distributed in the hope that it will be useful, | |
| 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | // Lesser General Public License for more details. | |
| 14 | // | |
| 15 | // You should have received a copy of the GNU Lesser General Public | |
| 16 | // License along with this library; if not, write to the Free Software | |
| 17 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 18 | //////////////////////////////////////////////////////////////////////////////// | |
| 19 | package com.puppycrawl.tools.checkstyle; | |
| 20 | ||
| 21 | import java.io.File; | |
| 22 | import java.io.FileInputStream; | |
| 23 | import java.io.FileNotFoundException; | |
| 24 | import java.io.FileOutputStream; | |
| 25 | import java.io.IOException; | |
| 26 | import java.io.OutputStream; | |
| 27 | import java.util.ArrayList; | |
| 28 | import java.util.Iterator; | |
| 29 | import java.util.List; | |
| 30 | import java.util.Properties; | |
| 31 | import java.util.Hashtable; | |
| 32 | import java.util.ResourceBundle; | |
| 33 | import java.net.URL; | |
| 34 | ||
| 35 | import com.puppycrawl.tools.checkstyle.api.AuditListener; | |
| 36 | import com.puppycrawl.tools.checkstyle.api.Configuration; | |
| 37 | import com.puppycrawl.tools.checkstyle.api.SeverityLevelCounter; | |
| 38 | import com.puppycrawl.tools.checkstyle.api.SeverityLevel; | |
| 39 | import org.apache.tools.ant.AntClassLoader; | |
| 40 | import org.apache.tools.ant.BuildException; | |
| 41 | import org.apache.tools.ant.DirectoryScanner; | |
| 42 | import org.apache.tools.ant.Project; | |
| 43 | import org.apache.tools.ant.Task; | |
| 44 | import org.apache.tools.ant.taskdefs.LogOutputStream; | |
| 45 | import org.apache.tools.ant.types.EnumeratedAttribute; | |
| 46 | import org.apache.tools.ant.types.FileSet; | |
| 47 | import org.apache.tools.ant.types.Path; | |
| 48 | import org.apache.tools.ant.types.Reference; | |
| 49 | ||
| 50 | /** | |
| 51 | * An implementation of a ANT task for calling checkstyle. See the documentation | |
| 52 | * of the task for usage. | |
| 53 | * @author Oliver Burn | |
| 54 | */ | |
| 55 | public class CheckStyleTask extends Task | |
| 56 | { | |
| 57 | /** poor man's enum for an xml formatter */ | |
| 58 | private static final String E_XML = "xml"; | |
| 59 | /** poor man's enum for an plain formatter */ | |
| 60 | private static final String E_PLAIN = "plain"; | |
| 61 | ||
| 62 | /** class path to locate class files */ | |
| 63 | private Path mClasspath; | |
| 64 | ||
| 65 | /** name of file to check */ | |
| 66 | private String mFileName; | |
| 67 | ||