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

Update Eclipse configuration & manual chapter #1973

Merged
merged 14 commits into from May 28, 2018

Conversation

jyluo
Copy link
Contributor

@jyluo jyluo commented May 7, 2018

This PR updates the Configure Eclipse to edit the Checker Framework chapter of the manual, and updates the set of eclipse .project and .classpath files.

The eclipse project files are modified to be plain Java projects, and outputs compiled class files to the build/classes/java directory. This change makes the compiled output directory consistent with Gradle, and allows the updated bin-devel/javac script to work with eclipse generated outputs, as the script only examines class files in build/classes/java.

…f the manual to import the CF projects as gradle projects in eclipse.

Also removed are the old `.project` and `.classpath` files in the projects.
Copy link
Member

@wmdietl wmdietl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this!

@@ -993,15 +993,21 @@ \subsection{Configure Eclipse to edit the Checker Framework\label{building-eclip
\item Download Eclipse from
the \href{https://www.eclipse.org/downloads/}{official Eclipse website}
and install it.
\item Run Eclipse and set the
workspace to the directory pointed to by \code{\$JSR308}.
\item Run Eclipse.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One still needs to perform the normal Import Projects for jsr308-langtools, annotation-tools, etc.
Or how does Eclipse find the source code for these projects?
Can you split these instructions up into the old-style part that will remain as before, and the new part that works for the Gradle projects, which is just the checker-framework directory.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Gradle imports configure the CF subprojects to depend on stubparser.jar, AFU.jar, and compiler-2.4.0.jar so they don't directly depend on jsr308-langtools, annotation-tools, etc.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do these jar files contain source files?
For development it's very helpful to actually see the javadoc for compiler methods.
Also, should the first bullet point be updated? It currently says "clone and build all projects from their sources".
Maybe this should now only clone checker-framework?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the jars don't contain the source files.

I've updated the set of eclipse project and classpath files instead and cleaned up the manual instructions on what projects to not select.

@wmdietl wmdietl assigned jyluo and unassigned wmdietl May 7, 2018
@CharlesZ-Chen
Copy link
Contributor

CharlesZ-Chen commented May 15, 2018

Hi Jeff @jyluo, I just tried your branch and here are what I got:

steps:

Fetch CF from jyluo:update_eclipse_editor_chapter.

Build CF by running .travis-build-without-test.sh, which should produce the same build result as the one following the section "build from source".

Follow the update latex section to import CF, this step I meet two problems:

Ensure ``Search for nested projects'' is selected in the Options panel.

  • When I enable this option, I will got two stubparpser projects (one in CF/stubparser/bin and the other one in CF/stubparser/bin/bin). Then Eclipse will stop me from trying to import duplicate projects. However, if I didn't enable this option, the project imports works without any warning.

  • After I imported all required projects, I still got two missing dependencies errors: jsr308-langtools and scene-lib are missing.

Any ideas? Is there anything I did wrong?


Update:

Ok, I found the reason. This PR updates the .classpath files of checker and framework projects, requiring jsr308-langtools and scene-lib as their dependencies. It would be good to reflect this requirement in the corresponding latex section, to require users also need to import scence-lib and asmx (depedency for scence-lib) from AFU, and jsr308-langtools.


Update2:

Following steps make me successfully import CF related projects into my eclipse:

  1. Clone CF
  2. Build CF
  3. Import all projects (not enable nested-project option) from CF except the personal-blog
  4. Import scence-lib and asmx from directory annotation-tools
  5. Import jsr308-langtools form directory jsr308-langtools
  6. This step is weird: at this point, it should be supposed to work. However, eclipse still complain about: "Missing jars for project scence-lib: guava-20.0.jar, options-all-0.3.1.jar, and plume-util-0.0.1.jar". I have to right click on the project scence-lib in my eclipse, then go to build path -> configure build path..., then re-select the locations of these jars again from AFU/lib.

Then finally all projects build in my eclipse.

@jyluo
Copy link
Contributor Author

jyluo commented May 15, 2018

@CharlesZ-Chen can you point the root directory to $JSR308 and then import with the nested project option? Separately importing scene-lib, asmx, and jsr308-langtools should be unnecessary if $JSR308 is selected as the root.

As for stubparser/bin and stubparser/bin/bin I'll investigate, but it should be a clean up of those projects, not this import instruction.

@jyluo
Copy link
Contributor Author

jyluo commented May 15, 2018

@CharlesZ-Chen

This step is weird: at this point, it should be supposed to work. However, eclipse still complain about: "Missing jars for project scence-lib: guava-20.0.jar, options-all-0.3.1.jar, and plume-util-0.0.1.jar". I have to right click on the project scence-lib in my eclipse, then go to build path -> configure build path..., then re-select the locations of these jars again from AFU/lib.

You don't have to re-point those jars if you also import AFU itself as a project, hence setting $JSR308 as the root of the import with nested-project scan to pick up AFU, scene-lib, & asmx.

@jyluo
Copy link
Contributor Author

jyluo commented May 16, 2018

Remove junit jar here and file an update to AFU/lib

Copy link
Member

@wmdietl wmdietl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more question, then we can merge this.

<attribute name="gradle_used_by_scope" value="compatQual"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="build/classes/java/main" path="src/main/java"/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we remove the checker-qual files .project and .classpath?
They duplicate files that are in checker, e.g. when I look up NullnessType I see two matches.
The "real" location is in checker, so do we need to integrate this directory at all?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I tried doing this and then run into cyclic dependency problems.
So as alternative, can we use checker-qual as binary dependency but use the source code from checker?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've changed it to depend on checker-qual.jar and removed the .project and .classpath from checker-qual project.

@wmdietl wmdietl changed the title Update "Configure Eclipse to edit the Checker Framework" manual chapter Update Eclipse configuration & manual chapter May 24, 2018
<classpathentry kind="src" path="/javacutil"/>
<classpathentry kind="src" path="/checker-qual"/>
<classpathentry kind="src" path="/jsr308-langtools"/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more thing: at the moment every project depends on the other projects. It would be nicer if e.g. checker didn't need to depend on jsr308-langtools and dataflow directly, because it got that dependency from framework.
In the IDE, in the "Java Build Path" under "Order and Export" you can export the packages and thereby make these dependencies more implicit.

@wmdietl wmdietl merged commit 09804f7 into typetools:master May 28, 2018
@jyluo jyluo deleted the update_eclipse_editor_chapter branch May 30, 2018 03:56
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

Successfully merging this pull request may close these issues.

None yet

3 participants