passy/build-time-tracker-plugin

NumberFormatException while parsing String as Long

Open

#79 opened on Apr 17, 2017

View on GitHub
 (0 comments) (7 reactions) (0 assignees)Groovy (1,210 stars) (67 forks)batch import
bughelp wanted

Description

Just added the plugin to my project to check how it works. Followed the guidelines suggested by the documentation.

My config: Using "net.rdrei.android.buildtimetracker:gradle-plugin:0.9.+"

buildtimetracker {
  reporters {
    csv {
      output "build/times.csv"
      append true
      header false
    }

    summary {
      ordered false
      threshold 50
      barstyle "unicode"
    }

    csvSummary {
      csv "build/times.csv"
    }
  }
}

At the first time running ./gradlew clean, the CSV file is correctly generated (with headers turned off). Turning headers on and running it again causes an exception and makes the build fail.

java.lang.NumberFormatException: For input string: "timestamp"
        at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
        at java.lang.Long.parseLong(Long.java:589)
        at java.lang.Long.valueOf(Long.java:803)
        at java_lang_Long$valueOf$0.call(Unknown Source)
        at net.rdrei.android.buildtimetracker.reporters.CSVSummaryReporter$_printReport_closure2.doCall(CSVSummaryReporter.groovy:48)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
        at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1027)
        at groovy.lang.Closure.call(Closure.java:414)
        at org.codehaus.groovy.runtime.DefaultGroovyMethods.callClosureForMapEntry(DefaultGroovyMethods.java:5226)
        at org.codehaus.groovy.runtime.DefaultGroovyMethods.collectEntries(DefaultGroovyMethods.java:3489)

Contributor guide