Commit Graph

417 Commits

Author SHA1 Message Date
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
Yahor Berdnikau e25778a719 Fix ConcurrentModificationException
This exception is happening on build configuration trying to remove
default jar task artifacts from published one. I've set 'jar' task
to be always disabled instead and just add shadow jar to artifacts.
2022-05-24 07:58:36 +00:00
Ilya Muradyan 00819c421f [REPL] Report script codegen errors in advance 2022-05-18 10:02:58 +03:00
Ilya Muradyan edacd90a6c [Scripting] Take local repository path from settings if it exists 2022-05-16 12:29:25 +00:00
Ilya Muradyan 46563e93ea [Scripting] Allow transitive resolution of non-JAR artifacts
It allows to resolve libraries sources which is crucial for
Kotlin Notebook plugin.
2022-05-16 11:45:47 +00:00
Ilya Muradyan 537ae662d7 [Scripting] Pass exception when constructing ScriptDiagnostic 2022-05-06 13:01:32 +00:00
Ilya Muradyan 0ea9c1fbce [Scripting] Remove obsolete Aether dependencies and add new maven.resolver ones instead
scripting-dependencies-maven actually depended on both maven.resolver
and Aether dependencies, it caused an issue in KScript
(https://github.com/holgerbrandl/kscript/issues/345) and caused some
issues in the past. These problems were partially solved with exclude()
which is now removed.
2022-05-04 10:31:02 +00:00
Ilya Muradyan cfd11f2075 [Scripting] Provide better errors reporting for authentication issues
^KT-50357
2022-05-03 03:42:47 +00:00
Ilya Chernikov 3e19e9d190 Scripting: fix loadDependencies property use with cached scripts
#KT-50902 fixed
2022-04-29 11:03:12 +00:00
Ilya Chernikov f7fb586ee5 Scripting: fix JSR-223 invocable handling of receivers 2022-04-29 11:03:12 +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
Alexander Udalov ef6d30dd51 Remove usages of JVM target 1.6 from compiler tests
#KT-45165
2022-04-19 22:54:40 +02:00
Alexander Likhachev aa3b653847 [Build] dependencies-maven-all: use ArchiveOperations service
`normalizeComponentsXmlEndings` task was using `zipTree` method of `project`. The `ArchiveOperations` method should be used to work properly with configuration cache.
#KT-44611 In Progress
2022-04-19 00:33:34 +03:00
Ilya Goncharov 002d62de89 rra/ilgonmic/revert-signatures-changes
[JS IR] Fix line number test

[JS IR] Ignore isInstance repl test

[JS IR] Ignore isInstance repl test

[JS IR] Add test with unsafe variance

Revert "[JS IR] Optimize away upcasts"

This reverts commit 8149189585.

Get rid of duplicated signatures

Revert "[JS IR] Consider erasing type parameters in return type in js signatures"

This reverts commit 6adcbe081e.

Revert "rra/ilgonmic/exported-bridges-2 [JS IR] Use js name for signature"

This reverts commit 00289d35

[JS IR] Leave as is

[JS IR] Add test with overloading by generic

[JS IR] Add test from master

[JS IR] Add tests from master

Merge-request: KT-MR-5987
Merged-by: Ilya Goncharov <Ilya.Goncharov@jetbrains.com>

^KT-51700 fixed
^KT-51523 fixed
^KT-51685 fixed
2022-04-05 15:35:12 +00:00
Ilya Chernikov 35f80c04ca IR Scripting: update capturing logic for the REPL, imported scripts,
as well as all other implicit receivers.
2022-04-04 14:55:53 +00:00
Ilya Chernikov 4ec639cafd Scripting: relocate 3-party libs in dependencies-maven-all
#KT-50378 fixes, and will prevent similar cases for now
2022-04-04 14:55:52 +00:00
Egor 6d1fe3a962 Fixing merge of script fragments + UT 2022-02-23 18:58:29 +03:00
Vyacheslav Gerasimov 649f246cef Build: Normalize line separators in components.xml
of kotlin-scripting-dependencies-maven-all jar to produce same binaries
on linux and windows

 #KTI-782
2022-02-14 18:59:06 +03:00
Mikhail Glukhikh ad0d0ca47f Drop redundant Suppress("RemoveExplicitTypeArguments") 2022-01-26 12:19:55 +00:00
Roman Artemev e17f121b23 [JS REPL] Extract JS script/repl parts into separate module
- don't load js evaluation plugin in CLI compiler
2021-12-21 04:15:11 +03:00
Nikolay Krasko 5b073c2565 Drop ComponentsXmlResourceTransformerPatched
After shadow is updated to 7.1.1, library ComponentsXmlResourceTransformer
should work fine.

The only reason for this patched version was the bug that was fixed in 7.1.0:
https://github.com/johnrengelman/shadow/releases/tag/7.1.0

^KTI-733 Fixed
2021-12-20 21:39:04 +03:00
Vyacheslav Gerasimov f7a9065b75 Build: Use intellij maven repo instead of downloaded IDEA
#KTI-82
2021-12-16 21:48:23 +03:00
Vyacheslav Gerasimov bc2f0936bd Build: Rename commonDep -> commonDependency 2021-12-16 21:48:19 +03:00
Ilya Chernikov 1450f4d890 Implement property for explicit jvmTarget for script definition...
Apply the property to the default JSR-223 script taking the value from
java.specification.version property, so effectively implementing
jvmTarget detection from current VM.
Also drop enforcing of target 1.8, using common default.
#KT-49329 fixed
#KT-40497 fixed
2021-12-14 13:39:21 +03:00
Ilya Chernikov ec2d6ea5f1 Restore script testing on both backends, fix some tests 2021-12-14 13:39:19 +03:00
Mikhael Bogdanov 0997207c7c Apply -Xjvm-default for specific modules only 2021-12-03 06:39:38 +01:00
Ilya Muradyan 7283ea86af [scripting] Fix Kotlin reflection metadata for script constructors 2021-12-02 01:49:58 +03:00
Ilya Muradyan 6917ff7d2a [scripting] Move earlierScripts to the frontend descriptor
^KT-20488 fixed
2021-11-30 09:11:59 +03:00
Ilya Muradyan 57543f5b19 [scripting] Fix NPE in aether.kt 2021-11-11 11:27:07 +03:00
Ilya Muradyan 56d472451c Mark packages for relocation to fix classpath interferring in main-kts
KT-49476 fixed
2021-11-09 23:04:05 +03:00
Ilya Muradyan a22c8c8f2f [scripting] Fix script resolver options parsing
#KT-49400 Fixed
2021-10-25 04:15:35 +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
Nikolay Krasko 1d2c1140a4 Minor: rewrite testResolveWithRuntime without !! 2021-10-05 17:51:50 +03:00
Nikolay Krasko 1d42d86537 Minor: unify kotlin version used in MavenResolverTest 2021-10-05 17:51:50 +03:00
Nikolay Krasko 824c227d81 Stop removing libraries from local maven in MavenResolverTest
While it's a good practice to remove all files that were downloaded
during the test execution, here we delete files in common directory
without checking that files were not present before test start.

This might be dangerous as we might fail other tests and programs.
As we manipulate common maven directory it's better to leave downloaded
files untouched
2021-10-05 17:51:50 +03:00
Nikolay Krasko 31e30dc852 Fix external issue with org.uberfire library in MavenResolverTest
Use kotlin library instead.

java.lang.AssertionError: org.eclipse.aether.resolution.DependencyResolutionException: Failed to collect dependencies at org.uberfire:uberfire-io:jar:7.39.0.Final -> org.uberfire:uberfire-nio2-model:jar:7.39.0.Final -> com.thoughtworks.xstream:xstream:jar:1.4.11.1 -> xmlpull:xmlpull:jar:1.2.0
2021-10-05 17:51:48 +03:00
Vyacheslav Gerasimov f91d6958a8 Build: Rework runtimeJar helper and drop redundant configuration
#KTI-559
2021-09-26 20:10:29 +03: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 4243bafd1d Scripting: implement correct disposal of REPL state on finalization
#KT-47927 fixed
2021-08-24 21:39:38 +03:00
Ilya Chernikov a45e31720c Make state of the default REPL compiler explicit and replaceable
restores proper object hierarchy in case the legacy REPL infrastructure
2021-08-24 21:39:37 +03:00
Ilya Chernikov 61e5f68b8d Scripting invalidate compiled cache if a dependency is missing
#KT-48303 fixed
2021-08-24 21:39:35 +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 1599a049aa Fix warnings in scripting modules 2021-08-06 22:36:22 +02:00
Mikhael Bogdanov f590c3201a Update ScriptingHostTest.testCompileOptionsLanguageVersion test 2021-07-29 19:45:55 +02: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
Nikolay Krasko 83023c2073 Remove 202 platform support in build scripts 2021-07-23 16:58:28 +03:00
Ilya Chernikov 8eb7e719d3 [minor] fix compiler warnings in scripting modules 2021-07-20 19:42:34 +03:00
Dmitriy Novozhilov f3116cb64a Fix NON_EXHAUSTIVE_WHEN_STATEMENT warnings in project code 2021-07-20 13:33:46 +03:00