Commit Graph

71859 Commits

Author SHA1 Message Date
Dmitriy Novozhilov e742af5444 [Test] Run fir diagnostics tests with light tree in sequential mode
In parallel mode many tests are failing so it's temporary workaround
2021-01-15 11:16:28 +03:00
Dmitriy Novozhilov 2f1e4862e5 [Test] Enable builtin parallel tests execution form JUnit5 in :compiler:tests-common-new 2021-01-15 11:16:26 +03:00
Dmitry Savvinov 78b2eb994b Deduplicate logic of computing orphan source sets in MPP Gradle Import
Set of compiled source sets is already available in
MultiplatformModelImportingContext via
'sourceSetsToParticipatedCompilations.keys', no need to recompute it

^KT-37127
2021-01-15 11:12:46 +03:00
Dmitry Savvinov 1d0a696a62 Simplify building of source-sets during MPP Import
Build dependsOn closure straight away by using KotlinSourceSetProto
instead of building first KotlinSourceSetImpls with incorrect
dependsOn-names, and then discarding it

^KT-37127
2021-01-15 11:12:46 +03:00
Dmitry Savvinov 9e58e3c3fd Remove unused KotlinSourceSetImpl.defaultIsTestModule; simplify logic of test modules detection
^KT-37127
2021-01-15 11:12:46 +03:00
Dmitry Savvinov 58b2064295 Introduce MultiplatformModelImportingContext
Essentially it is responsible for returning various information about
the model being imported, such as:

- flags and properties, which configure the process of import
- "bulk" requests which might be needed multiple times during import,
but which are more convenient to be computed once, like various indices
(source sets by name, compilations by source-sets, etc.)

^KT-37127
2021-01-15 11:12:46 +03:00
Dmitry Savvinov f87aa4612b Minor: return map straight away 2021-01-15 11:12:45 +03:00
Dmitry Savvinov cf2bd75a73 Minor: reformat 2021-01-15 11:12:45 +03:00
Dmitry Savvinov 0aef3680c1 Remove useless function
Looks like it has been broken by 40633768bc
where 'KotlinCompilation.dependencies' switched its type from
KotlinDependency (which is alias to
org.jetbrains.plugins.gradle.model.ExternalDependency) to
KotlinDependencyId (which is alias to Long), leading to safe-cast in the
'reportUnresolvedDependencies' to be always evaluated to 'null'

Rationale for removing it completely instead of fixing:
No one has noticed that this function has been broken + I haven't
managed to find any user-visible behaviour it adds (tried fixing it and
checking project similar to one from
NewMultiplatformProjectImportingTest.testUnresolved, no difference for
me).
2021-01-15 11:12:45 +03:00
Dmitry Savvinov 824efe8498 Remove useless condition
Note that in previous line we already check for !isHmppEnabled and for
sourceSet.name == KotlinSourceSet.COMMON_TEST_SOURCE_SET_NAME, and if it
holds, then we continue to the next loop iteration. So, this conditional
here is essentually equal to 'false'
2021-01-15 11:12:45 +03:00
Dmitry Savvinov ecd96e14c9 Use all participated compilations for source-sets platform detection even in non-HMPP 2021-01-15 11:12:45 +03:00
Dmitry Savvinov 09286504b7 Add a bunch of tests on corner-cases in Gradle MPP Import
For most of those the behaviour isn't set in stone, though at the moment
of making that commit we're more or less sure that it's reasonable.

Behaviour in some cases might be more strictly enforces (as much as you
can enforce something in esoteric cases with misconfigured project
sturcture). Those are marked with comments with '!'.
2021-01-15 11:12:45 +03:00
Dmitry Savvinov 69261ca1e6 Add tests on precise platforms importing
Note the behaviour in 'precisePlatformsWithUnrelatedModuleHmpp': it is
incorrect, as set of platforms still contains unrelated platforms.

This is because in the current solution, some source-sets
(commonMain/commonTest) always receive COMMON platform and then it gets
coerced to set of targets actually seen in the project.This helps if
projects uses as much targets as current module (like in
precisePlatformsHmpp), but fails if it uses more targets than the
current module (like in precisePlatformsWithUnrelatedModuleHmppp)

The upcoming commits will fix that issue
2021-01-15 11:12:45 +03:00
Mads Ager 250cc1dc92 [JVM] Never treat arguments to methods as locals that can be removed.
Fixes KT-44347
2021-01-15 10:33:11 +03:00
Sergey Bogolepov ada51509c4 Test caches for linux_x64 on Linux host. 2021-01-15 13:41:15 +07:00
Sergey Bogolepov ed18fcdf28 Use target-specific cache control in tests 2021-01-15 13:41:15 +07:00
Sergey Bogolepov 2dabfbc613 Bump Native version.
The new one has `cacheableTargets` property
in konan.properties that is now required
for native caches support in Gradle.
2021-01-15 13:41:15 +07:00
Sergey Bogolepov 092020577c More precise native cache control.
Introduce `kotlin.native.cacheKind.$targetName`
that allows to control cache kind on per target basis.
2021-01-15 13:41:14 +07:00
Nikolay Krasko d017e1c2ce Add protection for master branch in VCS settings 2021-01-14 21:24:49 +03:00
Nikolay Krasko a0d42b5da6 Build: Download ktor from maven central (KTI-445)
#KTI-445 Fixed
2021-01-14 21:24:48 +03:00
Nikolay Krasko 0a1e4fd7d7 Download ktor from maven central in wizard project 2021-01-14 21:24:47 +03:00
Margarita Bobova ae67bb4565 Add changelog for 1.4.30-M1 2021-01-14 21:19:09 +03:00
Kevin Bierhoff c1360c5a7a Uast: resolve reified callees from classpath (#4013, KT-41279) 2021-01-14 20:29:03 +03:00
Pavel Kirpichenkov c0dd731818 Load JVM built-ins in IDE from module dependencies
Fix built-ins for JVM platform and make them consistent
with module's dependency on standard library. Changes
don't affect non-JVM platforms.

Previously all built-ins in IDE were loaded from classloader
and were based on the same pre-serialized .kotlin_builtins files.
This approach is generally not correct as built-in declarations
differ for different platforms, but it had been working for a while
without immediately observalble effects (see KT-33233 for more info).
After changes in standard library JvmBuiltins started producing
false errors (see KT-39728).

To fix this, JVM built-ins in IDE now utilize the same technique as
applied in CLI: using dependency on standard library as a module
for built-ins instead of artificial module that considers only
.kotlin_builtins.

Change summary:
- Provide JvmBuiltins with kind FROM_DEPENDENCIES
  for all modules with stdlib dependency in IDE
- Add JvmBuiltinsPackageFragmentProvider to JVM-ish module resolvers
  (JVM and Composite with JVM platform) to support their use as
  built-ins module
- Create KotlinBuiltInsMetadataIndex file index for tracking libraries
  containing .kotlin_builtins to support JvmBuiltinsPackageFragmentProvider
- Create KotlinStdlibIndex file index for tracking kotlin-stdlib(-common),
  which looks for "Kotlin-Runtime-Component" manifest attribute
- Add caching service to track LibraryInfo for kotlin-stdlib(-common)
- Put LibraryInfo for kotlin-stdlib(-common) alongside SDKs
  due to the need to resolve that modules in BuiltInsCache
- Update BuiltInsCache to separate JvmBuiltins by module's dependency
  on stdlib and JDK
- Make platform of KotlinSDK common instead of JVM
- Set built-ins module lazily in IDE

^KT-33233 Verification Pending
2021-01-14 17:28:15 +03:00
Dmitry Savvinov 1479c7a270 Minor: load FALLBACK built-ins in JvmPlatformAnalyzerServices
It doesn't matter because this built-ins instance will be used only to
get names of default imports, so nothing can be resolved to those
built-ins => no diagnostics will be reported
2021-01-14 17:28:15 +03:00
Pavel Kirpichenkov ba4cc4e075 Minor: cleanup 2021-01-14 17:28:14 +03:00
Pavel Kirpichenkov b9d5c1bc39 Move KotlinSdk to idea-analysis module 2021-01-14 17:28:14 +03:00
Pavel Kirpichenkov 2df4d26b37 Built-ins in IDE: update tests
KT-33233
2021-01-14 17:28:14 +03:00
Dmitry Savvinov d6c27608ac Minor: remove effectively unused test runner 2021-01-14 17:28:14 +03:00
Vyacheslav Karpukhin 71c71d8619 AndroidDependencyResolver: compatibility with AGP 7 2021-01-14 14:02:28 +01:00
Stanislav Erokhin c1722350b6 Add constructors to KtScope
- KtClassLikeSymbol.primaryConstructor was removed
- Constructors were removed from getCallableMembers because
constructors has no name (or special name `<init>`) and previous
implementation was incorrect
- KtScope.getAllSymbols returns constructors as before. Before it was
like this because of the incorrect implementation of getCallableMembers
- getConstructors has sence only for class scope,
for the rest cases it is empty
2021-01-14 12:12:28 +01:00
Stanislav Erokhin c5229291be Add dispatchReceiver and extensionReceiver to relevant KtSymbols 2021-01-14 12:12:27 +01:00
Stanislav Erokhin 96b6efd401 Add type parameters to the KtConstructorSymbol
Yes, for kotlin classes there are not allowed. But unfortunately
they are for java classes
2021-01-14 12:12:27 +01:00
Stanislav Erokhin 732a997479 Use Variance instead of custom class in KtTypeArgumentWithVariance 2021-01-14 12:12:27 +01:00
Stanislav Erokhin f6bf2f6b7b Add variance and isReified into KtTypeParameterSymbol 2021-01-14 12:12:27 +01:00
Stanislav Erokhin c17eee0085 Add data/inline/fun/isExternal flags to KtClassLikeSymbol 2021-01-14 12:12:26 +01:00
Stanislav Erokhin 7e4ba1a062 Remove unused Unknown modality from KtSymbolWithModality. 2021-01-14 12:12:26 +01:00
Stanislav Erokhin e1e096b4ea Add PRIVATE_TO_THIS visibility to KtSymbolWithVisibility
This visibility is used for some cases where it isn't allowed to access
to private members of the object from other instances of the same object
because of the type parameter variance.

For almost all clients this visibility is the same as PRIVATE
2021-01-14 12:12:26 +01:00
Stanislav Erokhin d50a5e7517 Add ConstantValueKind to KtSimpleConstantValue 2021-01-14 12:12:25 +01:00
Stanislav Erokhin d24331955e Rename FirConstKind to ConstantValueKind and move it to compiler.common 2021-01-14 12:12:25 +01:00
Andrei Klunnyi eed27906e3 KT-44043 [Sealed interfaces]: tests
So far, quick-fix tests infrastructure neither supports the check
for multiple files (several .before/.after pairs) nor multi module
structure. Provided tests are quite limited yet allow to make sure that
the fix in question appears in expected context and get activated.

^KT-44043 fixed
2021-01-14 10:25:34 +00:00
Andrei Klunnyi 43cc022613 KT-44043 [Sealed interfaces]: quickfix for nested -> to another file 2021-01-14 10:25:33 +00:00
Andrei Klunnyi da98fc4b07 KT-44043 [Sealed interfaces]: quickfix for nested -> to upper level 2021-01-14 10:25:33 +00:00
Andrei Klunnyi 521bebee0f KT-44043 [Sealed interfaces]: quickfix for top level abstractions 2021-01-14 10:25:32 +00:00
Alexander Udalov a6b51da308 Fix compilation in the case of JDK_16 pointing to JDK 1.8 2021-01-13 21:47:23 +01:00
Alexander Udalov 3be62dfc89 Build: enable -Werror in stdlib/core/compiler/plugins modules
Exclude modules where there are still warnings in an explicitly declared
variable `tasksWithWarnings`.

Also remove "-progressive" from compiler arguments in modules which are
built with non-latest language version, as the warning about that leads
to an error with -Werror.
2021-01-13 19:34:24 +01:00
Alexander Udalov cc90ff78fd Build: output build time for tasks with --info
To minimize the amount of output during project build, to make it more
comfortable to work with the project in the terminal.
2021-01-13 19:34:24 +01:00
Alexander Udalov 07ce991b3f Build: minor, remove extra newlines in log 2021-01-13 19:34:24 +01:00
Alexander Udalov 2a7a297399 Suppress "runtime JAR files version mismatch" warnings in some plugins 2021-01-13 19:34:24 +01:00
Alexander Udalov 0d8f909bda Use ObsoleteTestInfrastructure instead of Deprecated in black box tests 2021-01-13 19:34:24 +01:00