Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EclipseKeys.eclipseOutput isn't used for play generated routes #308

Open
jkleckner opened this issue Dec 22, 2015 · 1 comment
Open

EclipseKeys.eclipseOutput isn't used for play generated routes #308

jkleckner opened this issue Dec 22, 2015 · 1 comment

Comments

@jkleckner
Copy link

Using bin as the default output directory for eclipse generated class files can be problematic for projects that use that directory for scripts or other purposes. But if I override the eclipseOutput variable by adding the following line to build.sbt it isn't used as the target for Play Framework generated route files:

EclipseKeys.eclipseOutput in ThisBuild := Some(".target/bin")

To reproduce this in a Play Framework:

  • Add the line above to build.sbt.
  • Re-create the eclipse settings for example with: sbt 'eclipse with-source=true skip-parents=false'
  • Open your project in Eclipse and clean the project to force a build
  • Observe that there are files in both bin/ and .target/bin such as bin/Routes.class and .target/bin/routes
    The .classpath has entries to store some but not all objects in the dir (note in particular the last entry):
  <classpathentry output=".target/bin" kind="src" path="app-2.11"/>
  <classpathentry output=".target/bin" kind="src" path="app"/>
  <classpathentry output=".target/bin" kind="src" path="conf"/>
  <classpathentry output=".target/bin" kind="src" path="test/resources"/>
  <classpathentry output=".target/bin" kind="src" path="test-2.11"/>
  <classpathentry excluding="resources/" output=".target/bin" kind="src" path="test"/>
  <classpathentry kind="output" path="bin"/>

Glancing at the source, it appears that settings are using createSrc here and here but that the createSrc implementation does not use the setting. Should it use the eclipseOutput function to set this?
Empirically, if I manually edit the last entry from above to be the following, the source is all put in the proper place:

  <classpathentry kind="output" path=".target/bin"/>

It looks to my eye as though this line is where all the uses of "bin" could properly be set to the eclipseOutput setting.
Separately, not everyone on our team uses Eclipse, so it would be nice to be able to set this default in the global plugin settings without having to alter all the build.sbt files with tooling. Is there some way to do this?

@jkleckner
Copy link
Author

Looks like fixing this bug requires a substantial investment in learning scalaz. Anyone familiar see how to apply the eclipseOutput setting to the kind=output directory path?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant