tree: 3c4e77f31067791986ce606df374c635200343fa
  1. common/
  2. common-js-wasmjs/
  3. common-non-jvm/
  4. jdk7/
  5. jdk8/
  6. jklib-for-test/
  7. js/
  8. js-ir-minimal-for-test/
  9. jvm/
  10. jvm-minimal-for-test/
  11. native-wasm/
  12. samples/
  13. src/
  14. test/
  15. unsigned/
  16. wasm/
  17. build.gradle.kts
  18. gradle.properties
  19. kotlin-project-structure-metadata.beforePatch.json
  20. kotlin-project-structure-metadata.json
  21. ReadMe.md
libraries/stdlib/ReadMe.md

The Kotlin Standard Library

This module creates the standard library for Kotlin.

Code generation

We use code generation to generate some repetitive utility extension functions, e.g. for collection-like types: arrays, strings, Collection<T>, Sequence<T>, Map<K, V> etc. Those are defined in templates written in a special Kotlin-based DSL.

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

To run the code generator, use the following task:

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

Usage samples

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