Files
kotlin-fork/libraries/stdlib
Dmitry Savvinov 668bd209f2 Use -Xallow-kotlin-package while compiling common sources
K2MetadataCompiler doesn't perform explicit check of compilation of
'kotlin' package, thus stdlib build wasn't passing '-Xallow-kotlin-package'.

However, we have special hack for compiling stdlib with contracts: if
'-Xallow-kotlin-package' is passed, then allow compiling contracts for
custom functions. We have to do it this way, because we don't want
stdlib artifacts to be marked with pre-release flag, even though
contracts for custom functions are not enabled yet
(see eae9923dbe).

Therefore, it's crucial to pass -Xallow-kotlin-package properly for that
side-effect.
2018-07-09 18:57:58 +03:00
..

The Kotlin Standard Library

This module creates the standard library for Kotlin.

Notes for contributors

We use some code generation to generate the various utility extension function for the various collection-like types like arrays, strings, Collection<T>, Sequence<T>, Map<K, V> etc.

These sources are placed into generated folder and their names are prefixed with the underscore, for example generated/_Collections.kt

To run the code generator use the following command in the root directory of the project:

./gradlew :tools:kotlin-stdlib-gen:run

Note: on Windows type gradlew without the leading ./

This then runs the script which generates a significant part of stdlib sources from the templates authored with a special kotlin based DSL.

Usage samples

If you want to author samples for the standard library, please head to the samples readme.