Assume that I have simple flat multi module (java) project where I specify ‘sourceCompatibility’ and ‘targetCompatibility’ on the subprojects. Here is what I have noticed:
‘IdeaProject.jdkName’ is always set properly according to ‘targetCompatibility’ but ‘IdeaProject.languageLevel’ does not. That is, ‘languageLevel’ is only set properly if I apply the ‘java’ and the ‘idea’ (in this order) plugins on the root project. This is undesirable because the root project should not be a ‘java’ project. I expect the ‘languageLevel’ to behave the same way as ‘jdkName’.
Of course, it is always possible to set these properties manually, the code below works properly:
// Applied on the root build script
apply plugin: 'idea'
idea.project.languageLevel = '1.7'
idea.project.jdkName= '1.7'
EDIT: I’m accessing these properties through the Tooling API.