You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Eric Evans (JIRA)" <ji...@apache.org> on 2009/07/08 23:29:14 UTC

[jira] Created: (THRIFT-537) prepend texts to generated files

prepend texts to generated files
--------------------------------

                 Key: THRIFT-537
                 URL: https://issues.apache.org/jira/browse/THRIFT-537
             Project: Thrift
          Issue Type: Wish
          Components: Compiler (C#), Compiler (C++), Compiler (Cocoa), Compiler (Erlang), Compiler (General), Compiler (Haskell), Compiler (Java), Compiler (Perl), Compiler (PHP), Compiler (Python), Compiler (Ruby)
            Reporter: Eric Evans


It would be great if there were an option you could pass to the compiler in order to specify a file, the contents of which would be prepended to generated source as comments. This would be useful for license texts, copyright notices, disclaimers, etc.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-537) prepend texts to generated files

Posted by "Bruce Simpson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-537?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12754203#action_12754203 ] 

Bruce Simpson commented on THRIFT-537:
--------------------------------------

It sounds easy enough in principle to do, however:
whilst the per-language generators all inherit from t_oop_generator, which has a method autogen_comment(), most of them don't use the base method internally.
So you'd have to decide if this header is language independent or not, and if any fields need to be substituted.

> prepend texts to generated files
> --------------------------------
>
>                 Key: THRIFT-537
>                 URL: https://issues.apache.org/jira/browse/THRIFT-537
>             Project: Thrift
>          Issue Type: Wish
>          Components: Compiler (C#), Compiler (C++), Compiler (Cocoa), Compiler (Erlang), Compiler (General), Compiler (Haskell), Compiler (Java), Compiler (Perl), Compiler (PHP), Compiler (Python), Compiler (Ruby)
>            Reporter: Eric Evans
>
> It would be great if there were an option you could pass to the compiler in order to specify a file, the contents of which would be prepended to generated source as comments. This would be useful for license texts, copyright notices, disclaimers, etc.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (THRIFT-537) prepend texts to generated files

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-537?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bryan Duxbury closed THRIFT-537.
--------------------------------

    Resolution: Won't Fix

> prepend texts to generated files
> --------------------------------
>
>                 Key: THRIFT-537
>                 URL: https://issues.apache.org/jira/browse/THRIFT-537
>             Project: Thrift
>          Issue Type: Wish
>          Components: C# - Compiler, C++ - Compiler, Cocoa - Compiler, Compiler (General), Erlang - Compiler, Haskell - Compiler, Java - Compiler, Perl - Compiler, PHP - Compiler, Python - Compiler, Ruby - Compiler
>            Reporter: Eric Evans
>
> It would be great if there were an option you could pass to the compiler in order to specify a file, the contents of which would be prepended to generated source as comments. This would be useful for license texts, copyright notices, disclaimers, etc.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-537) prepend texts to generated files

Posted by "Eric Evans (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-537?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12897780#action_12897780 ] 

Eric Evans commented on THRIFT-537:
-----------------------------------

bq. Correct me if I'm wrong, but generally, I don't think there's any need to put license headers in generated content. I know that Thrift has avoided adding the ASL header to a bunch of files because they are generated.

Well, technically speaking (in our projects anyway) there is no legal requirement to put license headers in any of the files so long as the top-level LICENSE exists, it's just good practice.

What I had originally had in mind was something that would accept quoted text or a file argument on the command line and put the contents verbatim at the top of the file.  That's not very sophisticated I know, but I was thinking of a project build where the license snippets were stored as resources in the tree and used when invoking the thrift compiler to generate code.

But, this ticket was submitted a long time ago so this is something I've since implemented outside of Thrift.

> prepend texts to generated files
> --------------------------------
>
>                 Key: THRIFT-537
>                 URL: https://issues.apache.org/jira/browse/THRIFT-537
>             Project: Thrift
>          Issue Type: Wish
>          Components: Compiler (C#), Compiler (C++), Compiler (Cocoa), Compiler (Erlang), Compiler (General), Compiler (Haskell), Compiler (Java), Compiler (Perl), Compiler (PHP), Compiler (Python), Compiler (Ruby)
>            Reporter: Eric Evans
>
> It would be great if there were an option you could pass to the compiler in order to specify a file, the contents of which would be prepended to generated source as comments. This would be useful for license texts, copyright notices, disclaimers, etc.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-537) prepend texts to generated files

Posted by "Todd Lipcon (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-537?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12754262#action_12754262 ] 

Todd Lipcon commented on THRIFT-537:
------------------------------------

bq. So you'd have to decide if this header is language independent or not, and if any fields need to be substituted. 

Seems to me that the header should be language-dependent, given most of the time this will want to be a comment, and comment syntax is different. Given that many groups of languages share syntax, you should be able to specify a given header for a set of languages - perhaps with a '*' wildcard option.

As for substituted fields, I think the basics would be (1) username who ran thrift, (2) timestamp of generation, (3) absolute path of source file. But I don't see these features as crucial for the most common use case (license headers)

> prepend texts to generated files
> --------------------------------
>
>                 Key: THRIFT-537
>                 URL: https://issues.apache.org/jira/browse/THRIFT-537
>             Project: Thrift
>          Issue Type: Wish
>          Components: Compiler (C#), Compiler (C++), Compiler (Cocoa), Compiler (Erlang), Compiler (General), Compiler (Haskell), Compiler (Java), Compiler (Perl), Compiler (PHP), Compiler (Python), Compiler (Ruby)
>            Reporter: Eric Evans
>
> It would be great if there were an option you could pass to the compiler in order to specify a file, the contents of which would be prepended to generated source as comments. This would be useful for license texts, copyright notices, disclaimers, etc.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-537) prepend texts to generated files

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-537?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12897317#action_12897317 ] 

Bryan Duxbury commented on THRIFT-537:
--------------------------------------

Correct me if I'm wrong, but generally, I don't think there's any need to put license headers in generated content. I know that Thrift has avoided adding the ASL header to a bunch of files because they are generated. 

I think that including the variables you mentioned would be pretty much universally beneficial, though. Maybe they could be part of the autogen comment? What do people think?

> prepend texts to generated files
> --------------------------------
>
>                 Key: THRIFT-537
>                 URL: https://issues.apache.org/jira/browse/THRIFT-537
>             Project: Thrift
>          Issue Type: Wish
>          Components: Compiler (C#), Compiler (C++), Compiler (Cocoa), Compiler (Erlang), Compiler (General), Compiler (Haskell), Compiler (Java), Compiler (Perl), Compiler (PHP), Compiler (Python), Compiler (Ruby)
>            Reporter: Eric Evans
>
> It would be great if there were an option you could pass to the compiler in order to specify a file, the contents of which would be prepended to generated source as comments. This would be useful for license texts, copyright notices, disclaimers, etc.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.