[GRADLE-1011] Idea module javaVersion and "language level" Created: 29/Jun/10  Updated: 04/Jan/13  Resolved: 19/Jul/11

Status: Resolved
Project: Gradle
Affects Version/s: None
Fix Version/s: 1.0-milestone-4

Type: Improvement
Reporter: Steve Ebersole Assignee: Szczepan Faber
Resolution: Fixed Votes: 5


 Description   

Would be fantastic if the java version and language level in the IdeaModule could be driven by sourceCompatibility / targetCompatibility. At the least, it would be nice that if javaVersion is explicitly set on the IdeaModule that the language level be set accordingly.

Summary of changes available since M-4:



 Comments   
Comment by Howard M. Lewis Ship [ 08/Jul/11 ]

The documentation indicates that the project's javaVersion is driven by sourceCompatibility, but I don't see that in practice ... it's always "1.5" (not even "1.6" as the documentation claims).

Comment by Howard M. Lewis Ship [ 08/Jul/11 ]

That's in 1.0-m-3.

Comment by Howard M. Lewis Ship [ 08/Jul/11 ]

http://www.gradle.org/releases/1.0-milestone-3/docs/dsl/org.gradle.plugins.ide.idea.GenerateIdeaProject.html

Comment by Szczepan Faber [ 12/Jul/11 ]

At the moment ideaProject.javaVersion is driven by project.sourceCompatibility if java plugin is applied. If java plugin is not applied then it defaults to 1.6. The current default for project.sourceCompatibility is 1.5. The documentation mentions that and I think it is correct

I think the improvement should achieve 2 goals:

  1. Default the language level to the idea.project.javaVersion
  2. Expose nicer way to change the language level. Currently (milestone-3) you have to do it like that:
idea.project.ipr.whenMerged { project ->
  project.jdk.languageLevel = 'JDK_1_5'
}

But it should be as simple as:

idea.project.javaLanguageLevel = '1.5'

I'll try to squeeze it to milestone-4

Generated at Wed Jun 30 11:44:38 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.