Deploying Xtext parser along with the code generator [message #901691] |
Tue, 14 August 2012 03:49  |
Eclipse User |
|
|
|
Hi,
I have developed a grammar with Xtext and also the code generator with Xtend.
What I would like to do next is to deploy these two so that end users can utilize them.
That is, they can specify models following my grammar and obtain the generated code too through the code generator.
However, I could not find any well-defined tutorial or guide explaining how one can
deploy grammar + generator for end users.
So, I would be glad if someone could help me on this.
|
|
|
|
|
Re: Deploying Xtext parser along with the code generator [message #901866 is a reply to message #901828] |
Tue, 14 August 2012 16:21   |
Eclipse User |
|
|
|
Hi Christian,
First of all, thanks a lot for the reply.
I have built my grammar which is ambiguity-free, and subsequently developed the code generator through xtend.
Code generator serves its purpose correctly too. Indeed, I have tested the plug-in via the plugin.xml of the *.ui package.
Here, I have created model.dsl, following the grammar, which is once saved translated into another model through the code generator.
However, I wanted to let end users do the same -- i.e., creating a model following my grammar and then translating the model into another model
through the code generator.
To let this happen, I have attempted to export plug-ins -- via deployable plug-ins and fragments section. Then, I have tried to import these
three plug ins into another eclipse release that does not have xtext framework installed. However, this did not work. The parser imposing
the user to specify model correctly and the code generator did not work. After having imported the three plugins (dsl, dsl.tests, dsl.ui),
when I clicked the plugin.xml in the dsl.ui, the new instance of eclipse is run succesfully. However, it cannot function as editor for either grammar
and the code generator.
So, I am looking for a guide that helps me make this success.
THanks in advance.
|
|
|
|
|
|
|
|
Re: Deploying Xtext parser along with the code generator [message #901938 is a reply to message #901882] |
Wed, 15 August 2012 04:25   |
Eclipse User |
|
|
|
Hi Christian,
Thanks a lot for showing me how to export and then import what has been exported.
Once I followed what you suggested, there has appeared the following error during the import stage (i.e., through the install new software..):
An error occurred while collecting items to be installed
session context was:(profile=SDKProfile, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=).
Problems downloading artifact: osgi.bundle,org.eclipse.xtext.xtext.ui.examples,2.1.1.v201111141332.
File has invalid content:C:\Users\CITY-A~1\AppData\Local\Temp\signatureFile8654316798185231099.jar
Invalid content:.project
A file ".project" has been removed from the jar: C:\Users\CITY-A~1\AppData\Local\Temp\signatureFile8654316798185231099.jar
Invalid content:.settings/org.eclipse.pde.prefs
A file ".settings/org.eclipse.pde.prefs" has been removed from the jar: C:\Users\CITY-A~1\AppData\Local\Temp\signatureFile8654316798185231099.jar
Invalid content:.settings/org.eclipse.jdt.core.prefs
A file ".settings/org.eclipse.jdt.core.prefs" has been removed from the jar: C:\Users\CITY-A~1\AppData\Local\Temp\signatureFile8654316798185231099.jar
Invalid content:.settings/org.eclipse.jdt.ui.prefs
A file ".settings/org.eclipse.jdt.ui.prefs" has been removed from the jar: C:\Users\CITY-A~1\AppData\Local\Temp\signatureFile8654316798185231099.jar
Invalid content:.settings/org.eclipse.core.resources.prefs
A file ".settings/org.eclipse.core.resources.prefs" has been removed from the jar: C:\Users\CITY-A~1\AppData\Local\Temp\signatureFile8654316798185231099.jar
Invalid content:.classpath
A file ".classpath" has been removed from the jar: C:\Users\CITY-A~1\AppData\Local\Temp\signatureFile8654316798185231099.jar
Invalid content:build.properties
A file "build.properties" has been removed from the jar: C:\Users\CITY-A~1\AppData\Local\Temp\signatureFile8654316798185231099.jar
Invalid content:.settings/org.eclipse.jdt.launching.prefs
A file ".settings/org.eclipse.jdt.launching.prefs" has been removed from the jar: C:\Users\CITY-A~1\AppData\Local\Temp\signatureFile8654316798185231099.jar
Before exporting my plugins, I have also chosen from the *build* tab of the feature xml both the .project and build.properties.
So, did I do the same for the plugin xml files too that the feature manages. However, the error stays the same that occurs after I click *finish* for adding the plug-in.
|
|
|
|
|
|
|
|
Re: Deploying Xtext parser along with the code generator [message #901965 is a reply to message #901964] |
Wed, 15 August 2012 06:55   |
Eclipse User |
|
|
|
I use Eclipse indigo, version 3.7.0 .
I do not get any error message while exporting the feature project into a folder--export process is performed succesfully.
The export folder contains the following items: features folder, plugins folder,artifacts.jar and contents.jar .
Then, I use another eclipse installation which is again indigo being the version 3.7.0 . However, this one, unlike the former one, is free of any Xtext, and Xtend frameworks.
So, once I tried to install the plugin by choosing "install new software" from the "help", and then specifying the pat of the export folder , the installation has started without any problem. But, before it terminates, the above specified error occurred.
It might be the case the the feature.xml requires further customization, about which I genuinely do not have an idea.
|
|
|
|
|
|
|
|
|
|
|
Re: Deploying Xtext parser along with the code generator [message #902081 is a reply to message #902035] |
Wed, 15 August 2012 14:43  |
Eclipse User |
|
|
|
Hi,
to your first question:
is said: i took an eclipse without Xtext installed.
it works for me even with Eclipse Classic.
=> please recheck with a clean generated Xtext project without any customizations.
maybe your xtext is broken. maybe your eclipse is broken.
which os do you use? ....
i have NO idea! sorry
to your second question: create a java main class that does your stuff (e.g. by changing the workflow to)
fragment = generator.GeneratorFragment {
generateMwe = false
generateJavaMain = true
}
then use the Export -> Runnable Jar File Wizard to export the code including dependenies
~Christian
|
|
|
Powered by
FUDForum. Page generated in 0.07466 seconds