diff --git a/build.xml b/build.xml index 9eab9f70d..d53a8af7a 100644 --- a/build.xml +++ b/build.xml @@ -123,6 +123,12 @@ destdir="target/checkstyle" deprecation="on" debug="on" classpathref="build.classpath" /> + + + + + + @@ -139,6 +145,7 @@ + diff --git a/docs/releasenotes.html b/docs/releasenotes.html index 7d3896d25..6a049cd8d 100644 --- a/docs/releasenotes.html +++ b/docs/releasenotes.html @@ -90,6 +90,9 @@
  • Patch from Simon Kitching to allow more configuration control over the JavadocMethodCheck.
  • +
  • Checkstyle ant task outputs version info + in verbose and debug mode (request 550483).
  • +

    diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/CheckStyleTask.java b/src/checkstyle/com/puppycrawl/tools/checkstyle/CheckStyleTask.java index 3d6704dbf..504bdf3be 100644 --- a/src/checkstyle/com/puppycrawl/tools/checkstyle/CheckStyleTask.java +++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/CheckStyleTask.java @@ -29,6 +29,7 @@ import java.util.Iterator; import java.util.List; import java.util.Properties; import java.util.Hashtable; +import java.util.ResourceBundle; import java.net.URL; import com.puppycrawl.tools.checkstyle.api.Configuration; @@ -215,6 +216,16 @@ public class CheckStyleTask public void execute() throws BuildException { + // output version info in debug mode + final ResourceBundle compilationProperties = + ResourceBundle.getBundle("checkstylecompilation"); + final String version = + compilationProperties.getString("checkstyle.compile.version"); + final String compileTimestamp = + compilationProperties.getString("checkstyle.compile.timestamp"); + log("checkstyle version " + version, Project.MSG_VERBOSE); + log("compiled on " + compileTimestamp, Project.MSG_VERBOSE); + // Check for no arguments if ((mFileName == null) && (mFileSets.size() == 0)) { throw new BuildException(