From 6e80e9ae0833028023767456b2b4fa58d1c9dab3 Mon Sep 17 00:00:00 2001 From: peter Date: Wed, 3 Feb 2010 14:18:13 +0000 Subject: [PATCH] even one modified groovy file may force recompiling others (circular dependency) --- .../plugins/groovy/compiler/GroovyCompiler.java | 3 +-- .../groovy/compiler/GroovyCompilerTest.groovy | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/compiler/GroovyCompiler.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/compiler/GroovyCompiler.java index 8a669b0ff836..b18f4507c08f 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/compiler/GroovyCompiler.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/compiler/GroovyCompiler.java @@ -71,8 +71,7 @@ public class GroovyCompiler extends GroovyCompilerBase { // groovyc may fail if we don't also recompile files like B such that A depends on B and B depends on C, where A & C \in toCompile // see http://jira.codehaus.org/browse/GROOVY-4024 - // this is important only if >1 files have been changed - if (toCompile.size() > 1 && !"false".equals(System.getProperty("compile.groovy.dependencies", "true"))) { + if (!"false".equals(System.getProperty("compile.groovy.dependencies", "true"))) { context.getProgressIndicator().checkCanceled(); context.getProgressIndicator().setText("Enumerating Groovy classes..."); diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/compiler/GroovyCompilerTest.groovy b/plugins/groovy/test/org/jetbrains/plugins/groovy/compiler/GroovyCompilerTest.groovy index 5cb388cad796..a02797bbe10f 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/compiler/GroovyCompilerTest.groovy +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/compiler/GroovyCompilerTest.groovy @@ -329,5 +329,21 @@ class Goo {}""") assertEmpty make() } + public void testRecompileDependentClassesWithOnlyOneChanged() throws Exception { + def bar = myFixture.addFileToProject("Bar.groovy", """ +class Bar { + Foo f +} +""") + myFixture.addFileToProject "Foo.groovy", """ +class Foo extends Bar { +}""" + + assertEmpty make() + + touch(bar.virtualFile) + assertEmpty make() + } + }