Skip to main content



      Home
Home » Modeling » TMF (Xtext) » How to add copyright headers to generated sources
How to add copyright headers to generated sources [message #793531] Wed, 08 February 2012 03:55 Go to next message
Eclipse UserFriend
First I have to ask if I am allowed to add a copyright header to the generated Xtext sources.

Concerning the EMF generator I found a statement from Ed Merks
(see http://www.eclipse.org/forums/index.php/t/17839/).

Quote:
... in my opinion the input to the generator is your intellectual property, has your copyright and your license, and the generator injects nothing into the result. I.e., it's no different than a compiler generating byte code. This has always been my and IBM's position for the EMF generator, so for that I can make the statement definitively.

Is this also true for the Xtext generator?

Then the technical question:
Is there a recommended way to extend the generator to add a specific header to all generated files ?

Thanks in advance.
Harald
Re: How to add copyright headers to generated sources [message #793543 is a reply to message #793531] Wed, 08 February 2012 04:14 Go to previous messageGo to next message
Eclipse UserFriend
A look at org.eclipse.xtext.xbase.compiler.JvmModelGenerator suggests there's no built-in way to do this. But you can always extend that (Xtend) class, override the generateType function to include a copyright header and re-bind the extended class to IGenerator in .ui project.
Re: How to add copyright headers to generated sources [message #793555 is a reply to message #793531] Wed, 08 February 2012 04:25 Go to previous messageGo to next message
Eclipse UserFriend
Hi Harald,

you are free to add whatever header you want to your files. But as
Meinte already pointed out, there's currently no hook that explicitly
takes care of that. Please feel free to file a ticket.

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 08.02.12 09:55, schrieb Harald M:
> First I have to ask if I am allowed to add a copyright header to the
> generated Xtext sources.
>
> Concerning the EMF generator I found a statement from Ed Merks
> (see http://www.eclipse.org/forums/index.php/t/17839/).
>
> Quote:
>> ... in my opinion the input to the generator is your intellectual
>> property, has your copyright and your license, and the generator
>> injects nothing into the result. I.e., it's no different than a
>> compiler generating byte code. This has always been my and IBM's
>> position for the EMF generator, so for that I can make the statement
>> definitively.
>
> Is this also true for the Xtext generator?
>
> Then the technical question:
> Is there a recommended way to extend the generator to add a specific
> header to all generated files ?
>
> Thanks in advance.
> Harald
>
Re: How to add copyright headers to generated sources [message #793611 is a reply to message #793555] Wed, 08 February 2012 05:47 Go to previous messageGo to next message
Eclipse UserFriend
Probably we could extend a kind-of-similar one that I filed: https://bugs.eclipse.org/bugs/show_bug.cgi?id=368296

Thoughts?

Thanks,
-Alex
Re: How to add copyright headers to generated sources [message #793822 is a reply to message #793611] Wed, 08 February 2012 11:07 Go to previous messageGo to next message
Eclipse UserFriend
Thats a good idea.

I will file a feature request and add a reference to your ticket.

Thanks,
Harald
Re: How to add copyright headers to generated sources [message #870105 is a reply to message #793531] Sun, 06 May 2012 10:16 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

just wanted to follow up, has there anything been done on the topic of adding headers to generated files? The ticket that has been mentiones doesn't say it's been implemented.

Thanks,
Tobi
Re: How to add copyright headers to generated sources [message #870110 is a reply to message #870105] Sun, 06 May 2012 11:24 Go to previous messageGo to next message
Eclipse UserFriend
What about simply adding a custom xpand post processor to the
generator component in the GenerateYourDsl.mwe2 workflow
Re: How to add copyright headers to generated sources [message #873054 is a reply to message #870110] Thu, 17 May 2012 08:19 Go to previous messageGo to next message
Eclipse UserFriend
I'm not sure if I understand correctly but what about java files generated from my xtend files? Do I have influence on the generation process there?
Re: How to add copyright headers to generated sources [message #873073 is a reply to message #873054] Thu, 17 May 2012 09:12 Go to previous messageGo to next message
Eclipse UserFriend
No,

i am talking about the Fragments that Generate the code using Xpand

~Christian
Re: How to add copyright headers to generated sources [message #888099 is a reply to message #873073] Sun, 17 June 2012 13:34 Go to previous messageGo to next message
Eclipse UserFriend
Just to clarify, when I have a [name].xtend file in my workspace that, when changed, regenerates a corresponding [name].java file in the xtend-src firectory, that java file can't have a licence header added to it?
Re: How to add copyright headers to generated sources [message #888137 is a reply to message #888099] Sun, 17 June 2012 14:49 Go to previous message
Eclipse UserFriend
Hi,

yes. at least if you do not want to add the header as part of the classes javadoc.

~Christian

[Updated on: Sun, 17 June 2012 14:52] by Moderator

Previous Topic:QualifiedName resolving
Next Topic:How to limit the global scope
Goto Forum:
  


Current Time: Sun Jul 06 21:32:29 EDT 2025

Powered by FUDForum. Page generated in 0.07572 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top