metaborg / spoofax-pie

Spoofax implementation using PIE pipelines
Apache License 2.0
12 stars 9 forks source link

Source exports should be language specific #125

Open Apanatshka opened 1 year ago

Apanatshka commented 1 year ago

Summary

When you use export sources to depend on them in another project, you use something like:

stratego {
  source = files {
    export-directory = ./src/
    export-directory = ./build/generated/sources/metalang/stratego
    sdf3-statix-explication-generation = true
  }
}

This should provide access to only the stratego files in those directories, when another project adds a build-dependency to it. But instead all files are passed along. This results in e.g. src/start.sdf3 being found in the other project, and Stratego files are generated from it in the depending project. Whereas that's what we are exporting build/generated/sources/metalang/stratego. These duplicate Stratego files cause problems (e.g. duplicate definitions with types).

What you did

Create two basic, tiny, spoofax projects, put files of the first in a subdir of src for clarity, add Stratego exports to the first, a build-dependency on the first in the second, build the second, notice files generated with the subdir name of the first.

What you expected to happen

SDF3 files get ignored in an export-directory only mentioned in the Stratego block.

What actually happened

SDF3 files are included in the source-generation of a project that imports the project that exports a directory that contains an SDF3 file, even though the dir was exported in the Stratego block.

Context

Additional information