Clean doesn't remove src-gen directory
Since the
src-gen
directory contains only generated files, I believe it should be removed/cleared out when cleaning a project.(By the way, in
Submitted by D. Pelsmaeker on 22 July 2014 at 15:19build.generated.xml
there is some cleaning of${src-gen}
, but that refers to theeditor/java
directory.)
Issue Log
In the build file,
src-gen
refers to the directory where the generated Java files from Stratego source files will end up, if building to a JAR.
In this case, the
build.generated.xml
is still considering the old implementation in which there was no src-gen folder.
I am refactoring it to use Ant macros and to deal with the new location of the generated files.
The generated Java files can also go into
src-gen/editor/java
. We can then letsrc-gen
to thesrc-gen
directory and introduce another variable forsrc-gen/editor/java
.
Probably best to do that in another refactoring.
In Spoofax-1.4, clean removes the contents of all folders in
src-gen
. Spoofax copies SDF2 files fromsyntax
tosrc-gen/syntax
at the start of each build, but it seems that when the build depends on copied SDF2 files (e.g., modules instantiatingStategoMix
) the first build after clean fails, reporting that it cannot find the copied file in the include path. After (manually) refreshing Eclipse, the copied file appears in the navigation, and repeating the build succeeds. Is this perhaps a bug in build.generated.xml?
@pdmosses: In which target the ant build fails? What I tried here was, given the Entity project, I generated just the SDF2 files from the SDF3 files, copied them to
syntax
, deleted the SDF3 files, fixed all dependencies on the generated Stratego files from SDF3, and cleaned the project.
Indeed the copied SDF2 files do not show insrc-gen/syntax
after the first build, but at least in this case the build succeeded.
I will add thesrc-gen
folder to the refresh target because it was not part of it, but I’m not sure if this will fix the failing build issue.
It’s right at the end:
stratego.jvm.helper: [java] cannot find the parse table for syntax "Stratego-CL" in the include path [java] parse error in /Volumes/HDD/pdm/SVN/CL-Editor/trans/generate.str [java] parse error in /Volumes/HDD/pdm/SVN/CL-Editor/trans/generate.str
Stratego-CL.sdf
is the only SDF2 file insyntax
. Previously in the same build, it correctly reported copying it:copy-sdf2: [copy] Copying 1 file to /Volumes/HDD/pdm/SVN/CL-Editor/src-gen/syntax
Could Eclipse Workspace preferences affect refreshing during building? I have “Refresh on access” set, but not “Refresh using native hooks or polling”.
Ok, I think I understand it now. I believe it is not a problem of copying the SDF2 file nor generating the parse table, but how the mixed grammar tables are managed in Spoofax. I know that there is an old (annoying) issue of when you build a mixed grammar parse table, you have to restart Eclipse for it to actually work with your changes in the grammar, but I don’t know if it is actually related with that.
The parse table is definitely there, as previous targets such aspack-sdf
andsdf2table
that come before thanstratego.jvm.helper
and depend on the copied SDF2 file succeeded.
I think this issue is more related on how the Stratego compiler loads these resources when/before running.
@Gabriël, do you know something about it?
Log in to post comments