Commit Graph

481 Commits

Author SHA1 Message Date
Ilya Chernikov 49559d2a5a K2 Scripting: fix implicit receivers resolution order
#KT-65975 fixed
2024-02-23 22:03:44 +00:00
Yahor Berdnikau 6b19b8b9d0 [Repo] Don't use kotlinOptions in repo build scripts
^KT-63419 In Progress
2024-02-22 14:48:10 +00:00
cristiangarcia cb0d78d443 singleOutputFile() method used Task.getProject() and that's not allowed with CC
Required for KTI-1553
2024-02-09 21:35:03 +00:00
cristiangarcia c53ac2e91f Update Proguard to 7.4.1 2024-01-25 11:36:31 +00:00
Ilya Gorbunov d2aae67e03 Replace kotlin-test project dependencies in the project
Use dependency helper function that chooses whether to take them
from the bootstrap repository or from a configuration of kotlin-test

KT-61969
2023-12-13 15:40:25 +00:00
Alexander.Likhachev 0926ebac23 [Build] Remove BasePluginConvention usages
The entire concept of conventions is deprecated in Gradle. The proposed alternative for `BasePluginConvention` is `BasePluginExtension`
^KTI-1473 In Progress
2023-12-07 18:31:06 +00:00
Alexander.Likhachev a19bd2ed2e [Build] Migrate most of the build logic from Project.buildDir usage
It's going to be deprecated in Gradle 8.3

There's currently no way to pass a `org.gradle.api.provider.Provider` to the JavaExec.systemProperty or Test.systemProperty. There's a workaround using `org.gradle.process.CommandLineArgumentProvider`, but I intentionally don't rework these calls as Gradle is going to allow passing providers to configure system properties: https://github.com/gradle/gradle/issues/12247#issuecomment-1568427242
^KTI-1473 In Progress
2023-12-07 18:31:06 +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 Chernikov 31f9e9e7a8 K2 Scripting: implement basic metadata serialization support
#KT-62305 fixed
NB: kotlin reflection do not see script class constructor after
this change, and it's ok, since the fact that the script is compiled
into a class is an implementation detail.
If needed, java reflection could be used to access the constructor.
2023-11-03 21:54:23 +00:00
Ilya Chernikov 268d058bbb Implement missing invoke resolution branch with context receivers
#KT-61937 fixed
Note: the current implementation only resolves for a single receiver
in each group. See KT-62712 and KT-62709 for the followup.
2023-10-19 19:39:31 +00:00
Ilya Chernikov 141333bdcd K2: Update extension receiver after checking in CheckExtensionReceiver
fixes receiver selection when the candidate has more that one possible
extension receiver
#KT-62129 fixed
2023-09-22 11:33:46 +00:00
Ilya Chernikov 9ed23a7f07 Scripting: fix supplementary test jar compilation
make its version consistent with compilation of the script
that uses it
2023-09-19 15:46:30 +00:00
Ilya Chernikov 8a10070772 LV20 update scripting test mute logic for K2
after switching to LV20 by default
2023-09-19 15:46:28 +00:00
Ilya Chernikov e3dae559d0 LV20: refactor K2 scripting tests - rename tasks 2023-09-19 15:46:27 +00:00
Ilya Muradyan 337054ba92 Scripting: Remove deprecated MavenRepositoryCoordinates class 2023-09-14 12:14:32 +00:00
Ilya Muradyan f1f12bc192 Scripting: Reuse AetherSession if repositories didn't change
Repository system will be not reconstructed on subsequent calls
2023-09-14 12:14:32 +00:00
Ilya Muradyan b1347d7616 Scripting: Unify artifacts resolution for partial and non-partial cases 2023-09-14 12:14:32 +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
Kirill Rakhman d0cc86f52c [Tests] Update test data after changes to FIR diagnostic messages 2023-08-21 16:28:48 +00:00
Ilya Chernikov a53933d8ce Scripting: do not pack generic dependencies jar into maven-all
The -all jar is compacted with proguard, and the proguard removes
synthetic methods methods with $default suffix from classes regardless
of the -keep flag.
Therefore the calls to the $default metods lead to the NoSuchMethodError
exception on runtime.
Removing the main interface module from the proguarded jar solves the
problem for now (but not generally, the use of "proguarded" jars as
libraries should be discouraged.)
#KT-60862 fixed
2023-08-18 12:35:25 +00:00
Alexander Udalov 965946d3ef K2: report JVM backend errors in the same way in PSI as LT
Do not try to find PSI element, but always use the IR element offsets
instead. This greatly simplifies test data because we don't need to have
custom PSI- and LT- based diagnostic ranges in every test, and K1/K2
behavior also is mostly the same.

The exact offset ranges are not as important for backend diagnostics, so
it's better to have K2+PSI and K2+LT behaving the same.
2023-07-29 23:06:23 +00:00
Ilya Chernikov 3ee07eb015 Scripting: add test for implicit receivers with the same short name 2023-07-26 08:49:27 +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 96bde033e1 K2 Scripting: add support for imported scripts 2023-07-26 08:49:26 +00:00
Ilya Chernikov d24fc3b581 K2 Scripting: add support for result field 2023-07-26 08:49:26 +00:00
Ilya Chernikov 6c7751b0af K2 Scripting: add support for script implicit receivers 2023-07-26 08:49:26 +00:00
Ilya Chernikov 480ea80fc4 Enable K2 scripting tests 2023-07-26 08:49:26 +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
Alexander Udalov c66bc36382 Build: fix some warnings in buildSrc and build.gradle.kts 2023-06-26 15:42:21 +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
Ilya Chernikov 30131e289f minor: improve tests failure reporting 2023-06-20 16:38:32 +00:00
Alexander Udalov bb4bb58453 Remove tests on -Xuse-ir compiler flag
This flag is going to be removed because old backend is not supported
anymore, therefore there's no need to test it.
2023-05-30 14:46:09 +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 ea255135a4 Scripting: avoid CME in maven resolving in IDE scenarios
combination of laziness in AetherResolveSession and possibly
async-modifiable repos collection in MavenDependenciesResolver
may lead to the CME.
#KT-54733 fixed
2023-01-15 20:11:56 +01: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 400762635a Scripting: update version of maven resolver dependencies 2023-01-15 20:11:56 +01:00
Ilya Chernikov deb2d6d024 K2 Scripting: enable K2 tests in some test projects 2022-12-21 14:34:21 +00:00
Ilya Chernikov 90a4f6002e K2 Scripting: support sam-with-receiver in scripting plugin 2022-12-21 14:34:21 +00:00
Alexander Korepanov d5e9e87538 [JS BE] Drop JS scripting support
JS scripting uses the old IR to JS transformer.
 The new IR to JS transformer can not be used for
 JS scripting out of the box. Patching the new transformer for
 JS scripting is potentially dangerous and requires a lot of effort.
 Dropping JS scripting and the old IR to JS transformer allows to
 refactor and simplify JS BE codebase.
2022-11-04 14:15:15 +00:00
Ilya Chernikov 5d968bc2f4 Fix gradle scripts detection in the sources
#KT-54325 fixed
2022-10-31 09:30:13 +00:00
Artem Kobzar 7b9aed25da [K/JS] Add the ability to turn off polyfills generating 2022-10-19 12:52:23 +00:00
Nikolay Krasko 1630386712 Move to JDK_X_Y variables 2022-09-21 22:53:19 +00:00
Ilya Chernikov 0814c0da57 Fix lowering of receiver access in IR scripting
#KT-53947 fixed
without the fix, in the presence of the implicit receiver of the same
type as the processed receive, the lowering was incorrectly substituting
the correct receiver with the accessor to the implicit one
2022-09-15 22:05:00 +02:00
Mikhael Bogdanov c168a19a58 Build compiler with -Xjvm-default=all + @JvmDefaultCompatibility when needed 2022-09-14 14:40:37 +02:00
Ilya Muradyan 551a481dc5 [Scripting] Add partial transitive resolution to Maven resolver 2022-09-12 14:11:04 +02: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