Commit Graph

6645 Commits

Author SHA1 Message Date
Ilya Chernikov 5f15cacb1b Fix ivy mapping to the maven repos in main-kts 2020-01-21 17:42:48 +01:00
Ilya Chernikov d15d62a338 Check REPL snippet syntax before calling analysis
restores the behaviour of the GenericRepl implementation and fixes
issues then invalid code is being compiled
#KT-34888 fixed
2020-01-21 17:42:48 +01:00
Tsvetan 5f0e3018db KT-27856 Add contracts to Timing.kt lambdas (#1987) 2020-01-21 15:42:21 +03:00
Yaroslav Chernyshev 401baa35ab [Gradle, Native] Implement custom name for generated framework for XCode 2020-01-21 10:23:53 +03:00
Ilya Gorbunov 1336da8453 Rename Clock to TimeSource, ClockMark to TimeMark
Step 2: rename classes and interfaces.
Provide deprecated typealiases to smooth migration.
2020-01-21 03:28:35 +03:00
Ilya Gorbunov a11a25087a Rename Clock to TimeSource, ClockMark to TimeMark
Step 1: rename files
2020-01-21 03:28:35 +03:00
Ilya Gorbunov 15a441141f Update public API dump after KT-11567 codegen changes came into effect
The only questionable case left is a private companion
in a public interface, which is generated as a public synthetic field
2020-01-20 21:29:50 +03:00
Ilya Gorbunov 51c5fcc8b8 Drop experimental stdlib sourceset
Haven't used it after pre 1.3
2020-01-20 18:35:21 +03:00
Sergey Igushkin 796d4da9f5 Fix testLanguageSettingsConsistency with default language version 1.4 2020-01-20 16:37:51 +03:00
nataliya.valtman 578132ef1f CleanDataTask: use provider for input cleanStore 2020-01-18 11:34:21 +03:00
nataliya.valtman abd60b97f8 YarnPlugin: configuration should be required only at build phase 2020-01-18 11:34:20 +03:00
Alexander Udalov 55e29363dc Update test data for kotlinp
Inline functions require Kotlin compiler at least 1.3.50 if they were
generated by the compiler with API version >= 1.4. This is because since
API version 1.4, we've changed the generation scheme of parameter
nullability assertions and they now refer to methods from the standard
library which did not exist until 1.4. See
JvmSerializerExtension.writeInlineParameterNullCheckRequirement.
2020-01-17 20:40:35 +01:00
Zac Sweers 482874fdc1 Embed proguard/R8 rules in kotlin-reflect artifact jar
The Android build pipeline can extract embedded proguard configurations
from dependencies and merge them automatically. This adds a conservative
proguard configuration to the kotlin-reflect JVM artifact in support of
that. This focuses mostly on just retaining what's necessary for
kotlin-reflect's own functionality to operate, but could be expanded if
community feedback discovers other good candidate rules.

With this in place - most Android projects using R8 or Proguard should
Just Work™️ with kotlin-reflect.
2020-01-17 20:03:52 +01:00
Alexander Udalov ae395bda09 Do not depend on proguard directly in :kotlin-reflect:modularJar
This is useful if proguard is disabled with
-Pkotlin.build.proguard=false.
2020-01-17 19:58:27 +01:00
Sergey Igushkin 38feadcfe8 Fix non-existing files passed in classpath to Kotlin/JS compiler 2020-01-17 18:28:25 +03:00
Sergey Rostov 6ac21856cc NodeJsRootExtension, YarnRootExtension: introduce configuration phase
Some properties were calculated based on yarn and nodeJs version. So,
when version is changed properties were not updated. This change moves
calculation to the end of configuration phase and adds assertion to
ensure that version and other poperties are not changed
after configuration was done.
2020-01-17 13:44:57 +03:00
nataliya.valtman 9c08ea3bf1 Gradle: introduce CleanabeStore 2020-01-17 13:44:56 +03:00
Dmitriy Novozhilov 76b3964e96 Update testdata according to change compiler version to 1.4 2020-01-17 10:33:50 +03:00
Nikolay Krasko 7fa8c982b4 Advance version to 1.4 in libraries 2020-01-17 10:33:50 +03:00
Nikolay Krasko ca49672a7a Advance version to 1.4 2020-01-17 10:33:50 +03:00
Ilya Matveev 55e97fee09 Gradle, native: Don't use an arg file when compiler daemon is enabled
We pass compiler flags using an arg file if the compiler is executed
in a separate process because Windows limits maximal command line
length (see https://github.com/JetBrains/kotlin-native/issues/1999).

But for the compiler daemon we pass the args directly to the compiler
entry point method. So we can abandon using an arg file here.
2020-01-17 12:44:37 +07:00
Ilya Matveev 8158d34bda Gradle, native: Escape spaces in K/N compiler args
We use an argument file to pass arguments to the K/N compiler.
Earlier each line of such a file was treated by the compiler
as a separate argument. But this logic was updated some time
ago and now content for this file is treated as a space separated
list of arguments.

This patch takes this into account at the Gradle side and quotes
arguments written to the arg file.

Issue #KT-35934 Fixed
2020-01-17 12:44:37 +07:00
Abduqodiri Qurbonzoda 3cad1bbb51 Create method Collection.randomOrNull() #KT-35347 2020-01-16 22:25:53 +03:00
Nikolay Krasko b4ae1645ec Mute TCServiceMessageOutputStreamHandlerTest for 193 platform (KT-35938) 2020-01-16 20:37:58 +03:00
Nikolay Krasko 6963c81b40 Run tests in kotlin-gradle-plugin in repository working dir
Unify with other modules and make GradleNodeModuleBuilderTest work under
JPS.
2020-01-16 20:37:57 +03:00
Ilya Gorbunov e9cea3358d Do not use libraryJarWithoutIr as runtime output artifact
This avoids having both libraryJarWithoutIr and default jar artifact,
which points to the same path as libraryJarWithIr, in the dependent
projects' classpath.
Use libraryJarWithIr instead.
For local builds where libraryJarWithIr doesn't contain any IR, this
should have the same effect.
2020-01-16 16:01:56 +03:00
Ilya Gorbunov 3fabf9b6ad Add dependency in disabled jar task on custom libraryJarWithIr
jar task is disabled, but its artifact is still used through
the runtime configuration in the other projects.
In fact, dependent projects get both
libs/kotlin-stdlib-js-1.3-SNAPSHOT.jar
lib/dist/kotlin-stdlib-js-1.3-SNAPSHOT.jar
in their classpath.

However the former artifact is built with libraryJarWithIr task after
jar task is skipped. This leads to a situation during the parallel build
that a dependent project tries to read that artifact
when libraryJarWithIr task writes it.

This commit adds a dependency edge between the disabled jar and custom
libraryJarWithIr tasks, so that the artifact is ready by
the moment jar task has finished.
2020-01-16 16:01:55 +03:00
Ilya Gorbunov 09b1960dd0 Regenerate stdlib sources: update copyright year 2020-01-16 15:57:06 +03:00
Ilya Gorbunov 30bdd463ad Do not lower SinceKotlin version for unsigned arrays extensions if they already has some 2020-01-16 15:52:35 +03:00
Ilya Gorbunov ac7e54f651 Improve terminological consistency in KClass docs 2020-01-16 15:36:13 +03:00
Ilya Gorbunov 3a78ab6d40 Do not use qualifiedName property in KClass.cast function, because it's not supported in K/JS
Introduce an internal property that returns either qualified or simple name, and use it instead.
2020-01-16 15:36:07 +03:00
Ilya Gorbunov 8af43155c3 Remove reflect API not actually supported in K/JS
#KT-32186
2020-01-16 15:33:16 +03:00
Ilya Gorbunov 562bac3f6f Copy JVM reflect declarations to JS 2020-01-16 15:33:16 +03:00
Ilya Gorbunov ea95aabbb0 Optimistically add isInstance and qualifiedName to common KClass
Because they are used in common cast and safeCast functions
2020-01-16 15:33:15 +03:00
Ilya Gorbunov 47f78c424d Commonize KType API
Move KTypeProjection, KVariance, KClassifier, KTypeParameter to stdlib-common.

#KT-29748 Fixed
#KT-32855 Fixed
2020-01-16 15:33:15 +03:00
Ilya Gorbunov d87fb0ece0 Introduce expect KFunction in common 2020-01-16 15:33:14 +03:00
Ilya Gorbunov 427e34fe5a Do not serialize JVM kotlin.reflect to builtins
Serialize common types from kotlin-reflect as builtins instead.
2020-01-16 15:32:29 +03:00
Alexander Udalov c3d5a88e52 Add -Xno-use-ir to compiler modules where JVM IR currently fails
This option has no effect on the production code. But in a custom
scenario of a local bootstrap, where the compiler is replaced with the
one where JVM IR backend is enabled by default, this option allows to
switch back to the old backend.

All of these arguments (except the one for compiling experimental
coroutines) are supposed to go away as soon as we fix related problems
in the JVM IR backend.
2020-01-16 12:21:47 +01:00
Sergey Bogolepov 595362b99f [kotlinx-metadata-klib] Proper support for enum entries 2020-01-16 11:38:39 +07:00
Sergey Igushkin ffa2f97d2c Deprecate 1.2.x MPP Gradle plugins
Issue #KT-31570 Fixed
2020-01-16 00:02:47 +03:00
Sergey Igushkin f9acc0ab88 Support Gradle instant execution for Kapt tasks
* In the Kotlin/JVM tasks, move the compiler arguments setup logic to
  a separate class, so that it can be reused by the Kapt tasks without
  directly referencing the Kotlin/JVM tasks

* In the Kapt tasks, carefully capture the values using the Provider API
  so that the task can be serialized for Instant Execution and then
  deserialized and executed without relying on the project model

Issue #KT-35181 Fixed
2020-01-15 23:53:49 +03:00
Sebastian Schuberth 4191d1d699 Make NodeJsSetupTask and YarnSetupTask cacheable
For users that have Gradle's build cache [1] enabled, make NodeJsSetupTask
and YarnSetupTask cacheable to avoid the distribution archives being
downloaded again if they have been downloaded before by other builds of
other projects that apply the Kotlin plugin.

[1] https://docs.gradle.org/current/userguide/build_cache.html
2020-01-15 12:51:37 +01:00
Sebastian Schuberth 2760034281 NodeJsSetupTask: Check for the node executable instead of its directory
We want NodeJs to be downloaded again if nodeBinDir exists but the node
binary is missing.

Fixes https://youtrack.jetbrains.com/issue/KT-34989.
2020-01-15 12:51:37 +01:00
Alexander Udalov 514bf3eec0 Deprecate Experimental/UseExperimental in favor of RequiresOptIn/OptIn 2020-01-14 21:04:44 +01:00
Alexander Udalov f954a6c812 Support custom message in RequiresOptIn
#KT-34648 Fixed
2020-01-14 21:04:43 +01:00
Alexander Udalov da077b5353 Rename UseExperimental->OptIn, Experimental->RequiresOptIn in Gradle plugin 2020-01-14 21:04:42 +01:00
Alexander Udalov 8f94a2bb75 Rename UseExperimental->OptIn, Experimental->RequiresOptIn in stdlib kdocs 2020-01-14 21:04:42 +01:00
Ilya Gorbunov 0764a065e8 Rewrite UnderMigration and MigrationStatus in Java
to remove dependency on kotlin-stdlib.

#KT-33141
2020-01-13 23:30:32 +03:00
Vyacheslav Gerasimov fa1c6c9697 Build: Add missing com.github.node-gradle.node plugin versions 2020-01-13 19:40:08 +03:00
Vyacheslav Gerasimov b2039a9a13 Build: Specify version explicitly for com.github.node-gradle.node 2020-01-13 18:17:43 +03:00