It's necessary to use bootstrap-compiler and runtime but new compiler in classpath when increasing ABI.
For example ABI was X, then we increase it to X':
- It compiles in Bootstrap (B) build with compiler that knows
old ABI version, so compiled compiler (C1) will still have version X, but new
runtime's version is X' (R1).
So when we compile android-compiler-plugin each part has version X.
- Then project compiles by new compiler (C1)
(that class-files have ABI version X, but it knows about X') in main build.
Here compiled compiler (C2) will have X' version of class-files,
either has runtime (R1) compiled on previous stage.
On this step android-compiler-plugin will be compiled fine by C1 and with C2, R1.
Reflection will be distributed in a separate jar and not in kotlin-runtime.jar
for two primary reasons:
- Reflection implementation at the moment takes almost 2Mb
- Separate libraries for separate features is a technique encouraged by Maven,
and it's inconvenient to make it different in the compiler distribution
Generate K*Function as a supertype for a function reference instead of
K*FunctionImpl; this will allow one binary library to be used with or without
reflection
- passing sources to "-classpath" is no longer needed because the logic was
implemented in K2JVMCompiler
- skipping javac2 for stdlib is no longer needed because the corresponding
error is no longer reproducible since "skip" was added to javac2
- get rid of unneeded properties in favor of Ant's toString feature
We skip all classes annotated with kotlin/jvm/internal/<anything> (currently
KotlinClass, KotlinPackage and KotlinSyntheticClass) because Kotlin compiler
emits its own nullability assertions
Do not pack the runtime into the compiler on the first step of bootstrap, but
rather leave it as a separate file named kotlin-runtime-internal-bootstrap.jar.
This new solution will allow compiler to use its own classes from "core", not
the ones used by the runtime it depends on
ProGuard complains if we're trying to shrink compiler with the full runtime in
dependencies because for the compiler produced on the first step of bootstrap
these two jars contain conflicting classes. This won't matter in the final
distribution because we will strip 'core' modules from compiler.jar. But this
matters in the first step because core will be different in the compiler (used
to load compiled class files) and in the reflection (used to introspect symbols
at runtime).
kotlin-runtime-minimal.jar still contains the complete reflection API and some
stub implementations in module 'reflection.stub.jvm', but doesn't have core, so
it won't cause a proguard error
This will allow a more controlled management of the runtime that the compiler
is linked against. Incidentally this also allows Ant task to use any of
compiler arguments via <compilerarg> because Ant task is now just a facade for
the CLI compiler.
The test "wrongArguments" is deleted because the full compiler usage is now
printed out on a wrong <compilerarg>, and this will become inconvenient to
update with each change in compiler arguments
#KT-5618 Fixed
Fail on duplicate when packing kotlin-jslib.jar and kotlin-jslib-sources.jar
Move files from root of stdlib to avoid existing conflicts
Rename System to SystemJvm to avoid including to js lib
This helps to specify custom runtime for the newly built kotlin2js (which is
supposed to be different for the two bootstrapping steps). Also now it's not
required to launch ant-tools task before jslib to build JS library