Karsten,
My idea was actually to use another file extension (.expt for encrypted xpand templates) and register a new resourceContributor for this. I would like the new resourceContributor to extend the one for .xpt-files (XpandResourceParser) since I only need to provide another reader and the rest of the functionality is the same.
I will raise a bug with a proposed solution.
Best regards
Mattias
Från: m2t-dev-bounces@xxxxxxxxxxx [mailto:m2t-dev-bounces@xxxxxxxxxxx] För Karsten Thoms
Skickat: den 9 januari 2013 12:09
Till: Model to Text
Ämne: Re: [m2t-dev] Extending resource contributors
the extension point org.eclipse.xtend.shared.ui.resourceContributor is used to provide the parsers. However, the Xpand related resources are already covered by the existing contributors. Adding an additional resourceContributor would not work, since the order of contributors is not deterministic. I guess what you actually need is a way to override the existing resourceContributor. I could imagine an extension of the extension point that allows redefinition of existing resourceContributors would be an option.
However, I think a challenge is to avoid breaking existing API. If you have an idea, then raise a bug.
Note that this mailing list is for internal discussion only. Use the forum
We are using Xpand to create code generators for our software platform. We want to distribute the generator templates together with our open source code, but since we consider the templates our IP we want to make them unreadable. Our current approach is to encrypt them and let a custom resourceContributor handle the decryption before xpand evaluates the templates. When implementing the new resourceContributors I have run into some problems. I would like to reuse the existing resourceContributors (org.eclipse.xpand.ui.core.internal.builder.XpandResourceParser, org.eclipse.xtend.ui.core.internal.builder.XtendResourceParser and org.eclipse.xtend.check.ui.core.internal.builder.CheckResourceParser). However, the package runtime export rules of the plugins prohibit me from extending these. It is also not possible to use a wrapper class since XpandResourceImpl, XtendResourceImpl and CheckResourceImpl are protected.
Would it be possible to export the needed packages from the plugins? I could contribute a patch for this if you think that it is a good solution. Otherwise, do you have any other suggestion on how to solve my problem?
_______________________________________________
m2t-dev mailing list
m2t-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2t-dev