metaborg / spoofax-pie

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

Importing a language project into the Eclipse LWB is error-prone #92

Open Gohla opened 2 years ago

Gohla commented 2 years ago

Summary

Importing a language project into the Eclipse LWB is error-prone

What you did

Import a language project into the Eclipse LWB.

What you expected to happen

Building that language project to succeed.

What actually happened

Building that language project failed due to many duplicate definitions. This is caused by Eclipse copying the entire project to the bin directory after importing it, and this in turn is caused by a missing .classpath file.

Context

Additional information

It should be possible to import a language project into the Eclipse LWB without requiring a .project and .classpath file to be checked into source control. Although the .project file is OK to check-in, the .classpath file is not as it contains file references on the local filesystem.

I see a couple of ways to solve the problem:

  1. ignore bin directories in all meta-languages.
  2. create a builder that always runs before the Java builder that sets up the classpath.
  3. move the Spoofax 3 classpath into some kind of variable, like the org.eclipse.jdt.launching.JRE_CONTAINER variable, such that the .classpath file can be checked into source control.
  4. create an Eclipse project importer for Spoofax 3 language projects based on spoofaxc.cfg files such that .project and .classpath do not need to be checked into source control at all.

in descending order of speed/hackyness.

Gohla commented 2 years ago

Currently working around the problem by ignoring the bin directory by https://github.com/metaborg/spoofax-pie/commit/c9d5d8f7a84be6522b98bc00575096e71d30fa61