Commit Graph

18 Commits

Author SHA1 Message Date
Alexander Udalov 72c52d37ae Add some -X flags for compatibility to kotlin-reflect build
"-Xno-kotlin-nothing-value-exception" is needed to temporarily prevent
the problem happening in the composite build with Kotlin/Native
(ClassNotFoundException from KClassImpl.Data).
"-Xno-optimized-callable-references" is added just in case of any
similar problem.
2020-04-17 18:34:45 +02:00
Ilya Gorbunov 1727fcf1a8 Make some build properties extensions in buildSrc
They are used only in main build's .gradle.kts files, so it is more
flexible to define them as extensions - no need to republish
kotlin-build-gradle-plugin when another such property is to be added.
2020-04-02 05:21:10 +03: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
Sergey Rostov fb3f28974e Build: support local.properties for JPS build. Apply JPS related tweaks only inside IDEA import. 2019-03-28 10:06:16 +03:00
Sergey Rostov 12cfd6396d JPS build flag: exclude java9 when jps build enabled 2019-01-28 13:43:07 +03:00
Vyacheslav Gerasimov f58acbeef5 Build: implement useBootstrapStdlib flag
Excludes stdlib projects from build and uses bootstrap stdlib artifacts

 #KT-29205
2019-01-21 21:09:40 +03:00
Sergey Rostov 883970fadb Add explicit dependencies to nullable annotations 2018-12-26 09:07:06 +03:00
Ilya Gorbunov e49789f819 Build java9 modular artifacts under 'modular' classifier
Provide additional modular artifacts as a workaround for KT-21266

Update module-info declarations:
  - add new packages
  - add exports and opens for internal PlatformImplementations
  - remove exports of kotlin.coroutines.experimental.*

#KT-27919 Fixed
2018-11-01 02:27:49 +03:00
Ilya Gorbunov 03340d770b Replace remaining distJar dependencies with default configuration dependencies 2018-09-12 06:05:05 +03:00
Alexander Udalov 1f4dfbf5f3 Fix compilation of Java 9 sources for kotlin-reflect-api
Do not pass the jars for modules such as descriptors, descriptors.jvm,
etc to `--module-path` because javac assumes that these are separate
modules (even though they're listed later as parts of this module in
`--patch-module), and prohibits to have split packages and foreign
service implementations among them
2018-07-13 18:45:09 +02:00
Alexander Udalov 959c2f4843 Get rid of split packages in descriptors, descriptors.jvm, deserialization
Also move some other files to related packages and reformat moved files
2018-07-06 14:08:35 +02:00
Ilya Gorbunov d9656a939b Do not produce libraries json declarations dump
It's no longer needed for checking binary compatibility.
Clean build of these libraries is no longer required too.

Cleanup build.gradle of binary-compatibility-validator.
2018-05-23 05:00:57 +03:00
Denis Zharkov 003f381fcd Replace default-type dependencies to :kotlin-stdlib with distJar
Use distJar configuration instead.
It's necessary because currently when using default-type, subproject
starts having a transitive dependency to :kotlin-stdlib-common
and that leads to exception from KT-20897 when building light classes

This change might be reverted once KT-23942 is fixed

 #KT-23942 Submitted
2018-04-26 16:11:27 +03:00
Alexander Udalov dd3cf531cf Disable packing module-info to libraries until Android issue is fixed
https://issuetracker.google.com/issues/77587908

 #KT-21266 Open
2018-04-05 19:18:05 +02:00
Ilya Gorbunov 299d6fa772 Use default compileJava9Java task to build java9 source set 2018-04-03 21:24:34 +02:00
Alexander Udalov 828cc6dbf3 Add module-info.java for kotlin-reflect
The standard way of loading resources with built-ins metadata from the
current class loader no longer works in the modular mode on Java 9
because the current class loader is for module 'kotlin.reflect', but the
metadata is located in the module 'kotlin.stdlib'. On Java 9, we now use
the class loader of 'kotlin.stdlib' to load these resources.

 #KT-21266 Fixed
2018-04-03 21:24:03 +02:00
Alexander Udalov 964bf503a6 Fix warning about kotlin-reflect-api bundling Kotlin Runtime
This fixes the "Some JAR files in the classpath have the Kotlin Runtime
library bundled into them" warning when compiling all modules that
depend on kotlin-reflect-api. This warning is reported on jars in the
classpath which look like standard library artifacts, but in fact are
not because their manifest does not say so. With this change, we're now
writing the manifest of standard library artifacts to the resulting jar
of kotlin-reflect-api, with the standard library component name
"internal" (in fact, it doesn't affect anything here, any name would be
OK) to make the compiler believe that this is actually a standard
library jar
2018-04-03 13:18:56 +02:00
Alexander Udalov 329fbd8fa8 Extract kotlin-reflect-api module out of kotlin-reflect
This is needed only for faster compilation of the Kotlin project itself
and has no effect on the public artifact
org.jetbrains.kotlin:kotlin-reflect.

The problem this is solving is the rebuild of the project once anything
has been changed in modules in 'core' (even inside function bodies, i.e.
a non-API change). Previously, changes in 'core' led to the compilation
of kotlin-reflect, which led to the rebuild of all modules depending on
kotlin-reflect directly or indirectly (which is almost all modules in
the project) because kotlin-reflect's artifacts are custom-built and the
changes can not be picked up incrementally. But 99.9% of the time the
initial changes in 'core' could not have any effect on the usages of
kotlin-reflect, because classes from those modules are moved to an
internal package in kotlin-reflect and thus are an internal
implementation detail.

Now, changes in 'core' still lead to the compilation of kotlin-reflect
and to the process of building the custom jar. But if a module depends
on kotlin-reflect-api, not kotlin-reflect, then the incremental
difference checker will detect that the module does not have to be
recompiled if there hasn't been any changes to the API of
kotlin-reflect-api. Which means that the module will not be rebuilt on
every change in 'core'.

This commit only introduces the new module. The dependencies
(kotlin-reflect -> kotlin-reflect-api) are replaced in the next commit.
2017-11-28 12:35:48 +01:00