Skip to content

Commit

Permalink
fix too early evaluation of ideaHome
Browse files Browse the repository at this point in the history
  • Loading branch information
oehme committed May 7, 2015
1 parent 6e49e81 commit c800fa7
Showing 1 changed file with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class IdeaComponentPlugin implements Plugin<Project> {
val compile = project.configurations.getAt(JavaPlugin.COMPILE_CONFIGURATION_NAME)
compile.exclude(#{"module" -> "guava"})
compile.exclude(#{"module" -> "log4j"})
compile.exclude(#{"group" -> "org.ow2.asm"})

val ideaProvided = project.configurations.create(IDEA_PROVIDED_CONFIGURATION_NAME)
java.sourceSets.all [
Expand Down Expand Up @@ -79,27 +80,25 @@ class IdeaComponentPlugin implements Plugin<Project> {
runIdea.sandboxDir = idea.sandboxDir
runIdea.ideaHome = idea.ideaHome
runIdea.classpath = idea.ideaRunClasspath
project.tasks.withType(Test).all [
dependsOn(assembleSandboxTask)
systemProperty("idea.home.path", idea.ideaHome)
systemProperty("idea.plugins.path", idea.sandboxDir)
]
]

project.gradle.taskGraph.addTaskExecutionGraphListener(runIdeaValidator)

project.tasks.withType(Test).all [
dependsOn(assembleSandboxTask)
systemProperty("idea.home.path", idea.ideaHome)
systemProperty("idea.plugins.path", idea.sandboxDir)
]

project.plugins.withType(EclipsePlugin) [
val eclipseClasspath = project.tasks.getByName(EclipsePlugin.ECLIPSE_CP_TASK_NAME)
eclipseClasspath.dependsOn(idea.downloadIdea, idea.downloadPlugins)
project.extensions.getByType(EclipseModel).classpath => [
plusConfigurations.add(ideaProvided)

val fileReferenceFactory = new FileReferenceFactory
val sourceZip = idea.sourcesZip
file.whenMerged.add [ Classpath it |
entries.filter(Library).filter[idea.ideaCoreLibs.contains(library.file)].forEach [
sourcePath = fileReferenceFactory.fromFile(sourceZip)
sourcePath = fileReferenceFactory.fromFile(idea.sourcesZip)
]
]
]
Expand Down

0 comments on commit c800fa7

Please sign in to comment.