Ilya Chernikov
a12ea37ae8
[minor] Fix non-fatal exception during the embeddable test
2019-09-13 13:19:26 +02:00
Ilya Chernikov
45f5c42a53
Add appropriate script extension to the source name, if not provided
...
#KT-31704 fixed
2019-09-13 13:19:26 +02:00
Ilya Chernikov
92778cc5b5
Set contextClassLoader for the script evaluation
...
#KT-31661
2019-09-13 13:19:26 +02:00
Ilya Chernikov
771f5c13dd
Fix imported script functionality in JSR-223/REPL:
...
- setup compilation properly to take imported scripts into account
- add compiled imported scripts into generated results
= calculate ScriptLightVirtualFile path as relative - simplifies imported scripts location
2019-09-13 13:19:26 +02:00
Ilya Chernikov
0fe137d75c
Fix script arguments order for imports with implicit receivers
...
#KT-33572 fixed
2019-09-13 13:19:25 +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
Sergey Rostov
5b48dcca4f
ResultWithDiagnostics: remove unused equals and hashCode
...
They are overridden by sealed data classes
2019-09-06 09:33:33 +03:00
Ilya Chernikov
947867286c
[minor] Fix potential problems with sequence, add a todo
2019-08-28 17:59:12 +02:00
Ilya Chernikov
0f41dc814f
Switch many common tasks defined in buildSrc to lazy creation
...
also refactor some locally defined tasks to the creation avoidance API
2019-08-21 20:20:08 +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
Ilya Chernikov
cddabf140b
Implement proper expression generation for the last script line
...
fixes problem with result fields
#KT-33127 fixed
2019-08-07 11:26:37 +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
aed9b13455
Fix jvm-host-embeddable artefact generation
2019-07-26 16:29:45 +02: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
a858607fac
Fix script classpath utility functions that use classpath filtering by "keys"
...
The problem was that only the first matching classpath entry were used.
The problem was reported by @lion7 on github (https://github.com/JetBrains/kotlin/commit/67ad3773de2b12f7e1d29e00151b997a4f6373ba#commitcomment-34443927 )
2019-07-26 08:55:16 +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
288fdc0952
Add a handler for providing evaluation context for scripts
...
use it on refinement.
also some refactoring on context class and around
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
c7eb9e9520
Move caching tests into a dedicated class
...
plus some tests 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
961607673d
[minor] Refactor properties collection builder:
...
add a helper to replace the value only if it is absent or default
rearrange some functions
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
65e6d3b0ff
[minor] Add a small diagnostics handling utility fun
2019-07-26 08:55:14 +02:00
Ilya Chernikov
b68ab0d968
Add test on repl with implicit receiver
2019-07-26 08:55:14 +02:00
Ilya Chernikov
a13d452cd8
Implement JSR223 host in the main-kts jar
...
also improve diagnostics on configuration instantiation
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
bd50454a73
Change default for script displayName parameter to empty, generate name from base class in definition
2019-07-12 13:44:09 +03:00
Ilya Chernikov
0cc40440fb
Implement filePathPattern in the script configuration with handling
...
also
- tests
- extending kdoc for the definitions
2019-07-12 13:44:09 +03:00
Ilya Chernikov
c08b88281c
Remove accidetial usages of the internal jdk classes
2019-07-11 15:50:27 +02:00
Ilya Chernikov
c9a4328feb
Fix compiled scripts saving tests:
...
The tests were broken some time ago by applying script isolation, so
it was necessary to add base libraries into the classpath.
Also refactored some classpath building utilities.
2019-07-11 15:50:26 +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
Natalia Selezneva
923e89db69
Provide toString method for ScriptCompilationConfigurationWrapper
...
This is needed for debug and logging proposes
2019-07-10 10:10:20 +03:00
Ilya Chernikov
a96a938f87
Fix creating of the script definition from legacy template
...
adding classpath needed to load template and related class to the
appropriate host configuration
fixes tests
2019-07-08 13:20:06 +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
db3b01d2d4
Build: Centralize compiler dist build logic in :kotlin-compiler project
2019-06-27 17:56:48 +03: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
e5054f9648
Refactoring scripting infrastructure:
...
- add a helper for new constructing Compilation Configuration only when necessary
- add more converters for legacy diagnostics
- add helpers for simpler creating of failure results
2019-06-06 17:21:00 +02:00
Ilya Chernikov
b7fd898bb8
Add explicit return types to helpers
...
also workarounds a problem (KT-30297) with new inference
2019-06-06 17:21:00 +02:00
Ilya Chernikov
4fb2f81134
Refactor scripting - prepare utilities for refactoring of the script definitions handling
2019-06-06 17:20:59 +02:00
Ilya Chernikov
0a6ade88cc
Fix classpath detection from classloader resources
2019-06-03 13:57:20 +02:00