IntelliJ Concepts: Difference between revisions
Line 118: | Line 118: | ||
===Project SDK=== | ===Project SDK=== | ||
A [[#Project| | A [[#Project|project]] has one SDK (the "Project SDK"), which is part of the [[#Project_Settings|Project Settings]]. The Project SDK can be associated with the project via File → Project Structure → Project Settings → Project → Project SDK. The SDK can be then chosen from a list of [[#Global_SDKs|global SDKs]]. The project SDK is the default SDK for all [[#Module|modules]], but [[#Module_SDK|module-specific SDKs]] can then be configured on a module-by-module basis. | ||
===Module SDK=== | ===Module SDK=== |
Revision as of 19:58, 29 June 2021
External
Internal
Project
A project is a directory that keeps everything that makes up the application. A typical project has a set of settings and one or several modules. The project provides a mechanism to express dependencies between modules and stores modules' shared configuration.
.idea Directory
The .idea directory is used by IntelliJ to store project settings metadata, and it is collocated with the project. It lives by default under the project's root. It contains the following file:
User-Specific Settings
workspace.xml
Stores user-specific settings.
tasks.xml
User Dictionaries
Maintained in .idea/dictionaries/username.xml.
shelf
datasources.xml
In IDEA 13 or earlier, datasources.xml contains user passwords.
libraries
All XML files under .idea/libraries will be generated by the Gradle or the Maven project.
gradle.xml
Gradle settings.
vcs.xml
These are some recommendations on what to share and what not to share in a SVC system. The article applies to Git, but the rules are generally valid:
Project Settings
The project settings apply to the current project. They are stored together with other project files in the .idea directory in an XML format. Project settings are VCS settings, SDKs, code style, spellchecker settings, compiler output, libraries. All these setting are available to all the modules of the project.
A project has just one Project SDK that is initially the default SDK for all modules. However, module-specific SDKs can be configured.
TODO:
- https://www.jetbrains.com/help/idea/configure-project-settings.html
- https://www.jetbrains.com/help/idea/project-settings-and-structure.html
Module
A module is a logical group of source code and resources within a project.
The module has an .iml file that keeps the internal representation of the module settings. The module is also associated with a module content root directory, which stores the source code, tests and resources. The .iml file and the module content root are not tied, they can exists in different locations on the file system.
.iml File
The .iml file keeps the internal representation of the module settings.
Module Settings
Module settings apply only to one module and they are stored in the module's .iml file.
As part of its settings, a module can have an SDK and a language level that are different from those configured for the enclosing project. A module can also have its own libraries. A module can also carry a specific technology or framework.
TODO: https://www.jetbrains.com/help/idea/configure-modules.html
Grouping Modules
Settings
There are three type of settings in IntelliJ IDEA: module settings, project settings and global settings.
Global Settings
Global settings apply to all projects of a specific installation of IntelliJ IDEA. Such settings include IDE appearance, themes, color schemes, the set of installed and enabled plugins, debugger settings, global inspection profile.
TODO: https://www.jetbrains.com/help/idea/configuring-project-and-ide-settings.html
Debugging
Suspending Only One Thread, and Not All
Right-click on the breakpoint → Suspend → Thread
Optional: Make Default.
SDK
A SDK (Software Development Kit) is a collection of tools needed to develop application for a specific software framework. An SDK contains binaries, source code for the binaries, documentation and, in Java's case, annotations. For Java, a JDK (Java Development Kit) is needed.
SDK Hierarchy
Global SDKs
In general, an SDK is global, meaning that one SDK configured on the IntelliJ instance can be used in multiple projects and modules. Even if the SDKs are global, the access to the global SDKs is done via a projects: File → Project Structure → Platform Settings → SDKs. The available SDKs are listed there. Where is the list of Global SDKs maintained for an IntelliJ installation?
To add a global SDK, the same project interface should be used. The SDK is added by clicking "+".
Project SDK
A project has one SDK (the "Project SDK"), which is part of the Project Settings. The Project SDK can be associated with the project via File → Project Structure → Project Settings → Project → Project SDK. The SDK can be then chosen from a list of global SDKs. The project SDK is the default SDK for all modules, but module-specific SDKs can then be configured on a module-by-module basis.
Module SDK
JDK
Indexing
Cache
The top-level cache directory: /Users/ovidiu/Library/Caches/JetBrains/IntelliJIdea2021.1
.
Cache Types
Project Cache
Workspace Cache
External Build System Cache
Compiler Cache
Compile Server Cache
Cache Invalidation
Main Menu → File → Invalidate Caches...
Local History
Maintained on disk in /Users/ovidiu/Library/Caches/JetBrains/IntelliJIdea2021.1/LocalHistory
.