Commit Graph

2745 Commits

Author SHA1 Message Date
Ilya Gorbunov 51c5fcc8b8 Drop experimental stdlib sourceset
Haven't used it after pre 1.3
2020-01-20 18:35:21 +03:00
Nikolay Krasko ca49672a7a Advance version to 1.4 2020-01-17 10:33:50 +03:00
Abduqodiri Qurbonzoda 3cad1bbb51 Create method Collection.randomOrNull() #KT-35347 2020-01-16 22:25:53 +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 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
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 8f94a2bb75 Rename UseExperimental->OptIn, Experimental->RequiresOptIn in stdlib kdocs 2020-01-14 21:04:42 +01:00
Vyacheslav Gerasimov fa1c6c9697 Build: Add missing com.github.node-gradle.node plugin versions 2020-01-13 19:40:08 +03:00
Ilya Gorbunov 9e4d7df86e Revert "[JS IR] stdlib: switch between artifacts rather than artifact content"
The default Jar task is disabled, but its archive file is still
configured as an artifact to be published in the 'archives' configuration.
Thus, neither 'install', nor 'publish' tasks could not find this file
when `libraryJarWithIr` isn't triggered and does not build it.
Removing that artifact from the 'archives' configuration artifacts makes
'install' task publish nothing.

Therefore it's better to revert the change so that 'libraryJarWithIr' task
always runs and produces an artifact with the default name.

This reverts commit a9fec211
2020-01-11 02:27:05 +03:00
Ilya Gorbunov c084dfa1d7 [JS IR] stdlib: use 'base' plugin instead of kotlin("jvm")
'base' plugin is enough in this case, given that a couple of tasks is registered and configured manually.

Fix kotlin-reflect dependency to be a project dependency.
2020-01-09 22:57:50 +03:00
Ilya Gorbunov a9fec21178 [JS IR] stdlib: switch between artifacts rather than artifact content
The switch `includeStdlibJsIr` now affects which artifact is published:
the one with IR or the one without. Previously it affected
whether or not IR was bundled into the artifact "with IR".
2020-01-09 22:57:45 +03:00
Ilya Gorbunov 372a4009bd Fix coreLibsInstall composite task again
See the commit f0e67f8397 for details
2020-01-09 22:54:57 +03:00
Alexander Udalov e0b9ffa780 Regenerate builtins sources 2020-01-03 13:09:43 +01:00
Ilya Gorbunov a98f36bce4 Reorganize existing Closeable/AutoCloseable.use tests 2019-12-28 03:02:01 +03:00
Toshiaki Kameyama 941de655c4 Add contract for 'use'
#KT-35216 Fixed
2019-12-28 02:54:29 +03:00
Ilya Gorbunov 043eddb432 Cleanup: use effects introduced by contracts of assert* functions 2019-12-28 02:51:56 +03:00
Miguel Serra 4fa5e2d85c KT-20357: Add samples for linkedSetOf 2019-12-26 20:07:39 +03:00
Tillmann Berg 95300ae31d KT-20357: Add sample for reduce, reduceRight and their indexed counterparts 2019-12-26 19:57:33 +03:00
Ilya Gorbunov 6d092b5f71 Add more reduceOrNull tests
- Test for unsigned arrays
- Update binary api dump with the new functions
2019-12-26 19:27:47 +03:00
Alfredo Delli Bovi 9546307243 Add sample for reduceOrNull and reduceRightOrNull 2019-12-26 19:27:46 +03:00
Alfredo Delli Bovi 06008c40ab KT-33761 Add reduceRightOrNull 2019-12-26 19:27:46 +03:00
Alfredo Delli Bovi f5d696d3c4 KT-33761 Add reduceOrNull 2019-12-26 19:27:46 +03:00
Svyatoslav Kuzmich d74721716a [JS IR] Use short klib names instead of absolute paths 2019-12-25 13:44:57 +03:00
Svyatoslav Kuzmich 31c84e9ac4 [JS IR] Build stdlib using compiler from repo
Previously JS IR versions of stdlib and kotlin-test were build
by default using compiler previously built on a buildserver.

It had some issues:
 - This required us to advance bootstrap every time we made any
   incompatible IR changes. This happens often since IR ABI is
   not quite stable yet.

 - We never tested the exact combination of compiler and stdlib we publish

   We tested:
    - new compiler with new stdlib build by new compiler (in box tests)
    - old compiler with new stdlib build by old compiler (in stdlib tests)

   We published:
    - new compiler with new stdlib build by old compiler

After this change JS IR compiler tests, builds and publishes
single configuration:

    new compiler with new stdlib build by new compiler

JS IR stdlib and kotlin-test are now built using JavaExec of CLI instead
of Gradle plugin to avoid troubles of loading a freshly built plugin.

This also allows to have a granular dependencies: we don't rebuild klib
if we changed a lowering in a compiler backend, but we do rebuild it if
we changed IR serialization algorithm.
2019-12-25 13:44:57 +03:00
Roman Artemev 9871f8c579 [JS BE] Fix DCE to let it remove constant properties 2019-12-24 19:26:05 +03:00
Alexander Udalov cdbabf224f Introduce RequiresOptIn and OptIn annotations
RequiresOptIn should be used now instead of Experimental, OptIn instead
of UseExperimental. See https://github.com/Kotlin/KEEP/pull/201.

This change adds the new declarations only to the stdlib, and supports
them in the compiler. Because of the way compiler loads annotations, we
need to bootstrap it first before deprecating the old annotations and
updating tests.

 #KT-34647 Fixed
2019-12-17 18:17:48 +01:00
Abduqodiri Qurbonzoda b868e6f8da Rename Appendable methods parameters 2019-12-17 19:04:00 +03:00
Tillmann Berg cf86dc9a89 KT-20357: Add sample for Collections distinct and distinctBy methods 2019-12-11 07:42:05 +03:00
Ilya Gorbunov f0e67f8397 Fix coreLibsInstall composite task
It was broken after the commit bbdbc2896b,
which included kotlin-stdlib-js-ir project into coreLibs list,
but that project didn't have 'install' task, on which 'coreLibsInstall' depends
2019-12-11 06:36:40 +03:00
Abduqodiri Qurbonzoda 56cae75404 Fix StringBuilder reverse test 2019-12-10 13:07:27 +03:00
Abduqodiri Qurbonzoda 19e001afad Commonize Float.rangeTo(Float) #KT-35299 2019-12-09 20:24:06 +03:00
Abduqodiri Qurbonzoda 20d02dd0ee Commonize StringBuilder 2019-12-04 22:15:33 +03:00
Abduqodiri Qurbonzoda 1431e27a7b Move StringBuilder to its own file 2019-12-04 22:15:33 +03:00
Abduqodiri Qurbonzoda 0c033297a8 Move Appendable to its own file 2019-12-04 22:15:33 +03:00
Abduqodiri Qurbonzoda 50752d47fe Move CharacterCodingException to its own file 2019-12-04 22:15:33 +03:00
Abduqodiri Qurbonzoda 956e085b22 Rename text.kt file to StringBuilderJs.kt 2019-12-04 22:15:33 +03:00
Abduqodiri Qurbonzoda 2155f1680f Fix small mistake in CharSequence.lastIndexOf documentation 2019-12-04 22:15:33 +03:00
Ilya Gorbunov edfd933348 Improve Result docs to emphasize that any Throwable exception is caught
#KT-33447 Fixed
2019-12-03 21:08:31 +03:00
Ilya Gorbunov 555d503ff9 Improve indexOf sample to showcase return value handling
Remove sample reference from indexOf(Char) overload: both overloads are on
the same page, and showing the sample for indexOf(String) under indexOf(Char)
is redundant and misleading.
2019-11-29 21:34:49 +03:00