Skip to content
This repository has been archived by the owner on May 9, 2019. It is now read-only.

Generating eclipse descriptors before compiling is unsupported #23

Closed
ignasi35 opened this issue Feb 24, 2017 · 17 comments
Closed

Generating eclipse descriptors before compiling is unsupported #23

ignasi35 opened this issue Feb 24, 2017 · 17 comments

Comments

@ignasi35
Copy link
Contributor

Importing a play project into eclipse requires (https://www.playframework.com/documentation/2.5.x/IDE#Setup-sbteclipse):
sbt clean compile eclipse

instead of simply

sbt eclipse

That is because compile creates some sources that sbt eclipse must also consider when creating the eclipse project files.

This is currently undocumented.

NOTE: does it affect online-auction-java too?

@TimMoore
Copy link

@ignasi35 should we be adding this to the IDE docs in Lagom rather than here?

@ignasi35
Copy link
Contributor Author

That's a good point. I'd say we add it both places:

  • here as a quick-copy-paste command
  • lagom docs as a fully detailed step-by-step, x-ref to sbt-eclipse and play

@ignasi35
Copy link
Contributor Author

On second thought... this issue applies to sbt+play+eclipse only and it's already documented in Play docs (see link above). I would only document it here.

@ignasi35
Copy link
Contributor Author

ignasi35 commented Mar 7, 2017

Alternatively we could have the eclipse task in sbt to run compile first.

@TimMoore
Copy link

TimMoore commented Mar 8, 2017

@ignasi35 what's the symptom of this bug? It seems to import successfully for me (after running git clean -dxf to make sure it was the same as a clean clone and sbt eclipse as the very next command). I don't know what I'm looking for, though.

@ignasi35
Copy link
Contributor Author

ignasi35 commented Mar 8, 2017

Freshly clone, run sbt eclipse and import into eclipse.

There's missing folders created when a Play compilation happens which were not included into Eclipse descriptor files causing Eclipse to complain.

I've tried to reproduce today and failed. This could be fixed as a side effect of bumping sbt-eclipse version to 5.1.0.

I'll close this until we observe it again.

@ignasi35 ignasi35 closed this as completed Mar 8, 2017
@ignasi35 ignasi35 reopened this Mar 8, 2017
@ignasi35
Copy link
Contributor Author

ignasi35 commented Mar 8, 2017

Just saw #32.
@yg-apaza can you comment on the steps to reproduce?
I tried testing with latest master and I'm not sure this issue (and #32) apply anymore.

@yg-apaza
Copy link
Contributor

yg-apaza commented Mar 8, 2017

Reproduction

  1. Delete all projects from Eclipse workspace
  2. Run git clean -dfx
  3. Run sbt eclipse
  4. Import projects in Eclipse

Expected Behavior

webGateway project should be imported successfully with no errors.
webGateway project should include this packages:

  • app
  • conf
  • target/scala-2.11/twirl/main
  • target/scala-2.11/routes/main

Actual Behavior

webGateway includes 2 packages:

  • app
  • conf

webGateway is imported but shows this 16 errors.

not found: object router	Loader.scala	/webGateway/app	line 14	Scala Problem
not found: type Routes	Loader.scala	/webGateway/app	line 33	Scala Problem
not found: value foundationFieldConstructor	package.scala	/webGateway/app/controllers	line 6	Scala Problem
not found: value routes	AbstractController.scala	/webGateway/app/controllers	line 24	Scala Problem
not found: value routes	ItemController.scala	/webGateway/app/controllers	line 45	Scala Problem
not found: value routes	ItemController.scala	/webGateway/app/controllers	line 138	Scala Problem
not found: value routes	ItemController.scala	/webGateway/app/controllers	line 156	Scala Problem
not found: value routes	Main.scala	/webGateway/app/controllers	line 41	Scala Problem
object createUser is not a member of package views.html	Main.scala	/webGateway/app/controllers	line 28	Scala Problem
object createUser is not a member of package views.html	Main.scala	/webGateway/app/controllers	line 36	Scala Problem
object editItem is not a member of package views.html	ItemController.scala	/webGateway/app/controllers	line 27	Scala Problem
object editItem is not a member of package views.html	ItemController.scala	/webGateway/app/controllers	line 35	Scala Problem
object foundationFieldConstructor is not a member of package views.html	package.scala	/webGateway/app/controllers	line 2	Scala Problem
object index is not a member of package views.html	Main.scala	/webGateway/app/controllers	line 22	Scala Problem
object item is not a member of package views.html	ItemController.scala	/webGateway/app/controllers	line 98	Scala Problem
object myItems is not a member of package views.html	ProfileController.scala	/webGateway/app/controllers	line 27	Scala Problem

@ignasi35
Copy link
Contributor Author

ignasi35 commented Mar 8, 2017 via email

@yg-apaza
Copy link
Contributor

yg-apaza commented Mar 8, 2017

Scala IDE version: 4.5.0-vfinal
Commits SHA-1: 9447db4

@TimMoore
Copy link

TimMoore commented Mar 8, 2017

I can see the problem now... I didn't have Scala IDE installed at all.

@ignasi35 are you using a fresh clone or fully cleaned repo? sbt clean isn't enough to reproduce the problem I found.

@TimMoore
Copy link

TimMoore commented Mar 8, 2017

My Scala IDE version is: Scala IDE for Eclipse 4.4.1.v-2_11-201605041057-92a3ed3

@TimMoore
Copy link

TimMoore commented Mar 9, 2017

I don't know why it installed that version rather than 4.5, but I have updated now and I can still reproduce the errors.

It did take a while... you need to wait for it to finish "Building workspace". @ignasi35 could that explain why you didn't see the errors?

In any case, I can confirm now that @yg-apaza's change does fix the problem. There are only a few unrelated warnings reported now. Thank you for the detailed reproduction steps! I'll go ahead and merge the pull request.

@TimMoore
Copy link

TimMoore commented Mar 9, 2017

BTW I do also get errors in online-auction-java. I'll port the change in #32 over to that project.

@TimMoore
Copy link

TimMoore commented Mar 9, 2017

@ignasi35
Copy link
Contributor Author

ignasi35 commented Mar 9, 2017

It did take a while... you need to wait for it to finish "Building workspace". @ignasi35 could that explain why you didn't see the errors?

I can't.

I tried reproducing the issue in online-auction-scala and online-auction-java . I thought I waited long enough for the workspace to complete the build but that's the only part I'm not sure of.

@ignasi35
Copy link
Contributor Author

ignasi35 commented Mar 9, 2017

I do remember removing all .classpath and .project files and other eclipse-generated folders.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

3 participants