Commit Graph

150 Commits

Author SHA1 Message Date
Vyacheslav Gerasimov bc2f0936bd Build: Rename commonDep -> commonDependency 2021-12-16 21:48:19 +03:00
Alexey Subach ca2f37f6eb Add possibility to get location of the script.main.kts file
#KT-48414 fixed
2021-10-11 15:45:57 +02:00
Alexey Subach 7ddf83f32d Add link to ScriptCompilationConfiguration into ScriptEvaluationConfiguration
#KT-48758 fixed
2021-10-11 15:45:57 +02:00
Vyacheslav Gerasimov ab146bd6d4 Build: Fix deprecated Gradle configurations usages
for migration to Gradle 7+ #KTI-559
2021-09-26 18:28:44 +03:00
Ilya Chernikov e60e80f19a Scripting: improve reporting on cyclic dependency
#KT-48177 fixed
the issue is in fact fixed by the previous commit (report error
on duplicated import) by normalizing import path before processing,
but here we're making error reporting nicer for the case.
2021-08-24 21:39:33 +03:00
Alexander Udalov 0a9498f7e2 Build: suppress deprecated JVM target warning globally
There seems to be no point in configuring the compiler argument per
project. This argument will be deleted soon anyway, when we remove
support for JDK 1.6 & 1.7.

Also remove `disableDeprecatedJvmTargetWarning`. It didn't have any
effect in all modules where it was applied because these modules
reassign `freeCompilerArgs` anyway, with
`-Xsuppress-deprecated-jvm-target-warning` in it.
2021-07-27 13:35:39 +02:00
Ilya Chernikov 8eb7e719d3 [minor] fix compiler warnings in scripting modules 2021-07-20 19:42:34 +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
Yahor Berdnikau 7789054547 Migrate repo to use JVM toolchains Gradle feature.
^KT-46972 Fixed
2021-07-05 14:11:12 +00:00
Ilya Muradyan e9af2849ef Add Kotlin DeprecationLevel into the REPL completion 2021-05-07 19:56:21 +03:00
Yan Zhulanow 69fedd9791 Avoid serializing non-serializable properties (EA-253232) 2021-03-16 19:21:50 +09:00
Alexander Udalov 1d6b198915 Build: suppress version and JVM target warnings
To further reduce the output on each build.
2021-02-18 12:17:17 +01:00
Vyacheslav Gerasimov ad8709b2dc Build: Remove exclusion of kotlinx-coroutines-core in scripting-common
It breaks available-at feature used in MPP
2020-08-11 00:39:04 +03:00
Ryan Nett b1173317c5 Change scripting Severity enums to order from DEBUG to FATAL.
#KT-39502 fixed
2020-07-27 14:29:30 +02:00
Ilya Muradyan 6da22414dc [minor] Fix typo in comment 2020-06-11 16:16:12 +02:00
Mathias Quintero 83087291df Add API to get locations of collected script annotations
#KT-38404 fixed

also:
- Add wrapper class for the location combined with the location id
- Add source code location parameters to external dependency resolvers
- Add tests for locations in annotations
- Add tests for order of annotation resolution for dependencies resolvers
2020-06-10 16:28:41 +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 Chernikov 20bbcd5d5a Implement copied key with ability to take default from source config 2020-05-21 16:49:55 +02:00
Ilya Muradyan 8a1b44cc2b Add snippet result type to analysis output of REPL IDE services 2020-05-11 10:45:49 +02:00
Ilya Chernikov c496b93218 [minor] refactor repl API file layout 2020-05-11 10:45:48 +02:00
Ilya Muradyan 4c2c44b106 Add new REPL API 2020-04-16 21:16:08 +02:00
Ilya Muradyan b240fce224 Add incompleteCode diagnostic type 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 138efda19f Refactor scripting - get rid of unused type parameter in CompiledScript 2020-04-13 13:49:33 +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
Natalia Selezneva 2f35d6d868 Scripting: save inputs stamp and diagnostics to file attributes
Check if they are up to date and initiate configuration update only in case they are out of date

^KT-35205
2019-12-16 14:55:45 +03:00
Ilya Chernikov b73625ad9e Switch main-kts to the updated resolvers infrastructure 2019-11-25 14:46:32 +01:00
Anatoly Nikitin 81e2e119e2 Fix propagation of dependency resolution failure reports during script compilation 2019-11-14 08:38:50 +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
Vitaliy.Tikhonov 9b4d92cc07 [JS SCRIPTING] create evaluators for repl and scripting 2019-10-10 12:52:05 +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 f8db150a2b [minor] Drop some usages of kotlin reflection in scripting compiler plugin 2019-09-17 12:43:16 +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 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 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 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 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 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
Vyacheslav Gerasimov db3b01d2d4 Build: Centralize compiler dist build logic in :kotlin-compiler project 2019-06-27 17:56:48 +03:00