Reimport after `./gradlew build` adds jars from gradle's `build/libs` to facet's classpath. That causes problems with JPS build, because it doesn't see changes in out folder, but see unchanged jar, so changes don't apply.
#KT-51873 Fixed
Merge-request: KT-MR-6018
Merged-by: Aleksei Cherepanov <aleksei.cherepanov@jetbrains.com>
Add another one reason for rebuild: if pluginClasspaths was changed or even its jar content, module will be marked for rebuild
Merge-request: KT-MR-5839
Merged-by: Aleksei Cherepanov <aleksei.cherepanov@jetbrains.com>
'AbstractCompile' task has inputs that are related only to Java
compilation and should not used for Kotlin compile tasks.
'SourceTask' most probably will be deprecated in future Gradle releases
- https://github.com/gradle/gradle/issues/9040. Plus it has
old 'sources' with 'FileTree' type which is not stable
for task inputs snapshotting.
Another breaking change - 'destinationDir' task property is not longer
available. It is replaced by 'destinationDirectory' which uses Gradle
Provider API type.
^KT-32805 In Progress
newTmpFile can fail, if you pass non-existent path as temp parent directory or java.io.tmpdir is empty or invalid. Now we try to create non-existent dirs and provide more info if it also fails. Also fix error throwing in JPS part(46c0c4f9)
#KT-51374 Fixed
createTempFile can fail, if you pass non-existent path to kotlin.jps.dir.for.module.files or java.io.tmpdir. Now we try to create non-existent dirs and provide more info if it also fails
#KTIJ-17280 Fixed
If LeverVersion is set to greater than 1 of the current compiler version, metadata became null here org.jetbrains.kotlin.load.kotlin.header.ReadKotlinClassHeaderAnnotationVisitor.createHeader, which leads to NPE during incremental analysis. Using the same incompatible data as fallback prevent it
#KTIJ-20954 Fixed
Merge-request: KT-MR-5680
Merged-by: Aleksei Cherepanov <aleksei.cherepanov@jetbrains.com>
Test: Existing IncrementalJvmCompilerRunnerTestGenerated.PureKotlin#testCompanionConstantChanged
and similar *.PureKotlin#testCompanionConstantChanged tests
Fix testdata of new compiler tests for JPS, as it is build-log-sensitive:
ClassHierarchyAffected.testWithIntermediateBodiesChanged
PureKotlin.testSerializedSubClassAndChangedInterfaces
WithJava.JavaUsedInKotlin.testRawErrorTypeDuringSerialization
Mute JavaUsedInKotlin.SamConversions tests, as it was fixed in 212 idea
Add missed part of commit 5f4be072 [JPS] Fix JS incremental compilation
Part of commit, located in JPS module, was missed during JPS relocation
Fix test MixedInheritance for non-JPS builds
Depends on commit [CHERRY PICKED FROM IJ] [testdata] Replace test IncrementalJvmJpsTest...
Replace test because JPS recompile inherited classes only in case of existence of direct use (like override or direct call of parent methods).
Tested cases:
*Add new abstract method when derived class does not abstract
*Add and remove method, when such method is present in derived class
*Change return type/access modifier
GitOrigin-RevId: 767e58ba3d3e4069838c717666329b43f1b8e936
Original commit: https://github.com/JetBrains/intellij-community/commit/d738c61aaefe95acd8130066f53f8d8bcadfa977
Create extension of "load classes by parent classloader" logic to bypass clash of the same classes with different versions, loaded by different classloaders in case of running in-process compilation in debug configuration.
#KT-49786 Fixed
GitOrigin-RevId: 173749ef1a36fdb1df44e98f3d373941e00f29ad
Original commit: https://github.com/JetBrains/intellij-community/commit/16e76333d4163c3772fa6e6ef3c1c7667a4c12f9
Since versioning of LookupSymbolKeyDescriptor was added in 1.5.30: f6b428f2 "KT-34862 use abi snapshot instead of build history files", it is necessary to update version of caches for JPS, as new caches are not compatible with previous.
#KT-48399 Fixed
GitOrigin-RevId: 59b1071c1a1090f78c51824d45e6c000f4ef2f3f
Original commit: https://github.com/JetBrains/intellij-community/commit/658f4aeb603bb224a14a92933ebe519948db7745
Fix test IncrementalJvmJpsTestGenerated$PureKotlin.testPackageFileAdded
Fix test IncrementalJvmJpsTestGenerated$Custom.testCommonSourcesCompilerArg
Fix test IncrementalJvmJpsTestGenerated$WithJava$JavaUsedInKotlin$SamConversions.testMethodAddDefault
GitOrigin-RevId: 63b7a47898ca42b4d7f11a01ceb0e019933f528b
Original commit: https://github.com/JetBrains/intellij-community/commit/e91bfb29e65b9eb5452c4d5f544f0bbfa3eafde3
Possibility to use JDK 9 was dropped in the Kotlin repo in
this commit de7fb9606a so I had to migrate this test.
Consulted with @udalov. He said that it's fine to migrate this test to JDK 11
Original fix in IJ repo: https://github.com/JetBrains/intellij-community/commit/40fb0da80ee4687a6478d43709147ea8dc5570c7
Test example: IncrementalJvmJpsTestGenerated.ClassHierarchyAffected#testEnumEntryRemoved
Test failure output example:
```
Initial make failed:
MakeResult(log=Compiling files:
src/Enum.kt
src/getRandomEnumEntry.kt
src/use.kt
src/useEnumImplicitly.kt
End of files
Exit code: ABORT
------------------------------------------
COMPILATION FAILED
Cannot access 'java.io.Serializable' which is a supertype of 'Enum'. Check your module classpath for missing or conflicting dependencies
Cannot access 'java.io.Serializable' which is a supertype of 'Enum.A'. Check your module classpath for missing or conflicting dependencies
Cannot access 'java.io.Serializable' which is a supertype of 'Enum.B'. Check your module classpath for missing or conflicting dependencies
Cannot access 'java.io.Serializable' which is a supertype of 'Enum.C'. Check your module classpath for missing or conflicting dependencies
Cannot access 'java.io.Serializable' which is a supertype of 'kotlin.Array'. Check your module classpath for missing or conflicting dependencies
Cannot access 'java.io.Serializable' which is a supertype of 'Enum'. Check your module classpath for missing or conflicting dependencies
, makeFailed=true, mappingsDump=null, name=null)junit.framework.AssertionFailedError: Initial make failed:
MakeResult(log=Compiling files:
src/Enum.kt
src/getRandomEnumEntry.kt
src/use.kt
src/useEnumImplicitly.kt
End of files
Exit code: ABORT
------------------------------------------
COMPILATION FAILED
Cannot access 'java.io.Serializable' which is a supertype of 'Enum'. Check your module classpath for missing or conflicting dependencies
Cannot access 'java.io.Serializable' which is a supertype of 'Enum.A'. Check your module classpath for missing or conflicting dependencies
Cannot access 'java.io.Serializable' which is a supertype of 'Enum.B'. Check your module classpath for missing or conflicting dependencies
Cannot access 'java.io.Serializable' which is a supertype of 'Enum.C'. Check your module classpath for missing or conflicting dependencies
Cannot access 'java.io.Serializable' which is a supertype of 'kotlin.Array'. Check your module classpath for missing or conflicting dependencies
Cannot access 'java.io.Serializable' which is a supertype of 'Enum'. Check your module classpath for missing or conflicting dependencies
, makeFailed=true, mappingsDump=null, name=null)
at junit.framework.Assert.fail(Assert.java:57)
at junit.framework.Assert.assertTrue(Assert.java:22)
at junit.framework.Assert.assertFalse(Assert.java:39)
at junit.framework.TestCase.assertFalse(TestCase.java:210)
at org.jetbrains.kotlin.jps.build.AbstractIncrementalJpsTest.initialMake(AbstractIncrementalJpsTest.kt:240)
at org.jetbrains.kotlin.jps.build.AbstractIncrementalJpsTest.doTest(AbstractIncrementalJpsTest.kt:333)
at org.jetbrains.kotlin.test.KotlinTestUtils.lambda$testWithCustomIgnoreDirective$4(KotlinTestUtils.java:522)
at org.jetbrains.kotlin.test.KotlinTestUtils.runTestImpl(KotlinTestUtils.java:492)
at org.jetbrains.kotlin.test.KotlinTestUtils.runTest0(KotlinTestUtils.java:473)
at org.jetbrains.kotlin.test.KotlinTestUtils.runTest(KotlinTestUtils.java:457)
at org.jetbrains.kotlin.jps.build.IncrementalJvmJpsTestGenerated$ClassHierarchyAffected.runTest(IncrementalJvmJpsTestGenerated.java:2979)
at org.jetbrains.kotlin.jps.build.IncrementalJvmJpsTestGenerated$ClassHierarchyAffected.testEnumEntryRemoved(IncrementalJvmJpsTestGenerated.java:3063)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:566)
at junit.framework.TestCase.runTest(TestCase.java:176)
at com.intellij.testFramework.UsefulTestCase.lambda$runBare$10(UsefulTestCase.java:473)
at com.intellij.testFramework.UsefulTestCase.lambda$wrapTestRunnable$12(UsefulTestCase.java:493)
at com.intellij.testFramework.UsefulTestCase.runTestRunnable(UsefulTestCase.java:406)
at org.jetbrains.kotlin.jps.build.BaseKotlinJpsBuildTestCase.access$runTestRunnable$s-943794013(BaseKotlinJpsBuildTestCase.kt:34)
at org.jetbrains.kotlin.jps.build.BaseKotlinJpsBuildTestCase$runTestRunnable$1.invoke(BaseKotlinJpsBuildTestCase.kt:73)
at org.jetbrains.kotlin.jps.build.BaseKotlinJpsBuildTestCase$runTestRunnable$1.invoke(BaseKotlinJpsBuildTestCase.kt:72)
at org.jetbrains.kotlin.test.MuteWithDatabaseKt.runTest(muteWithDatabase.kt:96)
at org.jetbrains.kotlin.jps.build.BaseKotlinJpsBuildTestCase.runTestRunnable(BaseKotlinJpsBuildTestCase.kt:72)
at com.intellij.testFramework.UsefulTestCase.defaultRunBare(UsefulTestCase.java:422)
at com.intellij.testFramework.UsefulTestCase.lambda$runBare$11(UsefulTestCase.java:481)
at com.intellij.testFramework.EdtTestUtil.lambda$runInEdtAndWait$1(EdtTestUtil.java:40)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:303)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
at java.awt.EventQueue$4.run(EventQueue.java:721)
at java.awt.EventQueue$4.run(EventQueue.java:715)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:421)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
```
IntelliJ uses Java 11 so it forces us to use Java 11 in JPS
This commit fixes:
```
public class DataContainerVersionChangedTestGenerated extends AbstractDataContainerVersionChangedTest {
^
bad class file: /home/bobko/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.platform/test-framework/203.8084.24/ba5c6b3b0eae0a083dc30e866c362094f5072853/test-framework-203.8084.24.jar(com/intellij/testFramework/UsefulTestCase.class)
class file has wrong version 55.0, should be 52.0
Please remove or make sure it appears in the correct subdirectory of the classpath.
```