Commit Graph

161 Commits

Author SHA1 Message Date
Ilya Chernikov d78fc50e90 Fix after review 2016-12-15 07:26:08 +01:00
Ilya Chernikov f036422ee9 Refactor eval code to avoid compiler (codegen) hangings on various loops inside RW locks 2016-12-15 07:26:08 +01:00
Ilya Chernikov fc416476a8 Move invokable parts to JSR223 only, remove unneeded code 2016-12-15 07:26:08 +01:00
Ilya Chernikov b1cd98f2d5 Refactor and fix script annotation processing 2016-12-15 07:26:07 +01:00
Ilya Chernikov 1cc85df78e Refactor REPL infrastructure for passing evaluation/invoke wrapper to every eval/invoke function 2016-12-15 07:26:07 +01:00
Ilya Chernikov cb7f22ffec Refactor JSR223 to support Compilable interface, drop daemon eval engine and sample, simplify 2016-12-15 07:26:07 +01:00
Ilya Chernikov c82e91eafe Implement Invocable on base evaluator and locally-evaluating JSR223 sample engines
fixes #KT-14707
2016-12-15 07:26:06 +01:00
Ilya Chernikov fbd4c6eb61 Implement invokable/invoker interface on the generic repl evaluator, refactor reflection utils on the way 2016-12-15 07:26:06 +01:00
Ilya Chernikov 7a79fff9d6 Put lines history into all data structures returned by repl, refactor storage and passing of the history for that 2016-12-15 07:26:06 +01:00
Ilya Chernikov 125cc6ebfb Fix compiled line class loading in repl, fixes #KT-14706 2016-12-15 07:26:06 +01:00
Alexander Udalov d0fa9bac75 Introduce '-Xskip-runtime-version-check' command line option 2016-12-13 21:09:00 +03:00
Alexander Udalov 2c527d89ab Improve diagnostics for runtime versions consistency checker
- report the diagnostic on the actual problematic file
- output the list of all runtime jars if min version != max version
2016-12-13 21:09:00 +03:00
Mikhael Bogdanov dc5c3a478c Always use default 1.6 build target unless of 'jvm-target' option 2016-12-13 14:51:27 +01:00
Alexander Udalov d204fa91cc Use "-Xskip-metadata-version-check" to load pre-release classes 2016-12-09 01:59:35 +03:00
Alexander Udalov 414daef001 Rename KotlinVersion->KotlinCompilerVersion, move to module util.runtime
Rename to avoid confusion with the recently added kotlin.KotlinVersion
2016-12-07 21:11:15 +03:00
Alexander Udalov 204873edf2 Support "-Xno-check-impl" argument, check only real declarations
Use "-Xno-check-impl" to suppress checking whether the platform declaration
implementation has the "impl" modifier.

Do not check presence of fake overrides from platform class in the impl class,
otherwise there would be a lot of errors about the fact that
equals/hashCode/toString are not marked with the "impl" modifier
2016-11-25 20:50:29 +03:00
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