|
|
Re: Problems Using XText Language in Java project. [message #1736281 is a reply to message #1736104] |
Tue, 28 June 2016 08:18   |
Eclipse User |
|
|
|
On 27/06/2016 13:57, Sam Patterson wrote:
> Hello,
>
> I followed Sebastian Zarnekow's guide on how to export an XText language
> and use it in a standalone project.
>
> However I'm getting the following error when attempting to validate the
> language:
>
> "The string resource '_UI_DiagnosticRoot_diagnostic' could not be located"
>
> Could it be something to do with how the JAR is exported? When exporting
> I chose the "Export required libraries into generated JAR", however if I
> use 2nd option eclipse tells me it cannot find the main class for the
> project.
>
> Anyone help is appreciated :)
>
>
Hi
If I remember correctly, you should export the jar with all dependencies
packed as jars into the exported jar, and NOT as extracted into the
packed jars. Otherwise the properties files and manifests will override
each others and EMF won't be able to find the properties containing the
substitutions for the strings.
hope this helps
Lorenzo
--
Prof. Lorenzo Bettini, Computer Science, DISIA, Univ. Firenze
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book
|
|
|
|
|
|
|
|
Re: Problems Using XText Language in Java project. [message #1738088 is a reply to message #1738085] |
Fri, 15 July 2016 16:36   |
Eclipse User |
|
|
|
p.s. i did the following
(1) create a new xtext project.
(2) adapt workflow to generate java main for generator
(3) generate lang
(4) run generated java main once
(5) use the export as runnable jar file, tell it to create a ant file
(6) copy the ant file to the project
(7) adapted the ant file to include another file at the end
<fileset dir="${dir.workspace}/org.xtext.example.mydsl2/">
<include name="plugin.properties"/>
</fileset>
( create org.xtext.example.mydsl2/plugin.properties as follows
_UI_DiagnosticRoot_diagnostic=Dont Care
well i was too lazy to look up the real values and the other key value pairs
(9) rerun ant file
(10) have fun
if id be an ant wizard i would somehow adapt the build.xml to create a plugin.properties that contains all plugin.properties of the unpacked files merged
unfortunately i am not an ant wizard
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04125 seconds