Changes between Version 7 and Version 8 of DevelopersGuide/CompilingUsingIntelliJ


Ignore:
Timestamp:
2020-02-02T17:58:24+01:00 (5 years ago)
Author:
hiddewie
Comment:

Added many more steps on importing, building and running the project with IntelliJ

Legend:

Unmodified
Added
Removed
Modified
  • DevelopersGuide/CompilingUsingIntelliJ

    v7 v8  
    33This describes how to develop and [wiki:DevelopersGuide/Compiling compile] JOSM using [https://www.jetbrains.com/idea/ IntelliJ IDEA]
    44
    5 1. → [[Source code#Getthesource]]
     5== Getting the source code ==
     6
     71. Follow the steps in [[Source code#Getthesource]] to get the source code from Subversion. For this guide, assume it is located in a folder `josm-svn`.
     8
     9== Import the project into IntelliJ ==
     10
     111. Import the project into IntelliJ using the menu: `File` → `New` → `Project from Existing Sources`. Follow the wizard:
     12  1. Navigate to the folder containing the project, and select it.
     13  1. Select `Create Project from existing sources`. [[BR]] [[Image(intellij-from--01.png)]]
     14  1. Give the project a name, and click `Next`. [[BR]] [[Image(intellij-from--01.png)]]
     15  1. IntelliJ auto-detects the folders which contain source code. Click `Next`. [[BR]] [[Image(intellij-from--01.png)]]
     16  1. IntelliJ auto-detects the project libraries. Click `Next`. [[BR]] [[Image(intellij-from--01.png)]]
     17  1. IntelliJ auto-detects a number of project modules. Click `Next`. [[BR]] [[Image(intellij-from--01.png)]]
     18  1. Select a Java SDK, at least version 8. Click `Next`. [[BR]] [[Image(intellij-from--01.png)]]
     19  1. Deselect OSGI automatic configuration. Click `Next`. [[BR]] [[Image(intellij-from--01.png)]]
     20
     21== Building the project ==
     22
     231. When you are prompted to add IntelliJ project configuration to Subversion, check the box `Don't ask again`, and click `Cancel`. [[BR]] [[Image(intellij-from--01.png)]]
     241. IntelliJ will intex the project. [[BR]] [[Image(intellij-from--01.png)]]
     251. Open the `Ant` tool window. It contains no configuration yet. [[BR]] [[Image(intellij-from--01.png)]]
     261. Click the `+` button to add an Ant configuration file. Select the file `build.xml` [[BR]] [[Image(intellij-from--01.png)]]
     271. The Ant tool window should now list Ant tasks. [[BR]] [[Image(intellij-from--01.png)]]
     281. Double click the `dist` task. It will build the project. The `Messages` tool window will show the progress and logging output. [[BR]] [[Image(intellij-from--01.png)]]
     291. There should now be a built file: `dist/josm-custom.jar`. [[BR]] [[Image(intellij-from--01.png)]]
     30
     31== Running the project ==
     32
     331. There are no run configurations configured. Click `Add configuration`. [[BR]] [[Image(intellij-from--01.png)]]
     341. Click the `+` button to add a new `JAR Application` configuration. [[BR]] [[Image(intellij-from--01.png)]]
     351. Give the new configuration a name. [[BR]] [[Image(intellij-from--01.png)]]
     361. In the field `Path to JAR`, choose the built Jar file. [[BR]] [[Image(intellij-from--01.png)]]
     371. Add a `Before launch` configuration item, `Run Ant target`. [[BR]] [[Image(intellij-from--01.png)]]
     381. A window will popup with all the available Ant tasks. Choose `dist`. [[BR]] [[Image(intellij-from--01.png)]]
     391. The configuration should now be ready and selected in the project. [[BR]] [[Image(intellij-from--01.png)]]
     401. Click the `Run` (play) button. The project should build again, and then run. [[BR]] [[Image(intellij-from--01.png)]]
     41
     421.
    6431. Run ant in the source directory to obtain a `josm-custom.jar` → [[Source code#CompilingusingAnt]]
    7441. In IntelliJ: File → New → Project from Existing Sources