Gradle

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What’s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
To raise new issues or bugs against Gradle, please use forums.gradle.org.
  • Gradle
  • GRADLE-2198

Tooling API: Deduce project language level from the java plugin properties via the Tooling API

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Reopened Reopened
  • Resolution: Unresolved
  • Affects Version/s: 1.0-milestone-9
  • Fix Version/s: None

Description

Consider the following simple script:

build.gradle
apply plugin: 'java'

configurations {
	all*.exclude group: 'commons-logging', module: 'commons-logging'
}

repositories {
	mavenLocal()
}

dependencies {}

test {
	useTestNG()
}

compileJava {
	sourceCompatibility = '1.7'
	targetCompatibility = '1.7'
	
	options.encoding = 'UTF-8'
	options.compilerArgs = ['-Xlint', '-Xlint:-serial', '-Xlint:-path']
}

compileTestJava {
	sourceCompatibility = '1.7'
	targetCompatibility = '1.7'
	
	options.encoding = 'UTF-8'
	options.compilerArgs = ['-Xlint', '-Xlint:-serial', '-Xlint:-path']
}

We're expecting to see language level '1.7' from org.gradle.tooling.model.idea.IdeaProject.getLanguageLevel() built against the script. Unfortunately, it always returns 1.6 (default value?).

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • History
  • Activity
  • TeamCity
  • Commits
  • Source
  • Reviews
Hide
Permalink
Szczepan Faber added a comment - 24/Apr/12 6:09 AM

Hey,

You should configure the compatibility outside of the tasks, i.e. as top-level elements of the build.gradle:

apply plugin: 'java'

sourceCompatibility = '1.7'
targetCompatibility = '1.7'
Show
Szczepan Faber added a comment - 24/Apr/12 6:09 AM Hey, You should configure the compatibility outside of the tasks, i.e. as top-level elements of the build.gradle:
apply plugin: 'java'

sourceCompatibility = '1.7'
targetCompatibility = '1.7'
Hide
Permalink
Szczepan Faber added a comment - 24/Apr/12 11:06 AM

Denis,

If the users prefers different language level than the one assigned by Gradle he can configure it: http://gradle.org/docs/current/dsl/org.gradle.plugins.ide.idea.model.IdeaProject.html#org.gradle.plugins.ide.idea.model.IdeaProject

After configuring it, the tooling api will use that setting.

I'll close this issue if that's ok. Please reopen if necessary!

Show
Szczepan Faber added a comment - 24/Apr/12 11:06 AM Denis, If the users prefers different language level than the one assigned by Gradle he can configure it: http://gradle.org/docs/current/dsl/org.gradle.plugins.ide.idea.model.IdeaProject.html#org.gradle.plugins.ide.idea.model.IdeaProject After configuring it, the tooling api will use that setting. I'll close this issue if that's ok. Please reopen if necessary!
Szczepan Faber made changes - 24/Apr/12 11:06 AM
Field Original Value New Value
Resolution Not A Bug [ 6 ]
Assignee Szczepan Faber [ szczepiq ]
Status Open [ 1 ] Resolved [ 5 ]
Hide
Permalink
Szczepan Faber added a comment - 18/May/12 4:58 AM

Yet another incarnation of somewhat poor support for language level in the Gradle's idea plugin.

Blocking this JetGradle feature: http://youtrack.jetbrains.com/issue/IDEA-83528

Show
Szczepan Faber added a comment - 18/May/12 4:58 AM Yet another incarnation of somewhat poor support for language level in the Gradle's idea plugin. Blocking this JetGradle feature: http://youtrack.jetbrains.com/issue/IDEA-83528
Szczepan Faber made changes - 18/May/12 4:58 AM
Status Resolved [ 5 ] Reopened [ 4 ]
Resolution Not A Bug [ 6 ]
Luke Daley made changes - 03/Jan/13 5:09 AM
Workflow jira with pivotal tracker [ 15471 ] jira with pivotal tracker (no resolved, only closed) [ 18736 ]
Luke Daley made changes - 04/Jan/13 5:10 AM
Workflow jira with pivotal tracker (no resolved, only closed) [ 18736 ] Copy of jira with pivotal tracker (no closed, only resolved) [ 21333 ]
Unable to get TeamCity builds: No active plugin license is found! Please visit http://stiltsoft.com/teamcity for details

People

  • Assignee:
    Szczepan Faber
    Reporter:
    Denis Zhdanov
Vote (11)
Watch (11)

Dates

  • Created:
    27/Mar/12 3:19 AM
    Updated:
    18/May/12 4:58 AM
  • Atlassian JIRA (v5.0.3#729-sha1:bf569e4)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Gradle. Try JIRA - bug tracking software for your team.