hierynomus / license-gradle-plugin

Manage your license(s)
http://www.javadude.nl
Other
409 stars 114 forks source link

Year based on Git #140

Open pavolloffay opened 7 years ago

pavolloffay commented 7 years ago

Hello,

is there a way to set a year in a header based on Git date?

e.g. File created this year: 2017 File created in 2016 and touched this year 2016-2017

hierynomus commented 7 years ago

Not out of the box, you would need to load the git history and filter it per file.

2017-06-20 11:23 GMT+02:00 Pavol Loffay notifications@github.com:

Hello,

is there a way to set a year in a header based on Git date?

e.g. File created this year: 2017 File created in 2016 and touched this year 2016-2017

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/hierynomus/license-gradle-plugin/issues/140, or mute the thread https://github.com/notifications/unsubscribe-auth/AAHLo71WEDY_xjku8ZKHV8uiuO5ul2hDks5sF4-IgaJpZM4N_T0v .

pavolloffay commented 7 years ago

Do you have a code snippet for it? I think this is the mostly used in maven based license checks.

RiRomain commented 7 years ago

You could extend the license-gradle-plugin with the license-maven-plugin-git since the gradle plugin is based on the mvn one.

https://github.com/mycila/license-maven-plugin/tree/master/license-maven-plugin-git#how-to-use-license-maven-plugin-git

tlinkowski commented 5 years ago

I come here from @aalmiray's Kordamp Licensing Plugin, which applies this plugin.

I'm also looking for "wiser" copyright year ranges, which would reflect file creation time and last modification time. Having fixed ${inceptionYear}-${currentYear} doesn't feel good.

Note that it's how OpenJDK does it:

@hierynomus, any chances you would provide such functionality? 🙂