Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Deploying Xtext parser along with the code generator
Deploying Xtext parser along with the code generator [message #901691] Tue, 14 August 2012 07:49 Go to next message
mcse mcse is currently offline mcse mcseFriend
Messages: 53
Registered: August 2012
Member
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 #901786 is a reply to message #901691] Tue, 14 August 2012 15:13 Go to previous messageGo to next message
mcse mcse is currently offline mcse mcseFriend
Messages: 53
Registered: August 2012
Member
Hi all,
is there really nobody who can provide me with some help ?
Re: Deploying Xtext parser along with the code generator [message #901828 is a reply to message #901786] Tue, 14 August 2012 17:28 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

i am not quite sure what your question is targeting
- do you want to deploy plugins into any eclipse
- do you want to create an eclipse rcp?
both can be done with std eclipse means and is not at all xtext specific.
in xtext 2.3.0 you get even an feature.xml generated that you can use the "export deployable features" wizard.

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Deploying Xtext parser along with the code generator [message #901866 is a reply to message #901828] Tue, 14 August 2012 20:21 Go to previous messageGo to next message
mcse mcse is currently offline mcse mcseFriend
Messages: 53
Registered: August 2012
Member
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 #901867 is a reply to message #901866] Tue, 14 August 2012 20:28 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

you have to make sure dependencies (Xtext, Xtend ...) are available too.
as i said this is a std eclipse problem so some general reading will help.

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Deploying Xtext parser along with the code generator [message #901869 is a reply to message #901867] Tue, 14 August 2012 20:39 Go to previous messageGo to next message
mcse mcse is currently offline mcse mcseFriend
Messages: 53
Registered: August 2012
Member
Hi Christian,
I am aware of this and have chosen to "add required dependencies" from the Organise Manifests Wizard of the plugin.xml. However,
I keep getting the same error.
Re: Deploying Xtext parser along with the code generator [message #901875 is a reply to message #901869] Tue, 14 August 2012 21:00 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

here is what i do
(1) export the stuff
(2) take an eclipse without xtext
(3) add the exported stuff as (local) update site within that eclipse
(4) select the dsl feature
(5) install the feature. it will install dependent stuff from juno update site automatically

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Deploying Xtext parser along with the code generator [message #901881 is a reply to message #901875] Tue, 14 August 2012 21:19 Go to previous messageGo to next message
mcse mcse is currently offline mcse mcseFriend
Messages: 53
Registered: August 2012
Member
Hi Christian,

I have simply use "Import" facility to import plug-ins. In fact, I genuinely do not have an idea as to how to create
an update site for the plug ins exported. Nor am I sure that it would solve my problem.
Do you use "help" tab and choose "install new software" ? Then is what you do just clicking "add" to add plug-ins from the archive ?

Thanks
Re: Deploying Xtext parser along with the code generator [message #901882 is a reply to message #901881] Tue, 14 August 2012 21:24 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

you export the plugin via

rightclick on the feature xml -> Export -> Deployable features
in the wizard you select a target dirb
make sure generate metadata rep is selected at the second tab
and hit finish

in the other eclipse goto

Help -> Install new Software -> Add -> Local (select export folder here)
select the feature (you may have to deselect categorize option if you did not create a category.xml and selected it during export)
hit finish


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Deploying Xtext parser along with the code generator [message #901938 is a reply to message #901882] Wed, 15 August 2012 08:25 Go to previous messageGo to next message
mcse mcse is currently offline mcse mcseFriend
Messages: 53
Registered: August 2012
Member
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 #901942 is a reply to message #901938] Wed, 15 August 2012 08:38 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Create a new project with the wizard and try it with this one

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Deploying Xtext parser along with the code generator [message #901946 is a reply to message #901942] Wed, 15 August 2012 09:00 Go to previous messageGo to next message
mcse mcse is currently offline mcse mcseFriend
Messages: 53
Registered: August 2012
Member
Hi Christian,
I am afraid I could not understand what I need to do.
Do you mean that I should create an update-site project managing the plug ins ? If so, I have already created one; but how is it possible to make it accessible via a url ?
Re: Deploying Xtext parser along with the code generator [message #901952 is a reply to message #901946] Wed, 15 August 2012 09:33 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
No everything you need is there. You simply export it via wizard and
can use it

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Deploying Xtext parser along with the code generator [message #901955 is a reply to message #901952] Wed, 15 August 2012 09:54 Go to previous messageGo to next message
mcse mcse is currently offline mcse mcseFriend
Messages: 53
Registered: August 2012
Member
I created a feature project managing the plug-ins and subsequently exported the project itself as deployable features.
Then, I tried to add the feature through the "install new software" option in the help section of a different eclipse installation.
However, again got the same error. Sad
Re: Deploying Xtext parser along with the code generator [message #901964 is a reply to message #901955] Wed, 15 August 2012 10:41 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hard to say what you do. Do you have the Juno update site configured
in your eclipse? Is it active. Do you get an error message during
installation? Can you share a reproducable example? What eclipse do
you try to install the plugins to....

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Deploying Xtext parser along with the code generator [message #901965 is a reply to message #901964] Wed, 15 August 2012 10:55 Go to previous messageGo to next message
mcse mcse is currently offline mcse mcseFriend
Messages: 53
Registered: August 2012
Member
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 #901969 is a reply to message #901965] Wed, 15 August 2012 11:05 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi maybe you have to add the composite update site for Xtext indigo.
See your eclipse with Xtext installed (don't know it without Google
:-))

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Deploying Xtext parser along with the code generator [message #901979 is a reply to message #901969] Wed, 15 August 2012 11:48 Go to previous messageGo to next message
mcse mcse is currently offline mcse mcseFriend
Messages: 53
Registered: August 2012
Member
Hi Christian,
Yes, once I have tried to import inside the Eclipse installation that has Xtext framework installed,
it worked !!
Thanks a lot for spotting this.

However, this raises such a constraint that our plugins can only be used in Eclipse installations with
xtext framework installed. This would not sound nice to the end users. Sad
Re: Deploying Xtext parser along with the code generator [message #901988 is a reply to message #901979] Wed, 15 August 2012 12:10 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
As I said I downloaded an eclipse Juno for java defs.
This has no Xtext installed. Never the less it was automatically
installed when I installed the DSL plugin. (Eclipse update site
magic)

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Deploying Xtext parser along with the code generator [message #901991 is a reply to message #901988] Wed, 15 August 2012 12:22 Go to previous messageGo to next message
mcse mcse is currently offline mcse mcseFriend
Messages: 53
Registered: August 2012
Member
I have just tried with Juno release of eclipse, however, it raises a dependency conflict error.
Once I attempted to install the exported plugin via "install new software" feature of Juno, the following error code raised:
Cannot complete the install because of a conflicting dependency.
Software being installed: XCD 1.0.0.201208151223 (XCD.feature.group 1.0.0.201208151223)
Software currently installed: Eclipse SDK 4.2.0.I20120608-1400 (org.eclipse.sdk.ide 4.2.0.I20120608-1400)
Only one of the following can be installed at once:
Equinox Provisioning Legacy Update Site Support 1.0.400.v20120412-1615 (org.eclipse.equinox.p2.updatesite 1.0.400.v20120412-1615)
Equinox Provisioning Legacy Update Site Support 1.0.300.v20110510 (org.eclipse.equinox.p2.updatesite 1.0.300.v20110510)
Cannot satisfy dependency:
From: XCD 1.0.0.201208151223 (XCD.feature.group 1.0.0.201208151223)
To: org.eclipse.equinox.p2.updatesite [1.0.300.v20110510]
Cannot satisfy dependency:
From: Equinox p2 Provisioning for IDEs. 2.2.0.v20120524-0542-62DG9JXTlSiz-UbcP0w0KGe8CBOP (org.eclipse.equinox.p2.user.ui.feature.group 2.2.0.v20120524-0542-62DG9JXTlSiz-UbcP0w0KGe8CBOP)
To: org.eclipse.equinox.p2.updatesite [1.0.400.v20120412-1615]
Cannot satisfy dependency:
From: Eclipse SDK 4.2.0.I20120608-1400 (org.eclipse.sdk.ide 4.2.0.I20120608-1400)
To: org.eclipse.equinox.p2.user.ui.feature.group [2.2.0.v20120524-0542-62DG9JXTlSiz-UbcP0w0KGe8CBOP]

Re: Deploying Xtext parser along with the code generator [message #901992 is a reply to message #901991] Wed, 15 August 2012 12:23 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi use Xtext Juno as well to export your plugin ( try it with the
greeting example)

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Deploying Xtext parser along with the code generator [message #902005 is a reply to message #901992] Wed, 15 August 2012 13:10 Go to previous messageGo to next message
mcse mcse is currently offline mcse mcseFriend
Messages: 53
Registered: August 2012
Member
Hi Christian,
That should also be fine too -- the eclipse installation that has xtext framework installed should not pose any issue for the plugin installation.
however, what if the end user would not like to use the plugins with Eclipse installations that do not have Xtext installed ?
The plug in should also be imported into such eclipse tools.
The less the end user are burdened, the more they like the plugins.
Re: Deploying Xtext parser along with the code generator [message #902011 is a reply to message #902005] Wed, 15 August 2012 13:36 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi as I said: it will work automatically. Alternatively you should
considering an eclipse product instead (everything pre installed)

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Deploying Xtext parser along with the code generator [message #902035 is a reply to message #902011] Wed, 15 August 2012 15:17 Go to previous messageGo to next message
mcse mcse is currently offline mcse mcseFriend
Messages: 53
Registered: August 2012
Member
Hi Christian,
it did not work when I tried. If the eclipse installation does not have Xtext installed, the conflicting dependency error is raised, as I have given above.
So, would you please be more precise as to how it will be automatic for a classic release of eclipse ?

Also, I have one more question to you for which the help would be highly appreciated.
I also consider deploying the plug-ins as standalone tools so that end user can run them without the need of eclipse platform.
Can you suggest a way of doing this please ?

Thanks in advance.
Re: Deploying Xtext parser along with the code generator [message #902081 is a reply to message #902035] Wed, 15 August 2012 18:43 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
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


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Customize code checker
Next Topic:Xtext without code generation
Goto Forum:
  


Current Time: Thu Apr 18 12:34:07 GMT 2024

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

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

Back to the top