danielflower / maven-gitlog-plugin

Generates a change log for maven projects using git
55 stars 34 forks source link

json rendering support #21

Closed KeeganRoth closed 10 years ago

KeeganRoth commented 10 years ago

JsonRenderer will create changelog.json. I've updated the README.md to reflect the new functionality. I also made some preliminary commits to pull up some functionality from SimpleHtmlRenderer to its parent FileRenderer so I didn't have to duplicate common logic between SimpleHtmlRenderer and JsonRenderer.

I have generateJSONChangeLog true by default, that isn't required. So if you think the json file shouldn't be written by default, then no argument from me.

danielflower commented 10 years ago

Cool! JSON is always good, so I'm fine with the default.

Can you just send me an example of a JSON file it generates? I'll add it to the sample output files, then merge this.

Thanks.

KeeganRoth commented 10 years ago

No problem. Thanks for the plugin to be able to add to! Below is the first several objects from that json generated by the junit run.

[
    { "id":"00619e7e4c70c23d5d84a3b37156c76b678e32b7", "message":"refactor resource loading into method in parent for re-use", "authorName":"Keegan Roth", "authorEmail":"RothKeeganJ@JohnDeere.com", "committerName":"Keegan Roth", "committerEmail":"RothKeeganJ@JohnDeere.com", "date":"2014-04-25 14:57:28 -0500", "tags":[] }
  , { "id":"d3c5ade34035df08173ca499efd32913073536cc", "message":"remove resource leak warning in FileRenderer.convertStreamToString()", "authorName":"Keegan Roth", "authorEmail":"RothKeeganJ@JohnDeere.com", "committerName":"Keegan Roth", "committerEmail":"RothKeeganJ@JohnDeere.com", "date":"2014-04-25 14:28:31 -0500", "tags":[] }
  , { "id":"bcd3b49058cfff14604121cb3e6486f94207c56f", "message":"move convertStreamToString() to parent class for re-use", "authorName":"Keegan Roth", "authorEmail":"RothKeeganJ@JohnDeere.com", "committerName":"Keegan Roth", "committerEmail":"RothKeeganJ@JohnDeere.com", "date":"2014-04-25 14:27:11 -0500", "tags":[] }
  , { "id":"f4133bc3bbd46926817388575a3babf231abbae7", "message":"Updated version to use in readme", "authorName":"Daniel Flower", "authorEmail":"git@danielflower.com", "committerName":"Daniel Flower", "committerEmail":"git@danielflower.com", "date":"2014-04-10 09:11:18 -0500", "tags":[] }
  , { "id":"32271674a0e956d1081d610e853f3a592d2cf2d0", "message":"Bumping minor version for new feature", "authorName":"Daniel Flower", "authorEmail":"git@danielflower.com", "committerName":"Daniel Flower", "committerEmail":"git@danielflower.com", "date":"2014-04-10 09:00:15 -0500", "tags":[ { "name":"maven-gitlog-plugin-1.6.0" } ] }
  , { "id":"f9a6fe0b1bc88ddff219bad2fa0826d2a75f1e32", "message":"Include example of how to use an artifact that contains additional filters", "authorName":"Ivan Martinez-Ortiz", "authorEmail":"imartinezortiz@gmail.com", "committerName":"Ivan Martinez-Ortiz", "committerEmail":"imartinezortiz@gmail.com", "date":"2014-04-07 10:46:59 -0500", "tags":[] }
]
danielflower commented 10 years ago

Just got back from travelling so finally got around to releasing this. Version 1.7.0 with json support should be available in the central maven repository in a few days. Thanks again for the contribution.