import-term strategy cannot find files
Code that imports a parse table using import-term, for example:
Can no longer find the file if the language project that contains the transformation is deployed in the Eclipse rather than open in the workspace. Triggering issue for this report is http://yellowgrass.org/issue/DynSem/20 where the deployed DynSem crashes but the same version if opened in the workspace works fine.Submitted by Vlad Vergu on 11 January 2016 at 15:31
Eclipse: org.eclipse.epp.package.standard.feature.feature.group 22.214.171.12450219-0708 Spoofax: org.metaborg.spoofax.eclipse 126.96.36.19960111-140753-new-spoofax-plugin System: Mac OS X x86_64 10.11.2
That file is probably not packaged into the language artifact, so it cannot be found when the language is packaged or deployed. You can package the file by including the following in your POM file, inside the
<resources> <resource> <directory>lib</directory> <targetPath>lib</targetPath> </resource> </resources>
That will include the entire
libdirectory into the packaged language artifact.
Also, it looks like the
org.strategoxt.lang.ImportTermimplementation is wrong, it doesn’t use the IOAgent to locate the file but rather does some JAR magic. That may also cause things to not work even if the file is packaged.
It will work with:
<resources> <resource> <directory>./</directory> <includes> <include>lib-java/**/*</include> <include>lib-webdsl/**/*</include> <include>lib/webdsl/HQL-pretty.pp.af</include> <include>lib/webdsl/WebDSL-pretty.pp.af</include> </includes> </resource> </resources>
This puts the included files and folders exactly in the same place in the jar as in the language project. (See Relations project on Github.)
These solutions do work for me. Thank you!
This was still broken when using JAR as Stratego target, and if the language was deployed, e.g. as part of an Eclipse plugin or through use in Sunshine/Maven. The cause was not copying parse tables and pretty print tables to compiled Stratego class files (for packaging in the Stratego JAR file). This is now fixed.
Log in to post comments