Refine dirty files computation in case of Java source changes
#KT-17621 In Progress
Original commit: ae6421476d
This commit is contained in:
+30
@@ -949,18 +949,42 @@ public class IncrementalJpsTestGenerated extends AbstractIncrementalJpsTest {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin"), Pattern.compile("^([^\\.]+)$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("changeFieldType")
|
||||
public void testChangeFieldType() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changeFieldType/");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("changeNotUsedSignature")
|
||||
public void testChangeNotUsedSignature() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changeNotUsedSignature/");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("changePropertyOverrideType")
|
||||
public void testChangePropertyOverrideType() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changePropertyOverrideType/");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("changeSignature")
|
||||
public void testChangeSignature() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changeSignature/");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("changeSignaturePackagePrivate")
|
||||
public void testChangeSignaturePackagePrivate() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changeSignaturePackagePrivate/");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("changeSignatureStatic")
|
||||
public void testChangeSignatureStatic() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changeSignatureStatic/");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("constantChanged")
|
||||
public void testConstantChanged() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/constantChanged/");
|
||||
@@ -1021,6 +1045,12 @@ public class IncrementalJpsTestGenerated extends AbstractIncrementalJpsTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("mixedInheritance")
|
||||
public void testMixedInheritance() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/mixedInheritance/");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("notChangeSignature")
|
||||
public void testNotChangeSignature() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/notChangeSignature/");
|
||||
|
||||
@@ -333,7 +333,7 @@ class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR) {
|
||||
|
||||
val changesCollector = ChangesCollector()
|
||||
for ((target, files) in generatedFiles) {
|
||||
updateIncrementalCache(files, incrementalCaches[target]!!, changesCollector)
|
||||
updateIncrementalCache(files, incrementalCaches[target]!!, changesCollector, null)
|
||||
}
|
||||
updateLookupStorage(chunk, lookupTracker, dataManager, dirtyFilesHolder, filesToCompile)
|
||||
|
||||
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
public @interface Ann {
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
public class JavaClass {
|
||||
public String foo() { return null; }
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
@Ann
|
||||
public class JavaClass {
|
||||
public String foo() { return null; }
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
================ Step #1 =================
|
||||
|
||||
Cleaning output files:
|
||||
out/production/module/JavaClass.class
|
||||
End of files
|
||||
Exit code: NOTHING_DONE
|
||||
------------------------------------------
|
||||
Compiling files:
|
||||
src/JavaClass.java
|
||||
End of files
|
||||
Cleaning output files:
|
||||
out/production/module/META-INF/module.kotlin_module
|
||||
out/production/module/UsageKt.class
|
||||
End of files
|
||||
Compiling files:
|
||||
src/usage.kt
|
||||
End of files
|
||||
Exit code: ABORT
|
||||
------------------------------------------
|
||||
SUCCESS
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
fun foo() {
|
||||
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
fun bar() {
|
||||
JavaClass().foo()
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
public class JavaClass {
|
||||
public String foo() { return null; }
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
public class JavaClass {
|
||||
public String foo() { return null; }
|
||||
public static class Nested {
|
||||
}
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
================ Step #1 =================
|
||||
|
||||
Cleaning output files:
|
||||
out/production/module/JavaClass.class
|
||||
End of files
|
||||
Exit code: NOTHING_DONE
|
||||
------------------------------------------
|
||||
Compiling files:
|
||||
src/JavaClass.java
|
||||
End of files
|
||||
Cleaning output files:
|
||||
out/production/module/META-INF/module.kotlin_module
|
||||
out/production/module/UsageKt.class
|
||||
End of files
|
||||
Compiling files:
|
||||
src/usage.kt
|
||||
End of files
|
||||
Exit code: ABORT
|
||||
------------------------------------------
|
||||
COMPILATION FAILED
|
||||
Unresolved reference: Nested
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
import test.*
|
||||
|
||||
fun foo(x: Nested) {
|
||||
JavaClass().foo()
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
package test
|
||||
|
||||
class Nested
|
||||
@@ -0,0 +1,6 @@
|
||||
import test.*
|
||||
import JavaClass.*
|
||||
|
||||
fun bar(x: Nested) {
|
||||
JavaClass().foo()
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
public @interface Ann {
|
||||
String value() default "1";
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
@Ann
|
||||
public class JavaClass {
|
||||
public String foo() { return null; }
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
@Ann("")
|
||||
public class JavaClass {
|
||||
public String foo() { return null; }
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
================ Step #1 =================
|
||||
|
||||
Cleaning output files:
|
||||
out/production/module/JavaClass.class
|
||||
End of files
|
||||
Exit code: NOTHING_DONE
|
||||
------------------------------------------
|
||||
Compiling files:
|
||||
src/JavaClass.java
|
||||
End of files
|
||||
Cleaning output files:
|
||||
out/production/module/META-INF/module.kotlin_module
|
||||
out/production/module/UsageKt.class
|
||||
End of files
|
||||
Compiling files:
|
||||
src/usage.kt
|
||||
End of files
|
||||
Exit code: ABORT
|
||||
------------------------------------------
|
||||
SUCCESS
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
fun foo() {
|
||||
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
fun bar() {
|
||||
JavaClass().foo()
|
||||
}
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
================ Step #1 =================
|
||||
Compiling files:
|
||||
src/TheClass.kt
|
||||
src/other.kt
|
||||
End of files
|
||||
Exit code: OK
|
||||
------------------------------------------
|
||||
|
||||
================ Step #2 =================
|
||||
|
||||
Compiling files:
|
||||
End of files
|
||||
Exit code: OK
|
||||
------------------------------------------
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
public class JavaClass {
|
||||
public String stringField;
|
||||
public int intField;
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
public class JavaClass {
|
||||
public CharSequence stringField;
|
||||
public int intField;
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
================ Step #1 =================
|
||||
|
||||
Cleaning output files:
|
||||
out/production/module/JavaClass.class
|
||||
End of files
|
||||
Exit code: NOTHING_DONE
|
||||
------------------------------------------
|
||||
Compiling files:
|
||||
src/JavaClass.java
|
||||
End of files
|
||||
Cleaning output files:
|
||||
out/production/module/META-INF/module.kotlin_module
|
||||
out/production/module/UsageKt.class
|
||||
End of files
|
||||
Compiling files:
|
||||
src/usage.kt
|
||||
End of files
|
||||
Exit code: OK
|
||||
------------------------------------------
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
fun main(args: Array<String>) {
|
||||
JavaClass().intField
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fun main(args: Array<String>) {
|
||||
JavaClass().stringField
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
public class JavaClass implements KotlinInterface {
|
||||
public CharSequence getX() { return ""; }
|
||||
public int getY() { return 1; }
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
public class JavaClass implements KotlinInterface {
|
||||
public String getX() { return ""; }
|
||||
public int getY() { return 1; }
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
interface KotlinInterface {
|
||||
val x: CharSequence
|
||||
val y: Int
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
================ Step #1 =================
|
||||
|
||||
Cleaning output files:
|
||||
out/production/module/JavaClass.class
|
||||
End of files
|
||||
Exit code: NOTHING_DONE
|
||||
------------------------------------------
|
||||
Compiling files:
|
||||
src/JavaClass.java
|
||||
End of files
|
||||
Cleaning output files:
|
||||
out/production/module/META-INF/module.kotlin_module
|
||||
out/production/module/UsageKt.class
|
||||
End of files
|
||||
Compiling files:
|
||||
src/usage.kt
|
||||
End of files
|
||||
Exit code: OK
|
||||
------------------------------------------
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
fun main(args: Array<String>) {
|
||||
JavaClass().y
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
fun main(args: Array<String>) {
|
||||
JavaClass().x
|
||||
}
|
||||
+4
-1
@@ -1,4 +1,7 @@
|
||||
public class JavaClass {
|
||||
public static void foo() {
|
||||
public void foo() {
|
||||
}
|
||||
|
||||
public void bar() {
|
||||
}
|
||||
}
|
||||
|
||||
+5
-2
@@ -1,5 +1,8 @@
|
||||
public class JavaClass {
|
||||
public static String foo() {
|
||||
return ":)";
|
||||
public String foo() {
|
||||
return "";
|
||||
}
|
||||
|
||||
public void bar() {
|
||||
}
|
||||
}
|
||||
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
fun main(args: Array<String>) {
|
||||
JavaClass().bar()
|
||||
}
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
fun main(args: Array<String>) {
|
||||
JavaClass.foo()
|
||||
JavaClass().foo()
|
||||
}
|
||||
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
public class JavaClass {
|
||||
public void foo() {
|
||||
}
|
||||
|
||||
public void bar() {
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
public class JavaClass {
|
||||
void foo() {
|
||||
}
|
||||
|
||||
public void bar() {
|
||||
}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
================ Step #1 =================
|
||||
|
||||
Cleaning output files:
|
||||
out/production/module/JavaClass.class
|
||||
End of files
|
||||
Exit code: NOTHING_DONE
|
||||
------------------------------------------
|
||||
Compiling files:
|
||||
src/JavaClass.java
|
||||
End of files
|
||||
Cleaning output files:
|
||||
out/production/module/META-INF/module.kotlin_module
|
||||
out/production/module/UsageKt.class
|
||||
End of files
|
||||
Compiling files:
|
||||
src/usage.kt
|
||||
End of files
|
||||
Exit code: OK
|
||||
------------------------------------------
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
fun main(args: Array<String>) {
|
||||
JavaClass().bar()
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
fun main(args: Array<String>) {
|
||||
JavaClass().foo()
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
public class JavaClass {
|
||||
public static void foo() {
|
||||
}
|
||||
|
||||
public static void bar() {
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
public class JavaClass {
|
||||
public static String foo() {
|
||||
return "";
|
||||
}
|
||||
|
||||
public static void bar() {
|
||||
}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
================ Step #1 =================
|
||||
|
||||
Cleaning output files:
|
||||
out/production/module/JavaClass.class
|
||||
End of files
|
||||
Exit code: NOTHING_DONE
|
||||
------------------------------------------
|
||||
Compiling files:
|
||||
src/JavaClass.java
|
||||
End of files
|
||||
Cleaning output files:
|
||||
out/production/module/META-INF/module.kotlin_module
|
||||
out/production/module/UsageKt.class
|
||||
End of files
|
||||
Compiling files:
|
||||
src/usage.kt
|
||||
End of files
|
||||
Exit code: OK
|
||||
------------------------------------------
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
fun main(args: Array<String>) {
|
||||
JavaClass.bar()
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
fun main(args: Array<String>) {
|
||||
JavaClass.foo()
|
||||
}
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
================ Step #1 =================
|
||||
|
||||
Compiling files:
|
||||
src/JavaClass.java
|
||||
src/usage.kt
|
||||
End of files
|
||||
Exit code: OK
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
open class BaseClass {
|
||||
fun foo() {}
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
open class BaseClass {
|
||||
fun foo(): String = "OK"
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
public class DerivedClass1 extends BaseClass {
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
class DerivedClass2 : DerivedClass1() {
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
================ Step #1 =================
|
||||
|
||||
Cleaning output files:
|
||||
out/production/module/BaseClass.class
|
||||
End of files
|
||||
Compiling files:
|
||||
src/BaseClass.kt
|
||||
End of files
|
||||
Marked as dirty by Kotlin:
|
||||
src/usage1.kt
|
||||
src/usage2.kt
|
||||
src/usage3.kt
|
||||
Exit code: ADDITIONAL_PASS_REQUIRED
|
||||
------------------------------------------
|
||||
Cleaning output files:
|
||||
out/production/module/DerivedClass1.class
|
||||
out/production/module/DerivedClass2.class
|
||||
out/production/module/META-INF/module.kotlin_module
|
||||
out/production/module/Usage1Kt.class
|
||||
out/production/module/Usage2Kt.class
|
||||
out/production/module/Usage3Kt.class
|
||||
End of files
|
||||
Compiling files:
|
||||
src/DerivedClass2.kt
|
||||
src/usage1.kt
|
||||
src/usage2.kt
|
||||
src/usage3.kt
|
||||
End of files
|
||||
Exit code: OK
|
||||
------------------------------------------
|
||||
Compiling files:
|
||||
src/DerivedClass1.java
|
||||
End of files
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
fun main4() {
|
||||
DerivedClass2().hashCode()
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
fun main1() {
|
||||
BaseClass().foo()
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
fun main2() {
|
||||
DerivedClass1().foo()
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
fun main3() {
|
||||
DerivedClass2().foo()
|
||||
}
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
================ Step #1 =================
|
||||
|
||||
Compiling files:
|
||||
src/JavaClass.java
|
||||
src/usage.kt
|
||||
End of files
|
||||
Reference in New Issue
Block a user