Somewhere in the process of setting up a Java project in IntelliJ IDEA (2017.1.2) a file in the .idea/
directory called kotlinc.xml
showed up. I do nothing with Kotlin, but the file is there with contents:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="KotlinCommonCompilerArguments">
<option name="languageVersion" value="1.1" />
<option name="apiVersion" value="1.1" />
</component>
</project>
This seems some generic configuration, but I can imagine some project-specific (and not just my-local-IDEA-specific) configuration of Kotlin is stored there. So, in general, can this file be ignored when sharing the project under version control (e.g. Git), i.e., not committing it and publishing it somewhere online? Or should it be ignored?
I have never submitted anything from .idea
directory.
If you use modern build system like Gradle or Maven there is no need to submit such metafiles because IDEs like Intellij IDEA or Eclipse can successfully extract such metadata from dependencies / properties.
Mostly, IntelliJ will ask you to override existing properties in .idea
folder.
After importing Gradle / Maven project IntelliJ creates its own .idea
directory with configurations and properties.
I prefer to keep my project as clean as possible (sources, build (gradle, maven) files, CI, README). Fortunately, Java allows us to make portable sources / projects so we should not waste this chance :)
You should not add this file to your version control ignore file. We have this file checked in, as it contained relevant JVM target information. This is in line with the official Jetbrains sharing recommendation, which states:
Here is what you need to share:
- All the files under the .idea directory [...]
kotlinc.xml is not stated as an exception to this rule.
Additionally, the gitignore templates from github and gitignore.io do not list this file, so it should be checked in.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With