ThinkJavaCode2 icon indicating copy to clipboard operation
ThinkJavaCode2 copied to clipboard

Created IntelliJ template project

Open Jonathing opened this issue 4 years ago • 2 comments

Hi!

My name is Jonathan Colmenares, but I mostly go around online as Jonathing.

Why did I make this?

I've been using Think Java, 2nd Edition as the textbook for my computer science class this semester (props to you for such a good book, by the way) and I recently came across the source code for the textbook, since I needed it to be able to get the proper context for some of the information I needed. I wanted to open one of the chapter folders as a project since IntelliJ has a feature to allow importing Eclipse projects into IntelliJ, but since each of the chapter folders were part of a larger workspace, IntelliJ would throw a fit whenever I tried to open one of the folders to play with the source code on my own.

What did I do?

What I've done is created a template IntelliJ project for anyone to be able to open and play with the code on their own (granted, if they use IntelliJ. I'm sure Eclipse would work just fine with it). I've organized each of the chapter files into a module so that IntelliJ respects that each folder is its own workspace and doesn't try to shove the java files into packages. I've also been able to import the same code-formatting rules by importing the eclipse Formatter.xml file. Here's an image of what this looks like below.

Think Java source code in an IntelliJ project

In addition, I've modified the README.md file in the root of the repository to include instructions on how to open the source-code in their preferred IDE, and I've fixed some minor formatting issues that may have been a slight annoyance. I also took the liberty to add the book's cover to the top of the file and have it act as a link to the publisher's page for it!

Top of the README.md file New README.md section

I truly hope this small, yet meaningful PR proves meaningful to you! Cheers.

tl;dr

  • IntelliJ users can open the cloned repository as a project with no issues, code-formatting and everything.
  • The README.md file looks prettier.

Jonathing avatar Dec 02 '20 04:12 Jonathing

This looks great, and is timely! I like the way the README shows multiple options for IDEs. I have on my to-do list to make things work "out of the box" for vscode as well. Let me finish the semester, and I'll take a closer look. Thank you for sharing.

ChrisMayfield avatar Dec 02 '20 14:12 ChrisMayfield

Made a few changes. CheckStyle should now just work if the CheckStyle-IDEA plugin is installed.

Jonathing avatar Feb 13 '21 19:02 Jonathing