Commit Graph

173 Commits

Author SHA1 Message Date
Yahor Berdnikau 6b19b8b9d0 [Repo] Don't use kotlinOptions in repo build scripts
^KT-63419 In Progress
2024-02-22 14:48:10 +00:00
Ilya Chernikov e927ac5fc3 Scripting: ignore some diags if artefact is resolved
The failure diagnostics from resolvers are ignored now if followed
by a successful result from a following resolver.
#KT-63352 fixed
the commit is idirectly tested by the test MainKtsIT.testUseSlf4j
from the followin commit "Scripting: ignore some diags if artefact is
resolved", namely without these changes, additional two warnings are
reported in this test.
2023-11-10 17:24:12 +00:00
Ilya Muradyan 841cc8eb43 Scripting, KT-61727: Make it possible to resolve multiple artifacts at once
For MavenDependenciesResolver it improves performance drastically
depending on how strong transitive dependencies of the roots interfere

^KT-61727 Fixed
2023-09-14 12:14:32 +00:00
Alexander.Likhachev 53fde520d5 [Build] Add jUnit dependencies in testApiJUnit5 to the implementation configuration
Adding these dependencies to the `api` configuration pollutes classpath for each dependant modules even if it doesn't need them. Instead, the dependencies should be declared more granularly if they're required
#KTI-1349 In Progress
2023-09-06 22:47:34 +00:00
Alexander.Likhachev 357d12fc8e [Build] Move JUnit dependencies into the version catalog
The `kotlin-test` dependencies are left untouched as changing them affects publications, thus these versions are independent from the used inside our build
#KTI-1349 In Progress
2023-09-06 22:47:33 +00:00
Ilya Chernikov 020a590df7 K2 Scripting: fix order of arguments processing
and base class handling:
Since in K2 we do not distinguish between script arguments taken from
the base class and provided properties, we need this extra functionality
to preserve the argument order of K1 scripts.
This is a temporary measure, since we're going to deprecate base class
usage at some point (KT-60449), so the relevant constructor arguments
should disappear too.
2023-07-26 08:49:27 +00:00
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 699ef5490b Scripting: using kotlin type names instead of java ones
avoids problems with K2 resolving of the java types in unexpected
places
2023-06-20 16:38:33 +00:00
Yahor Berdnikau eb4e96a113 Add kotlin-build-tools-enum-compat workaround
It acts as a workaround for the case when build tools or dependencies
are compiled with latest 'kotlin-stdlib' version, but at a runtime older
 'kotlin-stdlib' is provided, which does not know about new
 `EnumEntries`.

 ^KT-57317 Fixed
2023-04-21 14:57:17 +00:00
Yahor Berdnikau 0cad069522 [Build] Pin api and language level to 1.8 in Kotlin compiler modules used by KGP
This is required to be able to compile KGP and it's dependencies which
set LV to 1.4 when repo will use LV 1.9. This caused by the change how
enums are compiled (KT-48872).
2023-02-18 13:26:54 +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
Nikita Bobko 2a4f3f41aa 2/5 Replace source dependency on kotlin-reflect with binary dependency
Review: https://jetbrains.team/p/kt/reviews/6753

Meaningful semantic change was splitted into 5 commits to simplify the
change review. Sinle commit would be too big.

Why replace source to binary: to get rid of kotlin-reflect in Kotlin
plugin artifact KTIJ-22276

Note: Kotlin Maven artifacts (./gradlew publish) changed their
dependency on kotlin-reflect
2022-08-22 15:43:49 +02:00
Nikita Bobko 0874fb71c6 Replace all kotlin-reflect-api dependencies with kotlin-reflect
Review: https://jetbrains.team/p/kt/reviews/6753

Why: I'm going to replace source dependency on kotlin-reflect with
binary dependency. Normalize reflect dependency before global
processing.
2022-08-22 15:43:11 +02:00
Vsevolod Tolstopyatov 14b13a2f17 [kotlin.reflect] Introduce ClassValue-based cache for KClassImpl
* Replace pcollections with ClassValue/ConcurrentHashMap-based caches
* Do not store weak references, instead cache strong references and count on ClassValue to unload the corresponding classloader if necessary
* ConcurrentHashMap does not rely on WeakReference as it's only selected on Android where classloader leaks don't exist
* Update reflect/scripting JDK requirement to Java 8 in order to proceed

#KT-53454
#KT-50705


Merge-request: KT-MR-6788
Merged-by: Vsevolod Tolstopyatov <qwwdfsad@gmail.com>
2022-08-05 15:35:34 +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
Ilya Chernikov b36d1be5f8 Scripting: switch legacy CLI REPL to the new infrastructure 2022-06-16 21:28:02 +00:00
Ilya Chernikov 6784cb63aa Scripting: implement support for user-defined execution wrapper 2022-06-16 21:28:02 +00:00
Yahor Berdnikau af6f17c243 Unify kotlinCompilerClasspath for all projects
This will prevent spawning second Kotlin daemon during compilation
except 'buildSrc' compilation. Original change was introduced in
2e515f3945 commit.
2022-05-24 07:58:38 +00:00
Ilya Chernikov 49902bb851 IR Scripting: allow to specify nullable types for provided props...
but only explicitly. This does not fix a breaking change described in
#KT-52120, because it seems the correct behavior, but it allows
to "workaround" the problem by specifying nullability explicitly.
Also improve handling of nullable bindings in JSR-223.
#KT-49173 fixed
#KT-51213 fixed
2022-04-29 11:03:11 +00:00
Alexander Udalov 2e515f3945 Prohibit JVM target 1.6
But still compile stdlib, reflect, kotlin.test and scripting runtimes
with JVM target 1.6 to simplify migration from Kotlin 1.6 to 1.7.

 #KT-45165 Fixed
2022-04-19 22:54:40 +02:00
Egor 6d1fe3a962 Fixing merge of script fragments + UT 2022-02-23 18:58:29 +03:00
Mikhail Glukhikh ad0d0ca47f Drop redundant Suppress("RemoveExplicitTypeArguments") 2022-01-26 12:19:55 +00:00
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