Commit Graph

62057 Commits

Author SHA1 Message Date
Sergey Igushkin faa95bfc33 Fix KT-36804 by eagerly instantiating the Kotlin/Native tasks
This commit partially reverts 970ee4539b.

The Kotlin/Native klib compilation task configuration logic involved
adding dependencies for the compiler plugin artifacts. However, the
compiler plugins classpath, shared across all of the K/N tasks, was
tracked as the tasks' input. This made the following scenario possible:

1. Configuration of some of the Kotlin/Native tasks is avoided at the
   evaluation phase;

2. During task graph construction, one of the tasks are evaluated, and
   to determine their dependencies, Gradle resolves their inputs,
   including the compiler plugins classpath mentioned above;

3. Another K/N task is evaluated afterwards, and the configuration logic
   attempts to add a dependency into the compiler plugin classpath
   configuration, which has already been resolved in (2).
   The build fails.

Fix this by cancelling task configuration avoidance for the K/N tasks.

Issue #KT-36804 Fixed
2020-02-18 16:48:12 +03:00
Vyacheslav Karpukhin 582ce1199f Merge remote-tracking branch 'origin/master' 2020-02-18 14:34:36 +01:00
Vyacheslav Karpukhin eef86d47a0 Merge branch 'slava/mpp-import-experiments'
# Conflicts:
#	idea/idea-gradle/src/org/jetbrains/kotlin/idea/configuration/KotlinMPPGradleProjectResolver.kt
2020-02-18 14:14:23 +01:00
Vyacheslav Karpukhin 4462ecb280 Simplified SdkLocator usage in AndroidDependencyResolver 2020-02-18 14:10:29 +01:00
Vyacheslav Karpukhin d9f9c93dc8 KotlinMPPGradleProjectResolver: extracted similar Android checks 2020-02-18 14:10:29 +01:00
Vyacheslav Karpukhin 082c358f9d Removed references to AndroidDependencyResolver from KotlinMultiplatformExtension 2020-02-18 14:10:29 +01:00
Vyacheslav Karpukhin bdb8811f95 Nullability check 2020-02-18 14:10:29 +01:00
Vyacheslav Karpukhin aaf939a650 Android dependency resolving stuff moved out of KotlinMultiplatformExtension.kt 2020-02-18 14:10:28 +01:00
Vyacheslav Karpukhin 9788525ec7 Import sources for Android SDK, include proper identifiers for Gradle dependencies 2020-02-18 14:10:28 +01:00
Vyacheslav Karpukhin 663c8e5a46 Import Android modules only if Android Plugin for IDEA is missing 2020-02-18 14:10:28 +01:00
Vyacheslav Karpukhin ad314e93eb Do not explicitly depend on prerelease Android Gradle Plugin 2020-02-18 14:10:28 +01:00
Vyacheslav Karpukhin a6e488e2b4 Android import: simplified configuration matching 2020-02-18 14:10:28 +01:00
Vyacheslav Karpukhin 45a0aa04a1 Android import: import R.jar 2020-02-18 14:10:22 +01:00
Vyacheslav Karpukhin 17059682e9 Android import: initial implementation 2020-02-18 14:10:13 +01:00
Nikolay Krasko f47e5cb2d0 Make 201 plugin compatible with IDEA trunk (KT-36780)
^KT-36780 Fixed
2020-02-18 16:08:27 +03:00
Dmitriy Novozhilov 6941cd6d28 [FIR] Add @PrivateForInline to prevent setting to var's from inconvenient places 2020-02-18 16:06:11 +03:00
Dmitriy Novozhilov 2aeb1ea234 [FIR] Move some util methods from resolve.calls to types package 2020-02-18 15:19:34 +03:00
Dmitriy Novozhilov cd3fc5b8ec [FIR] Reorganize packages for resolve module 2020-02-18 15:19:34 +03:00
Dmitriy Novozhilov 41d2f41141 [FIR] Fix incorrect smartcasts from || expressions
#KT-36057 Fixed
2020-02-18 15:19:34 +03:00
Dmitriy Novozhilov 89e377763a [FIR] Change rendering for captured types and stub types 2020-02-18 15:19:33 +03:00
Dmitriy Novozhilov c83244c8b5 [FIR] Fix creating and substituting definitely not null types
#KT-36764 Fixed
2020-02-18 15:19:33 +03:00
Dmitriy Novozhilov bf11f1892d [FIR] Change order of initialization synthetic fun in SAM resolution
It's needed because of `substitutedReturnType` relies on bounds
  of type parameters that should be build before access via symbol
  from lookup tag
2020-02-18 15:19:33 +03:00
Pavel Kirpichenkov 6430209074 [NI] Make error CST when any of included types is error
`ErrorType` is not subtype of `Any`, so any set of types containing an `ErrorType` has no common super constructors.
^KT-36745 Fixed
2020-02-18 14:46:29 +03:00
Dmitry Petrov 6d1da6e6d5 KT-36143 Fix type approximation for type arguments in PSI2IR 2020-02-18 14:39:12 +03:00
Nikolay Krasko 2340a86d8d Update to 201.5259.13-EAP-SNAPSHOT
- No UIUtil.removeLeakingAppleListeners anymore
- getParameterHints nullability
- versions of lz4-java and guava were changed
2020-02-18 14:13:55 +03:00
Nikolay Krasko 6c968859ad Access to test root disposable through accessor 2020-02-18 14:13:55 +03:00
Nikolay Krasko 272ccf64ae Refactoring: extract resetApplicationToNull to separate file 2020-02-18 14:13:54 +03:00
Ilmir Usmanov c748b6f3ee JVM_IR. Minor. Update bytecode text test to JVM_IR or create issues when this
is not feasible.
2020-02-18 11:43:37 +01:00
Steven Schäfer 4b954c347a JVM IR: Avoid optimizing comparisons between boxed primitives and null
A comparison of the form `x == null` where `x` is of type `Int` might not
be vacuous if `x` is a boxed value coming from Java code.
2020-02-18 13:37:48 +03:00
Pavel Kirpichenkov 32e1ec8e98 [minor] Update build output in test to fit NI 2020-02-18 11:19:19 +03:00
Pavel Kirpichenkov 64590cc56b [JPS-TEST] Update test checking JPS build with NI in IDE
Set explicit 1.3 version to disable NI during compilation
2020-02-18 11:19:19 +03:00
Pavel Kirpichenkov 2ead2fba08 [IDEA-TESTS] Update quickfix test parameters for 1.4
Tests check language feature `ProhibitVarargAsArrayAfterSamArgument`
2020-02-18 11:19:18 +03:00
Mikhail Glukhikh fdf4f477a6 FIR2IR: fix problems with enum entry / anonymous object visibility 2020-02-18 10:50:03 +03:00
Ilya Goncharov 9f0ef77531 [Gradle, JS] Provide js compilations parameters to link tasks
#KT-36796 fixed
2020-02-18 09:35:36 +03:00
Abduqodiri Qurbonzoda ce8e511b79 Add setOfNotNull function #KT-35851 2020-02-18 02:33:59 +03:00
Abduqodiri Qurbonzoda 5a4ce2aa4c Mark shared global vals to fix K/N worker thread crash 2020-02-18 01:49:24 +03:00
Dmitry Petrov 94d20d9176 Update bytecode text tests in JVM_IR 2020-02-17 23:52:48 +03:00
Mark Punzalan 64141b8b38 [JVM IR] Fix issue where fields are not being set to their default
values within initializer blocks.

The issue occurs in code like this:
```
class C {
  var b = true
  init {
    b = false   // Missing PUTFIELD for this statement
  }
}
```

Added a new statement origin for field initialization (at declaration)
instead of relying on `origin == null` in ExpressionCodegen to determine
whether to generate the initializations.

This was unintentionally broken in
d68a1898d0.
2020-02-17 23:04:11 +03:00
Mikhail Glukhikh 56c819f06e FIR2IR: add two-statements block with iterator + while for 'for' loops
Before this commit we had two statements blocks for 'for' loops:
range variable declaration + iterator variable declaration + while loop.
However, BE requires a bit different loop structure to make lowerings
properly so in this commit iterator declaration & while loop were
extracted to separate block.
2020-02-17 20:35:17 +03:00
Mikhail Glukhikh 2bfce4f127 FIR2IR: provide correct origins for 'for' loops 2020-02-17 20:35:17 +03:00
Mikhail Glukhikh 83e68be2dc FIR2IR: add declarations to all library classes from kotlin.* package
Before this commit, all library classes were just stubs.
This commit helps to solve problems with some functions
indirectly used by BE, like IntProgression.first.
2020-02-17 20:35:17 +03:00
Mikhail Glukhikh 4a4fb5a590 Raw FIR: eliminate range variable declaration in 'for' loops 2020-02-17 20:35:17 +03:00
Mikhail Glukhikh 4abbcd1267 Unmute two passing FIR black box tests (fixed by commits of demiurg) 2020-02-17 20:35:16 +03:00
Mikhail Glukhikh 91814364de Mute two failing FIR black box tests (broken by commits of demiurg) 2020-02-17 20:35:16 +03:00
Dmitry Savvinov baa2c56e2d Force-set path to exact project for MPP run configurations
Otherwise, path will be set to the root project. Given that we provide
task names in relative form rather than absolute, that will lead to
launching this task in all subprojects (e.g. task 'jvmTest'). This might
be a huge issue, because when we create run configuration for specific
test method/class, we pass test filter as well. This test filter will
execute in all projects with matched test tasks, so if some other
subproject has similarly-named test task, but doesn't have a suitable
tests for that filter, the whole build will fail.

Note that the ideal fix would involve using fully-qualified task names:
the current approach might lead to isses in advanced scenarious (e.g.
when user selects several test files from different modules -- then, we
won't be able to find one exact project path for the whole test run)

^KT-35038 Fixed
2020-02-17 20:05:50 +03:00
Dmitry Savvinov cc2884b8ae Add test on multiplatform run configurations in multiproject build
The current behaviour is undesired, see next commit for fix
2020-02-17 20:05:50 +03:00
Dmitry Savvinov 1ea3db90e1 Add ability to render project of run configuration in tests 2020-02-17 20:05:50 +03:00
Victor Petukhov 51edf2b351 NI: introduce warning about implicitly inferred Nothing with existing non-Nothing expected type
^KT-35406 Fixed
2020-02-17 19:43:05 +03:00
Jinseong Jeon e3184e407d KT-20844 Re-enable stack spilling during inline.
`dx` has entered the final stage of sunset:
https://android-developers.googleblog.com/2020/02/the-path-to-dx-deprecation.html
2020-02-17 15:44:48 +01:00
Vladimir Dolzhenko c9ed27e674 KT-36685 "Convert to a range check" transform hex range to int if it is compared with "Less" or "Greater"
#KT-36685 Fixed
2020-02-17 14:43:37 +01:00