Code that imports a parse table using import-term, for example:

import-term(lib/JavaCompilationUnit-15.tbl)

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 https://yellowgrass.org/issue/DynSem/20 where the deployed DynSem crashes but the same version if opened in the workspace works fine.

Eclipse: org.eclipse.epp.package.standard.feature.feature.group 4.4.2.20150219-0708
Spoofax: org.metaborg.spoofax.eclipse 1.5.0.20160111-140753-new-spoofax-plugin
System: Mac OS X x86_64 10.11.2
Submitted by Vlad Vergu on 11 January 2016 at 15:31

On 11 January 2016 at 15:56 Gabriël Konat commented:

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 build tag:

<resources>
  <resource>
    <directory>lib</directory>
    <targetPath>lib</targetPath>
  </resource>
</resources>

That will include the entire lib directory into the packaged language artifact.

Also, it looks like the org.strategoxt.lang.ImportTerm implementation 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.


On 12 January 2016 at 01:43 Daco Harkes commented:

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.)


On 12 January 2016 at 11:16 Vlad Vergu commented:

These solutions do work for me. Thank you!


On 12 January 2016 at 15:28 Gabriël Konat closed this issue.

On 17 March 2016 at 15:34 Gabriël Konat commented:

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