|
| 1 | +# kotlin-compiler-lite |
| 2 | +[](https://bintray.com/takhion/kotlin-metadata/kotlin-compiler-lite) |
| 3 | +[](https://mvnrepository.com/artifact/me.eugeniomarletti.kotlin.metadata/kotlin-compiler-lite) |
| 4 | + |
| 5 | +Wraps [JetBrains/kotlin] to produce a subset of the [Kotlin] compiler to be used by [kotlin-metadata]. |
| 6 | + |
| 7 | +##### It's a standalone project because versioning is parallel (follows the compiler) and building it is quite heavy, especially for the CI. |
| 8 | + |
| 9 | +## Features |
| 10 | + |
| 11 | ++ all Kotlin/Java sources, even for external dependencies |
| 12 | ++ every package relocated under `me.eugeniomarletti.kotlin.metadata.shadow.*` in both compiled classes and sources |
| 13 | ++ "full" version of all [Protocol Buffers], instead of the "lite" one used by default (see [Options > `optimize_for` > `LITE_RUNTIME`](https://developers.google.com/protocol-buffers/docs/proto#options)) |
| 14 | ++ `.proto` files `package`/`import` directives fixed to reflect their relative locations (allows inspection through [the IDE](https://plugins.jetbrains.com/plugin/8277-protobuf-support)) |
| 15 | + |
| 16 | +## Download |
| 17 | +### This should _not_ be used directly, see [kotlin-metadata] instead! |
| 18 | +```gradle |
| 19 | +compile "me.eugeniomarletti.kotlin.metadata:kotlin-compiler-lite:$version" |
| 20 | +``` |
| 21 | + |
| 22 | +## Random notes |
| 23 | + |
| 24 | ++ since having different versions of the gradle wrapper often makes the CI run out of memory and fail, `gradlew` is a symlink to the one in the wrapped repository |
| 25 | ++ doesn't modify any files on the original build, instead relies on runtime injection of modules through an |
| 26 | +[initialization script] |
| 27 | ++ overrides are performed in [`kotlin.init.gradle`] and [`__injected/override/build.gradle.kts`] |
| 28 | ++ the [top level build](build.gradle.kts) handles: |
| 29 | + + downloading external dependencies |
| 30 | + + starting inner build with init script |
| 31 | + + uploading generated artifacts |
| 32 | + |
| 33 | +[kotlin-metadata]: https://github.com/Takhion/kotlin-metadata |
| 34 | +[JetBrains/kotlin]: https://github.com/JetBrains/kotlin |
| 35 | +[Kotlin]: https://kotlinlang.org/ |
| 36 | +[Protocol Buffers]: https://developers.google.com/protocol-buffers/ |
| 37 | +[initialization script]: https://docs.gradle.org/current/userguide/init_scripts.html |
| 38 | +[`kotlin.init.gradle`]: kotlin.init.gradle |
| 39 | +[`__injected/override/build.gradle.kts`]: __injected/override/build.gradle.kts |
0 commit comments