HoriSun / closure-compiler

Automatically exported from code.google.com/p/closure-compiler
0 stars 0 forks source link

Combine whitespace-identical license statements, merge copyright years #1277

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
AFAIK, at present, @license is identical to @preserve.

We (Closure & friends) generally tag individual files with @license. If we pull 
in multiple files, that results in multiple statements (unnecessarily, which 
inflates byte counts).

We would like a pass that does something like the following processing on 
@license tags:

1) Find identical statements and combine them.  This would probably be done by 
normalizing whitespace and ignorning case.
2) Merging copyright years. If something is "copyright 2013 XXX" and "copyright 
2014 XXX", they could be combined to "copyright 2013,2014 XXX"

As a concrete example:

"""
/**
 * @license
 * Copyright 2010 foo
 * Released under the MIT license.
 * http://foo.org/license
 */

/**
 * @license
 * Copyright 2013 foo
 * Released under the MIT license.
 * http://foo.org/license
 */
"""

would become 

"""
/**
Copyright 2010,2013 foo
Released under the MIT license.
http://foo.org/license
*/
"""

post compilation

Original issue reported on code.google.com by nn...@google.com on 10 Mar 2014 at 7:28

GoogleCodeExporter commented 9 years ago
For bonus points, combine adjacent years.  2009,2010,2011,2014 becomes 
2009-2011,2014

Original comment by nn...@google.com on 10 Mar 2014 at 7:34

GoogleCodeExporter commented 9 years ago
Would it help to update copyrights to 2014 for files that are, say, "Copyright 
2009" but have been under active development since then?

Original comment by tbreisac...@google.com on 10 Mar 2014 at 8:32

GoogleCodeExporter commented 9 years ago
The copyright is generally kept at the year of initial authorship.  

See 
https://code.google.com/p/closure-library/source/browse/closure/goog/base.js?r=7
1326067e6b9477dda868622dfbc1428e2a4f0d3#1

Original comment by nn...@google.com on 10 Mar 2014 at 8:47

GoogleCodeExporter commented 9 years ago
see go/qdglj for internal discussion of license/copyright topics with google 
open source project office

Original comment by nn...@google.com on 11 Mar 2014 at 6:23

GoogleCodeExporter commented 9 years ago
A patch might be accepted, put this hasn't really been a common problem.

Original comment by concavel...@gmail.com on 13 Mar 2014 at 12:17

GoogleCodeExporter commented 9 years ago
Issue tracking has been migrated to github. Please make any further comments on 
this issue through https://github.com/google/closure-compiler/issues

Original comment by blic...@google.com on 1 May 2014 at 6:31

GoogleCodeExporter commented 9 years ago

Original comment by blic...@google.com on 1 May 2014 at 6:34