Commit Graph

61035 Commits

Author SHA1 Message Date
Dmitry Savvinov 6d45b048cb Check for presence of ir-folder in klibs additionally for Kotlin/Native 2020-01-25 15:59:12 +03:00
Dmitry Savvinov 5665261e5b Minor: extract name of ir-folder in klib into const property 2020-01-25 15:59:12 +03:00
Dmitry Savvinov 7ecab7f0aa Pass proper metadata_version in K2MetadataKlibSerializer
Otherwise newer IDE Plugins will think that it's an old klib and will
refuse to analyze against it
2020-01-25 15:59:12 +03:00
Sergey Igushkin 823d3cc412 (minor) Fix accessing a shared-native compilation's konanTarget
As future some Kotlin/Native compilations in the future may have
different platforms within one target, it's more preferable to
access the konanTarget from the compilation, not its target.
2020-01-24 23:20:56 +03:00
Sergey Igushkin 1f42951152 Fix KlibBasedMppIT test compilation error (missing import) 2020-01-24 20:49:57 +03:00
Vyacheslav Gerasimov 1f3755248c Build: Make task inputs relative to improve caching 2020-01-24 19:40:00 +03:00
Vyacheslav Gerasimov 8e0dd604af Build: Annotate KotlinModuleShadowTransformer with @CacheableTransformer 2020-01-24 19:40:00 +03:00
Vyacheslav Gerasimov 131765537a Build: Implement preserveFileTimestamps for stripMetadata task 2020-01-24 19:40:00 +03:00
Vyacheslav Gerasimov 82182893ad Build: Set preserveFileTimestamps & isReproducibleFileOrder properties
Otherwise some jars always have different key in the build cache
2020-01-24 19:39:59 +03:00
Vyacheslav Gerasimov 317972db2a Build: Make :kotlin-reflect:stripMetadata cacheable 2020-01-24 19:39:59 +03:00
Vyacheslav Gerasimov 760e34aeec Build: Fix type of builtinsJar task
Should be org.gradle.api.tasks.bundling.Jar
2020-01-24 19:39:59 +03:00
Vyacheslav Gerasimov 526f29cc1a Build: Upgrade com.github.jengelman.gradle.plugins:shadow to 5.2.0 2020-01-24 19:39:59 +03:00
Vyacheslav Gerasimov 3f10329347 Build: Fix publication of stdlib-js to avoid publishing all artifacts
Because of https://github.com/gradle/gradle/issues/4612 install and
uploadArchives tasks published artifacts which were not meant
to be published
2020-01-24 19:39:59 +03:00
Vyacheslav Gerasimov 7dcdc506d8 Build: Fix outputs for :kotlin-stdlib-js:compileJs
jsOutputMetaFile was missing
2020-01-24 19:39:59 +03:00
Vyacheslav Gerasimov 770344770d Build: Make :kotlin-stdlib-js:compileJs task cacheable 2020-01-24 19:39:58 +03:00
Vyacheslav Gerasimov 392e5a6edd Build: Make :kotlin-compiler:proguard task cacheable 2020-01-24 19:39:58 +03:00
Vyacheslav Gerasimov 8dd6a34e17 Build: Make :core:builtins:serialize task cacheable 2020-01-24 19:39:58 +03:00
Sergey Igushkin d1826374a6 Fix the K/N stdlib leaking into other common source sets
The Kotlin/Native stdlib was added to the shared-native source sets
in order for the IDE to import the stdlib dependency.

However, it was added to the '*Implementation' configuration, from
where it was also collected for the dependency source set
visibility inference algorithm. The current implementation of source
sets visibility inference only works for module dependencies and is
not quite suitable for local file dependencies. The implementation
should likely be fixed, but for now, it's enough to add the dependency
directly to the place where the visibility inference results are
taken from by the IDE during import, i.e. to the
'*ImplementationDependenciesMetadata' configurations.

Also, since all tests were flawed by the leakin K/N stdlib, the
K2Metadata/Klib compiler mistakenly didn't include its own built-ins
to the module dependencies (and everything worked because the K/N
built-ins were there). Now that the K/N doesn't leak, the compiler
must add its own built-ins.
2020-01-24 19:00:45 +03:00
Sergey Igushkin 970ee4539b Common klib support in the Kotlin Gradle plugin (KT-32677)
Refactor the Kotlin/Native compilations and tasks to support
Kotlin/Native-shared source sets compilation within the metadata target.

Provide the feature flag kotlin.mpp.enableCommonKlibs that enables
the following behavior:
* compilation of Kotlin/Native-shared source sets to a klib using
the Kotlin/Native compiler.
* compilation of common source sets (not just Kotlin/Native) into a
klib rather than *.kotlin_metadata

Issue #KT-32677 Fixed
2020-01-24 19:00:44 +03:00
Vyacheslav Gerasimov dd9ac39b65 Build: Add :compiler:ir.serialization.common to kotlin-plugin.jar
:compiler:ir.serialization.jvm contains classes depending on this module
which makes idea plugin verifier to fail.

 #KT-36103
2020-01-24 18:27:41 +03:00
Vsevolod Tolstopyatov e4d82a6dbb Merge remote-tracking branch 'origin/master' 2020-01-24 17:59:27 +03:00
Mikhail Zarechenskiy b647d2c645 Prolong deprecation cycle for several restrictions until 1.5
ProhibitInvisibleAbstractMethodsInSuperclasses &
 ProhibitNonReifiedArraysAsReifiedTypeArguments were implemented in
 1.3.70, so actually they should be enabled only in 1.5
2020-01-24 17:29:55 +03:00
Victor Petukhov 5c6e710013 Revert "Workaround an inliner problem upon which the compiler code itself stumbled ^KT-35856 Fixed"
This reverts commit 59175912
2020-01-24 16:41:22 +03:00
Dmitry Petrov 90b250d241 PSI2IR: Fix bound inner class constructor callable reference generation 2020-01-24 16:32:07 +03:00
Alexander Udalov f7321b497b Set KotlinCompilerVersion.IS_PRE_RELEASE = true
Since master is now 1.4-M1, and 1.4 is a pre-release version.
2020-01-24 14:18:51 +01:00
Vsevolod Tolstopyatov a00e98bad9 KT-36118 Introduce AbstractCoroutineContextKey and corresponding extensions required by its implementors
* It enables subtyping relationship for keys and elements, allowing type-safe and concise manipulations on the context when complex hierarchies of elements (e.g. implementors of ContinuationInterceptor) are present
    * It unblocks possibility to implement suspendCancellableCoroutine in stdlib
    * Implementing proper polymorphic get and minusKey in AbstractCoroutineContextElement is impossible because it will introduce source-incompatible change
    * ContinuationInterceptor get and minusKey are adjusted in a completely backwards-compatible way
2020-01-24 16:17:14 +03:00
Anton Yalyshev 90fe1bb1ab Enable FUS for Code Completion in 1.3.70 2020-01-24 16:05:20 +03:00
Ilya Gorbunov 7bb504321c KT-15363 Rename expectedSize to capacity and edit docs 2020-01-24 15:28:35 +03:00
Ilya Gorbunov 14351446d7 KT-15363 Fix failing test: missing capacity parameter check in JS
Partially restore JVM map capacity implementation
2020-01-24 15:28:18 +03:00
Ilya Gorbunov 4aa7d45a5a KT-15363 Collection builders: improve tests and samples 2020-01-24 15:28:17 +03:00
Fleshgrinder bf9d3d87a6 KT-15363 Collection Builders
Added container builders for lists, sets, and maps.
The new experimental type inference only works for the simple builders
with a single generic type. The versions with nullability and the maps
still require explicit specification of the types. Obviously explicit
specification is required for all users who are not using the new
experimental inference. Improving the type inference is something that
should be done separately and many things – including these builders –
will benefit from it, however, this is not a blocker for these builders
in my opinion.
2020-01-24 15:28:17 +03:00
Ilya Goncharov fa811c731f [IDEA] Use withType instead of isAssignableFrom
#KT-36093 fixed
2020-01-24 15:25:25 +03:00
Ilya Goncharov 6dc9109736 [IDEA] Check assignable from task to KotlinTest class 2020-01-24 15:23:23 +03:00
Ilya Goncharov 6b860206bd [IDEA] Use GradleVersion fqn to use it in case when there is no import 2020-01-24 15:23:22 +03:00
Ilya Goncharov c3951d394b [IDEA] Preload KotlinTest class instead of loop finding 2020-01-24 15:23:22 +03:00
Ilya Goncharov 2c4cfd2fb8 [IDEA] Add check on gradle version not to broke Gradle older 4.0 2020-01-24 15:23:22 +03:00
Dmitriy Novozhilov 20ac606df4 Add js runtime to failing blackbox test 2020-01-24 14:17:44 +03:00
Shagen Ogandzhanian de07d3387b Update dukat dependency to 0.0.26 2020-01-24 12:09:05 +01:00
Alexander Udalov 2fca7f1a54 Add codegen tests for old behavior of null checks
#KT-22275
2020-01-24 11:56:28 +01:00
Yan Zhulanow 632fe18db6 Revert "Remove deprecated method from CommandLineProcessor"
This reverts commit 508330e0bb.

An external plugin depends on the deprecated API: com.jereksel.jailbreakk:0.0.2.
2020-01-24 18:12:21 +09:00
Yan Zhulanow 9bf63f5399 Kapt, minor: Add extra case for property initializers 2020-01-24 18:12:21 +09:00
pyos ca3c1d04c5 Add an IR version of Android Extensions blackbox tests 2020-01-24 18:12:21 +09:00
pyos 4094841dc6 Add a basic IR extension to the Android plugin
Only supports uncached findViewById/findFragmentById for now; other
features are experimental and the cache only affects performance, so
this should probably be fine for testing Android apps with -Xuse-ir.
2020-01-24 18:12:21 +09:00
Kevin Bierhoff 6d32b3256b suppress duplicate @Override annotations 2020-01-24 18:12:21 +09:00
Natalia Selezneva a55a0d94de Scripts: clear manual configuration loading state after project import
^KT-35268
2020-01-24 11:52:57 +03:00
Andrey Uskov bbdad45201 Added project size and metrics collectors in gradle plugin 2020-01-24 11:23:31 +03:00
Dmitry Petrov c540116b71 IR: additional callable reference adapter stuff in IR
- IrFunctionReference.reflectionTarget: IrFunctionSymbol?
- add separate declaration origin for callable reference adapters
- bump IR ABI version
2020-01-24 11:21:26 +03:00
Dmitry Petrov 57bbfbbfcc PSI2IR: capture adapted reference receiver to a local val if required 2020-01-24 11:21:25 +03:00
Dmitry Petrov 38b90b7fbd Minor: move callable reference IR tests to a separate directory 2020-01-24 11:21:25 +03:00
Dmitry Petrov c5f14a29a4 PSI2IR: Generate adapted callable references
Callable reference is "adapted" if it requires some adaptation to an
expected function type - e.g., when a reference to
```
  fun foo(vararg xs: Int): Int
```
is used where `(Int, Int, Int) -> Int` is expected.

For such callable references we generate the following IR (in
pseudo-Kotlin):
```
  {
    fun foo'(p0: Int, p1: Int, p2: Int): Int {
      return [| foo(p0, p1, p2) |]
    }
    ::foo'
  }
```

where `[| foo(p0, p1, p2) |]` is calling function `foo` with arguments
`p0`, `p1`, and `p2`, as they were mapped by callable reference
resolution.
2020-01-24 11:21:25 +03:00