Ilya Chernikov
0d7a5c6b1b
Scripting: fix string script source location
...
fixes proper script definition discovery for expressions and other
scripts created from a string.
2023-07-26 08:49:26 +00:00
Ilya Chernikov
6c035bb5f4
Scripting: support scripts starting with UTF-8 BOM
...
#KT-54705 fixed
2023-01-15 20:11:56 +01:00
Ilya Chernikov
5d968bc2f4
Fix gradle scripts detection in the sources
...
#KT-54325 fixed
2022-10-31 09:30:13 +00:00
Ilya Chernikov
855059b93c
Scripting: update scripts in source roots handling
...
#KT-52525 fixed
related to #KT-52735
2022-06-16 21:28:06 +00:00
Egor
6d1fe3a962
Fixing merge of script fragments + UT
2022-02-23 18:58:29 +03:00
Ilya Chernikov
0cd29adcc7
Get rid of kotlinx-coroutines usage in scripting libs and plugins
...
the dependency on the coroutines library caused various problems like
KT-30778, or stdlib/runtime version conflicts.
The only function used was `runBlocking`, so this change replaces it
with the internal implementation based on the similar internal thing
from the stdlib.
#KT-30778 fixed
2021-07-19 16:35:36 +03: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 Chernikov
f350c24846
Implement more general "apply defaults" functionality for host configurations
2019-09-13 13:19:25 +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
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
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
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
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
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
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
7ae2054cba
Add a link to hostConfiguration from compilation and evaluation ones
...
also add possibility to supply functional defaults for keys in PropertiesCollection
2019-05-25 10:10:31 +02: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
90444502a6
Extend evaluation API for easier passing of evaluation configuration
...
refactor helpers accordingly
2019-04-16 11:55:22 +02:00
Ilya Chernikov
931b1c66d8
Fix equality and serializability of scripting data, fix relevant caching behaviour
2019-03-19 17:11:52 +01:00
Ilya Chernikov
4571e273a4
Add shared script instances support, fix and refactor evaluation accordingly
...
also fix arguments order in the evaluator
2019-01-10 10:59:32 +01:00
Ilya Chernikov
44ea2bf1d4
Introduce script names and location ids, use them in diagnostics and...
...
for virtual file names. Also fix compiled script serialization.
2018-12-20 17:09:23 +01:00
Ilya Chernikov
1e74ab5a62
Implement import test, fix import support in compiler and evaluator
2018-12-20 17:09:19 +01:00
Ilya Chernikov
77a4505ec2
[minor] get rid of obsolete "environment" wording
2018-12-13 18:00:12 +01:00
Ilya Chernikov
3fe324bbb4
Add UrlScriptSource
2018-12-13 18:00:08 +01:00
Dmitry Petrov
0191e3d1cf
Migrate to release coroutines
2018-09-27 21:59:31 +03:00
Ilya Chernikov
d760299dc1
Implement context classpath extraction using particular class,...
...
Use it in the main-kts.
Also improve diagnoistics related to the definition loading.
#KT-26828 fixed (after this commit - finally, see also another related commit)
2018-09-15 15:44:53 +02:00
Ilya Chernikov
712e23f8b0
Document scripting common API, drop unused bits
2018-09-11 14:56:53 +02:00
Ilya Chernikov
a02d5b4b21
Rename script annotation params according to configuration keys...
...
rename evaluation params consistently too
2018-09-11 14:56:51 +02:00
Ilya Chernikov
836ea28fe7
Renaming remaining former "environment"-related identifiers
2018-09-06 19:17:44 +02:00
Ilya Chernikov
6c60e38260
Add compatibility with templates from script-runtime...
...
and add script-runtime to the compilation classpath by default
2018-09-06 19:17:44 +02:00
Ilya Chernikov
6716c512d3
[minor] Rename too long named functions
2018-09-06 19:17:43 +02:00
Ilya Chernikov
67ba8b5361
Rename ScriptSource to SourceCode, extract location to another i-face...
...
other related refactorings. The goal - make interface terminologically
more suitable for usage in REPL.
2018-09-06 19:17:43 +02:00
Ilya Chernikov
01eca8bac8
Clean up properties collection
2018-08-23 09:51:53 +03:00
Ilya Chernikov
c2e6c0ed49
Rename ScriptingEnvironment to ScriptingHostConfiguration
2018-08-23 09:51:53 +03:00
Ilya Chernikov
2fe5f78921
Rename ScriptEvaluationEnvironment into ScriptEvaluationConfiguration
2018-08-23 09:51:53 +03:00
Ilya Chernikov
bd8f2a81e9
Rename ScriptDefinition to ScriptCompileConfiguration
2018-08-23 09:51:53 +03:00
Ilya Chernikov
acb0f6c6a9
Remove ScriptCompileConfiguration as separate entity, refactor pieces accordingly
2018-08-23 09:51:53 +03:00
Ilya Chernikov
04ffe7754e
Refactoring properties collection after review
2018-08-23 09:51:53 +03:00
Ilya Chernikov
74f8a541c0
Grand refactoring of the scripting DSL + many minor usability refactorings around it
2018-08-23 09:51:53 +03:00
Ilya Chernikov
45eaca1290
Add diagnostics chaining
2018-08-23 09:51:53 +03:00
Ilya Chernikov
c41717d03b
Make definition a part of the basic hosts, simplify usages
2018-08-23 09:51:53 +03:00
Ilya Chernikov
d0ed86c11c
Add REPL interfaces to scripting API
2018-08-23 09:51:53 +03:00
Ilya Chernikov
5ca4a21edf
Convert evaluator interface to function
2018-08-23 09:51:53 +03:00
Ilya Chernikov
9b7eeebaaa
Convert compiler interface to function
2018-08-23 09:51:53 +03:00
Ilya Chernikov
91e6c0b77c
Remove evaluator from script definition, simplify interface
2018-08-23 09:51:53 +03:00
Ilya Chernikov
a54675abe7
Clean and fix new scripting API
2018-08-23 09:51:53 +03:00
Ilya Chernikov
191b1cfefa
Refactor configurations handling:
...
- rearrange compile call parameters for clarity, more defaults
- remove baseConfiguration method - it is now covered by defaultConfiguration
for static part, and refineConfiguration call if a config parameter is
specified
- implement proper configurations chaining, documented in comment to compile function
- minor renamings and refactorings
2018-04-04 16:23:58 +02:00
Ilya Chernikov
4a4edf3458
[minor] Renames and rearrangements for clarity
2018-04-04 16:23:58 +02:00
Ilya Chernikov
5058c66e8c
Refactor scripting properties:
...
- flatten the structure
- add some parameters
- replace iterables with lists
- renaming all scope objects uniformily
also:
- fix passing and usage of script sources
- renamings and other minor improvements
2018-04-04 16:23:58 +02:00