Commit Graph

145 Commits

Author SHA1 Message Date
Alexander Udalov ec03c6decb Introduce K2MetadataCompiler, extract MetadataSerializer out of BuiltInsSerializer
K2MetadataCompiler is a compiler facade similar to K2JVMCompiler and
K2JSCompiler and it produces .kotlin_metadata files. Each .kotlin_metadata file
contains the binary data which is a serialized BuiltIns protobuf message.

There's no 'kotlinc-***' script yet though, so to run this compiler currently
invoke this:

    KOTLIN_COMPILER=org.jetbrains.kotlin.cli.metadata.K2MetadataCompiler kotlinc
2016-11-25 20:50:09 +03:00
Alexander Udalov 73f872172f Add multi-platform projects as experimental language feature 2016-11-22 18:19:01 +03:00
Mikhael Bogdanov 61da8be260 Generate parameters metadata for java 8 reflection 2016-11-14 14:27:08 +01:00
Alexey Tsvetkov f381f1e699 Revert default value for "main" parameter for Gradle JS plugin to "call"
#KT-14724 fixed
2016-11-11 21:25:05 +03:00
Alexander Udalov 8c65379711 Support injecting custom module into KotlinBuiltIns
Provide a command-line option to load built-ins from the module and its
dependencies instead of looking for them in kotlin-compiler.jar; built-ins must
be found this way, or an error will be reported (or, most likely at this
moment, an exception will be thrown).

Note that this does not affect whether built-ins (loaded from one place or the
other) are added to the _dependencies_ of the module, this is controlled by
another option. The option added in this commit only makes the KotlinBuiltIns
instance which is used via ModuleDescriptor throughout the compiler front-end
(and also injected in a bunch of places) a sort of "helper" which always goes
to that same module to find descriptors for built-in classes
2016-11-08 12:14:24 +03:00
Alexey Sedunov d0de9dd43c Kotlin Facet: Get rid of copy constructors for compiler arguments/settings and use reflection-based copying instead 2016-11-07 20:03:29 +03:00
Alexey Sedunov a2948a624f Kotlin Facet: Reuse JvmTarget and LanguageVersion in facet configuration 2016-11-07 20:03:28 +03:00
Alexander Udalov c49c019250 Add option to restore fallback to compiler built-ins + resurrect Maven build 2016-10-26 19:02:31 +03:00
Alexey Sedunov ea13456bba Kotlin Facet: Add compiler settings to facet configuration 2016-10-26 15:03:42 +03:00
Ilya Chernikov c2b5c11781 Fix all small and medium-sized issues after review 2016-10-12 15:37:54 +02:00
Ilya Chernikov 10d259771c Refactor repl and JSR 223 support code, add separate example jars for each type of JSR 223 repl (with tests) 2016-10-12 15:37:52 +02:00
Ilya Chernikov bf0d5b6237 Add basic bindings support to IDEA JSR223 scripting, fix evaluator 2016-10-12 15:37:51 +02:00
Ilya Chernikov 43037373d7 Implement params to pass args to generic and remote repls to support script templates with params 2016-10-12 15:37:50 +02:00
Ilya Chernikov 1a137357e5 Add support for custom script compilation and execution to maven plugin, add simple test, relevant refactorings on the compiler side 2016-10-12 15:37:49 +02:00
Ilya Chernikov 86ece30330 Add remote repl support to the daemon, refactor repl classes accordingly, simple tests 2016-10-12 15:37:49 +02:00
Ilya Chernikov 042fc4fadc Add remote input stream support, plus minor tweaks 2016-10-12 15:37:49 +02:00
Ilya Chernikov eaa332019a Prepare repl interfaces and generic implementation for separation into possibly remote parts 2016-10-12 15:37:48 +02:00
Ilya Chernikov 63c5133167 Remove support for xml-based script configs, other minor refactorings 2016-10-12 15:37:47 +02:00
Alexander Udalov 167ab1f860 Introduce "-api-version" CLI option
The `@SinceKotlin("X.Y.Z")` annotation now hides a particular declaration from
resolution when the API version specified by the `-api-version` option is
_less_ than X.Y.Z. The comparison is performed as for versions in Maven:
MavenComparableVersion is in fact a copy of
org.apache.maven.artifact.versioning.ComparableVersion.

Also support "!API_VERSION" directive in diagnostic tests

 #KT-14298 Fixed
2016-10-11 17:46:01 +03:00
Alexander Udalov 8d660c2f6e Refactor gradle option generation mechanism
Ensure there's a statically checked dependency on LanguageVersion and
JvmTarget, so that this information is updated automatically once a new
language version or a JVM target is added
2016-10-11 17:30:15 +03:00
Alexey Tsvetkov 0944e9076d Add 1.1 language version to kotlin options for Gradle 2016-10-05 22:50:46 +03:00
Alexey Tsvetkov 892fc63fd1 Generate gradle options from compiler arguments
#KT-13633 fixed
2016-10-05 22:50:46 +03:00
Michael Bogdanov dd4d5e3aa1 Generate 'DefaultImpls' for jvm 8 target only within compiler option 2016-10-03 14:05:59 +03:00
Alexander Udalov 45190d9453 Support separate modules in compiler
Unless the compatibility option "-Xsingle-module" is passed, the compiler will
create two modules instead of one now (see TopDownAnalyzerFacadeForJVM): the
main module contains Kotlin and Java sources and binaries from the previous
compilation of the given module chunk, the dependency module contains all other
Kotlin and Java binaries. This fixes some issues where the compiler couldn't
detect that the used symbol was from another module, and did not forbid some
usages which are only possible inside the module (see KT-10001).

The ideal way to deal with modules here would be to exactly recreate the
project structure, for example as it's done in JvmAnalyzerFacade and usages.
This is postponed until later

 #KT-10001 Fixed
 #KT-11840 In Progress
2016-10-02 21:15:47 +03:00
Alexander Udalov 5d37fab4f5 Minor, add toString for debug 2016-10-02 21:03:29 +03:00
Yan Zhulanow 84d62f37eb Kapt: Analyze sources again if the received analysis result is 'RetryWithAdditionalJavaRoots'. ->
Add additional Java roots to Java source roots and clear diagnostic messages before the next analysis round.
(cherry picked from commit 17ad807)
2016-08-29 16:31:16 +03:00
Ilya Chernikov 46a7c706e1 Fixes and refactorings after review 2016-08-11 09:11:11 +02:00
Ilya Chernikov 6c0b78fb01 Add script-templates option to compiler options, fix templates and definitions loading in compiler 2016-08-11 09:08:40 +02:00
Alexander Udalov 0d26087040 CLI, Ant: add kotlin-reflect.jar to classpath by default, support "-no-reflect"
Note that now "-no-stdlib" implies "-no-reflect".

 #KT-13237 Fixed
2016-08-09 11:24:24 +03:00
Alexey Andreev 33248e7721 KT-3008: minor code style fixes 2016-06-27 15:33:31 +03:00
Alexey Andreev 97605a97da KT-3008: multiple minor fixes after code review 2016-06-27 15:33:28 +03:00
Alexey Andreev b090b79d92 KT-3008 Add UI that allows to change module kind in IDEA Kotlin configurator 2016-06-27 15:33:26 +03:00
Alexey Andreev 848d7f92fa KT-3008 Implement AMD, CommonJS and UMD wrappers. Compile stdlib and builtins modules into separate JS files and wrap them in UMD. 2016-06-27 15:33:24 +03:00
Alexey Andreev 95b78e18df KT-3008 Change the way how modules are referenced in JS 2016-06-27 15:33:23 +03:00
Ilya Gorbunov 7c5c4610e8 Rename -jdk compiler option to -jdk-home (jdkHome), add jdk path validation. 2016-06-23 22:47:45 +03:00
Ilya Gorbunov 644df89dc9 CLI: Allow to specify JDK for classpath building with '-jdk' compiler argument.
Maven: support jdk parameter linked to kotlin.compiler.jdk property.
Gradle: support jdk compiler option.
2016-06-23 22:46:07 +03:00
Alexander Udalov da332d1a27 Validate "-jvm-target" value in CLI, improve message 2016-06-16 16:51:18 +03:00
Mikhael Bogdanov 3a8591a729 Support 'jvm-target' in CLI 2016-06-15 13:43:29 +03:00
Ilya Chernikov 3e6616de42 Read script config if appropriate flag is specified, fix classpath handling 2016-06-07 21:12:58 +02:00
Alexander Udalov e1ba4480d7 Support "-language-version" CLI option for compatibility with older releases
Introduce LanguageFeatureSettings, instance of which should be injected by the
container and be accessible everywhere during the compilation (front-end and
back-end).

Parameters of LanguageFeatureSettings are unused in this commit, will be used
later
2016-05-26 22:15:39 +03:00
Alexander Udalov 3c81bb4bfc Add MessageCollector#hasErrors, get rid of MessageSeverityCollector
Also fix duplicated wrapping of a message collector into a message severity
collector (in CLICompiler and in the beginning of doExecute in
K2JVMCompiler/K2JSCompiler)
2016-05-26 11:47:30 +03:00
Alexander Udalov dcb2d7b4f6 Minor, break the line in "kotlinc -help" if it's too long
To improve description of the "pluginOptions" flag
2016-05-23 14:47:00 +03:00
Alexander Udalov a8629b3836 Do not fail on unknown -X flags
For better compatibility if we add experimental stuff in 1.0.X compilers
2016-04-12 20:03:51 +03:00
Dmitry Petrov 0ccaf43e2c KT-11410: Add Xmultifile-parts-inherit CLI option. 2016-04-01 10:13:21 +03:00
Ilya Gorbunov e7d75fccd6 Introduce compiler option to dump declaration mapping. 2016-03-29 13:49:34 +03:00
Ilya Gorbunov 02bb7f2f0d Remove the compiler option "Xmultifile-facades-open" 2016-03-15 14:10:33 +03:00
Alexander Udalov 714df7b433 Add temporary compiler option to suppress incompatibility errors
To compile Kotlin against current IDEA libraries until they are migrated to 1.1
2016-01-22 23:53:47 +03:00
Dmitry Jemerov 39ad2b2378 return correct exit code when script execution fails 2016-01-19 10:53:48 +01:00
Dmitry Jemerov f3faa10fcc forbid compiling code in packages with names starting with 'kotlin' unless the -Xallow-kotlin-package command line option is specified 2016-01-19 10:53:47 +01:00
Dmitry Jemerov 117a0d8b7b compiler: cleanup 'public', property access syntax 2016-01-07 17:57:38 +01:00