Commit Graph

135 Commits

Author SHA1 Message Date
Ilya Chernikov dec8eb7899 Revert renaming scripting plugin jar:
it conflicts with the compilation on daemon, so transistion should
be planned accordingly, and now it is not a good time for it.
The most important part of the renaming remains intact.

Partially reverts commit "Rename scripting libs and plugin - invert embeddable suffix"
2020-05-27 13:15:50 +02:00
Ilya Chernikov 2509dfb287 Rename scripting libs and plugin - invert embeddable suffix
now regular, unshaded libs, are named with suffix `-unshaded`, while
former `-embeddable` ones named without any suffix. This will encoursge
use of the shaded libs by default, avoiding conflicts with 3-party
libs packed into the `kotlin-compiler`.
Note, that only the "frontline" libs are renamed to avoid switching
problems, the ones that not normally used directly are left as is,
including the `kotlin-compiler` itself.
2020-05-26 15:58:25 +02:00
Ilya Chernikov 4b032a14af Refactor host configuration handling and script definition creation
so it is possible now to create custom host configuration with template
and all configurations are handled consistenly.
Also introduce and use new ScriptDefinition class wrapping compilation
and evaluation configurations, that could be consistenly created from a
template.
2020-05-21 16:49:55 +02:00
Ilya Muradyan d2fec96f38 Add new REPL API JVM implementation 2020-04-16 21:16:08 +02:00
Ilya Chernikov 195a90d333 Cleanup warnings in scripting code 2020-04-13 13:49:34 +02:00
Ilya Chernikov f84fd810f0 Simplify and fix classloaders handling on script evaluation
#KT-37558 fixed
2020-04-13 13:49:33 +02:00
Ilya Chernikov 138efda19f Refactor scripting - get rid of unused type parameter in CompiledScript 2020-04-13 13:49:33 +02:00
Ilya Chernikov c64ba50655 Abstract script compiled module implementation used in saving/caching
removes classloading problem when main-kts is loaded from a CL
without scripting compiler.
Also relax dependencies collection on saving to a jar and hide redundant
logging.
Running main.kts script via a run configuration works now.
#KT-37765 fixed
2020-04-13 13:49:32 +02:00
Ilya Chernikov b96109f23f Add diagnostic code to the ScriptDiagnostic
to allow checking for specific errors, e.g. incomplete statements in
the REPL
2020-02-13 11:33:40 +01:00
Ilya Chernikov a4752087db Get rid of kotlinx.coroutines usage in saved script runner
to reduce dpendencies for the save dscipt running
2020-01-21 17:42:48 +01:00
Ilya Gorbunov 59482f6827 Do not blank opt in for allowing kotlin package in all subprojects
-Xallow-kotlin-package must be specified explicitly to prevent
unintended declarations in kotlin package.
2019-10-24 16:05:48 +03:00
Roman Artemev c0f279811e [JS SCRIPT] refactor js script infrastructure
- Implement proper script compiler proxy to correctly handle script and its closed-world dependencies
 - Clean up zoo of JsScriptCompilers
2019-10-10 12:52:06 +03:00
Ilya Chernikov d3b826c71d Improve class name generation for scripts and REPL snippets
- allow to override default name/scheme
- implement host/engine specific names for jsr223 to avoid classloading
  clashes (also fix "eval in eval" test)
2019-09-17 16:05:38 +02:00
Ilya Chernikov c5f9e0a399 Fix host configuration replacements 2019-09-13 13:19:25 +02:00
Ilya Chernikov f350c24846 Implement more general "apply defaults" functionality for host configurations 2019-09-13 13:19:25 +02:00
Ilya Chernikov 8219d9853c Implement configuration for describing only published runtime dependencies...
and fix runtime dependencies for published scripting artifacts
2019-08-20 21:17:56 +02:00
Yan Zhulanow 086b151e1f Pill: Fix project build, add kotlin-scripting-jvm-host module 2019-08-07 01:15:32 +09:00
Ilya Chernikov 333c7ff688 Filter out local classes on JSR-223 properties mapping
fixes e.g. Spring framework usages of the JSR-223 engine
2019-07-26 16:28:56 +02:00
Ilya Chernikov ec3ccf1ba8 Properly handle REPL snippets with exceptions ...
so the REPL remain operational after exception in one of the snippets:
- separately return script class and script instance on evaluation (
  because in case of an exception the class is valid, while the instance
  is not).
- store both the class and the instance in the history
- handle this data accordingly
2019-07-26 08:55:16 +02:00
Ilya Chernikov 2a5c4a2409 Move caching to after all configuration refinements and ...
move compilation cache setting to the scripting host configuration
The cache implementation can now take into account all external
dependencies that may appear during refinement.
Also change initial refinement location accordingly and rearrange
caching interfaces to make it available in scripting plugin.
2019-07-26 08:55:16 +02:00
Ilya Chernikov e41bbe9328 Introducing transient properties in scripting API 2019-07-26 08:55:16 +02:00
Ilya Chernikov 42dde50b6b Implement base zip cache with tests...
plus some relevant fixes and refactorings
2019-07-26 08:55:15 +02:00
Ilya Chernikov cefd4a35c5 Fix and test evaluation of scripts with default configurations 2019-07-26 08:55:15 +02:00
Ilya Chernikov 0af52f2fa6 Implement composable refinement handlers...
for compilation and evaluation configurations.
Add utilities to apply refinements uniformly.
Also fix one invoke for list values - it was not consistent with
other builders
2019-07-26 08:55:14 +02:00
Ilya Chernikov 0108a76e99 Extract arguments calculation for base JSR223 engine into an argument 2019-07-26 08:55:13 +02:00
Ilya Chernikov e8fa139dc8 Move direct properties configuration code into public functions in scripting host jar 2019-07-26 08:55:13 +02:00
Ilya Chernikov 747c488a78 Fix entries closing on saving compiled script to jar:
also adding a short sleep in tests, otherwise in some cases the
classloader was not able to find class in the jar.
Fixes script to jar saving tests on windows
2019-07-19 16:37:49 +02:00
Ilya Chernikov 9ae0ff03fa Improve script and REPL result handling:
- implement error result
- refactor other result classes
- implement handling in the script evaluation extension - also restores
  previous script error reporting functionality
- add possibility to customize result fileds in script and REPL
- refactor result calculation in the backend: cleanup, rename (since
  it is not only about REPL now)
2019-07-11 15:50:26 +02:00
Ilya Chernikov dc4370ff08 Implement support for new script customizations in command line compiler
refactor and fix internals in many places to make it work
add appropriate tests for main-kts case
2019-07-11 15:50:25 +02:00
Ilya Chernikov cfceeb1e8c Implement direct bindings to script properties mapping in the JSR-223 implementation
fix infrastructure and codegen parts
2019-07-05 17:02:10 +02:00
Ilya Chernikov 4940f64265 Refactor scripting infrastructure - convert usages to the new entities 2019-07-05 17:02:10 +02:00
Vyacheslav Gerasimov 5a39c637c2 Build: Fix intellij dependency leak from ir tree module 2019-06-13 21:03:55 +03:00
Vyacheslav Gerasimov 5bde9720b7 Build: Fix dependencies on :kotlin-compiler project
Dependencies on :kotlin-compiler should never be used in configurations
which are imported transitively because ide fails to import it as
project dependency. When :kotlin-compiler dependency is imported as
kotlin-compiler.jar dependency ide re-indexes it on every change. This
behaviour is super annoying.

 #KT-31120 Fixed
2019-06-08 19:36:28 +03:00
Ilya Chernikov c39896165e Fix script compiler options processing 2019-06-07 23:19:16 +02:00
Ilya Chernikov e542c9ea84 Refactor script definitions and resolving/refining infrastructure:
- implement wrappers to wrap old and new API providers and resolvers
- make old API deprecated (with error where possible)
- drop old internal classes related to the old API
- refactor usages accordingly
- fix and add missing features to the scripting API where necessary
2019-06-06 17:21:00 +02:00
Ilya Chernikov deb74acc88 [minor] fixes after review 2019-05-25 10:10:34 +02:00
Ilya Chernikov a3d1fe312e Refactor default JSR-223 engine implementation:
- rename classes for clarity
- sort out dependencies
- move common pars to jvm-host jar
- switch to configurations only customization
2019-05-25 10:10:33 +02:00
Ilya Chernikov 5d8c2ae429 Fix dependencies to compiler in scripting modules 2019-05-25 10:10:32 +02:00
Ilya Chernikov 37d859c122 Move scripting jvm host tests to a separate project...
to solve problems with testing with direct dependency on proguarded compiler
2019-05-25 10:10:32 +02:00
Ilya Chernikov 1527ef7640 Drop dependencies to script-util from new scripting infrastructure 2019-05-25 10:10:32 +02:00
Ilya Chernikov 30c6147223 Get rid of UsefulTestCase to avoid dependencies, parallelize tests 2019-05-25 10:10:30 +02:00
Ilya Chernikov 1dd197f201 Add missing scripting tests to the global task, make them parallel 2019-05-25 10:10:30 +02:00
Ilya Chernikov ea068e483c Implement JSR-223 functionality on top of the "new" REPL 2019-05-25 10:10:29 +02:00
Ilya Chernikov 46915df56f Implement "legacy" REPL wrappers on top of the "new" scripting infrastructure 2019-05-25 10:10:29 +02:00
Ilya Chernikov 010ae5326d Create core environment in test mode properly 2019-05-25 10:10:28 +02:00
Ilya Chernikov 89006f16cd Prepare scripting infrastructure for REPL:
- refactor script compiler to simplify extending it for repl
- add repl snippet compilation functions to the new scripting compiler
- extract util functions into appropriate files
- extract repl part into separate class
- extract bridge definition and related definitions into separate file
2019-05-25 10:10:28 +02:00
Vadim Brilyantov 01a05a5495 Move daemon jar from compiler 2019-05-17 15:51:52 +03:00
nikita.movshin 65244b4bea Update copyright.
Change the copyright from "JetBrains s.r.o." to
"JetBrains s.r.o. and Kotlin Project contributors"
Update only 2 lines copyright.
2019-04-23 20:09:22 +03:00
Ilya Chernikov 9900ac2462 Fix runtime compatibility with the obsolete script jvm eval config options...
also switch mainKtsTest to the mew option
2019-04-18 13:01:50 +02:00
Ilya Chernikov a65dafc37d Move scripting support classes to the scripting compiler impl module 2019-04-17 22:03:58 +02:00