Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Updated page layout

...

  • Choose "Create project from existing sources"
    Image Modified
  • Set the project files location to the "src" subdirectory and choose a project name
    Image Modified
  • unmark all sources but "src/main"
    Image Modified
  • no library should be found, click next
    Image Modified
  • click next on module review
    Image Modified
  • web facets should be detected, but they are not necessary. Uncheck them
    Image Modified
  • click on "finish"

...

  • Open the project structure window
  • Choose a 1.6 version of the JDK
    Image Modified
  • Under the modules section, make the "test" folder a "test sources" folder
    Image Modified

    Perform an Ant build

At this step, the project structure does not include the necessary third party libraries to build groovy. Furthermore, IntelliJ IDEA requires a valid Groovy installation in order to build Groovy files. As the project is the Groovy project itself, normally the groovy build first compiles the minimal compiler written in Java then uses it to compile the remaining groovy files. Here, we'll have to workaround IntelliJ IDEA ignoring this. The first thing to do is to disable unit tests so that your local Groovy build runs faster (you can be confident that a checked out groovy project passes all unit tests (wink) ).

...

Then register the build.xml file in IntelliJ IDEA (Ant build tab on the right of the screen, "plus" button). You'll be able to launch the Ant build from IntelliJ IDEA now (use the "run" button from the Ant build tab). You could choose to run the Ant build externally, that is not a problem.

Image Modified

IntelliJ IDEA will run the ant build which will download the required third party libraries for you. Build duration depends on whether you already have the dependencies in a local maven repository.

...

Now your base directory includes a "target" directory where you will find various build artifacts :

Image Modified

Update the project structure

...

You can add a breakpoint in JsonBuilderTest, and run the test configuration in debug mode. You will notice that IDEA performs a breakpoint as needed :

Image Modified

Updating the compiler itself

...

Now run your test again (you must update the test file so that intellij idea builds it again). You will notice that the build process will fail as expected, so everything is fine !

Image Modified