Commit Graph

49 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 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 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 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 400762635a Scripting: update version of maven resolver dependencies 2023-01-15 20:11:56 +01: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 e3bf7698a9 kotlin-scripting-dependencies-maven: fix reflect dependency
Review: https://jetbrains.team/p/kt/reviews/6753

Use the same reflect dependency as in the rest of the project.

Why: I'm going to process all reflect dependencies in the next commits.
Normalize reflect dependency before processing.

This weird reflect dependency style was introduced in
83087291df. I think it was a simple
mistake.
2022-08-22 15:42:45 +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
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 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
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
Vyacheslav Gerasimov bc2f0936bd Build: Rename commonDep -> commonDependency 2021-12-16 21:48:19 +03:00
Ilya Muradyan 57543f5b19 [scripting] Fix NPE in aether.kt 2021-11-11 11:27:07 +03: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
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 Muradyan f7c2adae30 Always use wagon classloader as a plexus class world
In CLI compiler, system classloader doesn't load all classes directly,
so wagons (including HttpWagon) happen to be invisible to
Plexus DI that leads to artifacts download failures.
2021-07-19 21:31:46 +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 23faacd21b [Scripting] Expose scripting-dependencies as API of Maven resolver 2021-05-22 04:10:39 +03:00
Ilya Muradyan 0e7d690923 [Scripting] Change compile to implementation in Maven resolver 2021-05-22 00:38:46 +03:00
Ilya Muradyan bead0e3412 [Scripting] Fix Maven resolver dependencies 2021-05-22 00:38:44 +03:00
Ilya Muradyan 7caadd87a2 [Scripting] Get rid of unneeded dependencies in Maven resolver 2021-05-19 18:32:48 +03:00
Ilya Muradyan 55a9f1a910 [Scripting] Make AetherResolveSession internal and do related refactorings 2021-05-17 18:22:29 +03:00
Ilya Muradyan a0cc88ab5a [Scripting] Add transitive support for Maven Resolver 2021-05-17 18:22:28 +03:00
Ilya Muradyan b77a822822 [Scripting] Add authorization for Maven Resolver 2021-05-17 18:22:26 +03:00
Ilya Muradyan 78c65ab802 [Scripting] Bump up Maven resolver JARs version 2021-05-17 18:22:25 +03:00
Ilya Muradyan 626c1d3b48 [Scripting] Fix repository ID generation for Maven resolver 2021-05-10 19:40:32 +03:00
Ilya Muradyan 7cea639209 chore: fix typo in comment 2021-05-10 19:40:31 +03:00
Nikolay Krasko 03c0a81a33 Stop using Bintray in ignored test in MavenResolverTest (KTI-528) 2021-03-31 17:38:54 +03: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
anastasiia.spaseeva 71459db9dd Wizard: Do not add bintray repoitory for eap versions 2020-12-09 18:16:06 +03:00
Ilya Muradyan 1ac9b4c38f Add dependency scopes option for scripting resolvers 2020-07-14 23:42:00 +03:00
Mathias Quintero e45e491718 Add options param to external dependencies resolver API 2020-06-10 16:28:41 +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 1672ed687b Add more tests to the maven resolver lib 2020-04-13 13:49:34 +02:00
Ilya Chernikov 5deb759e78 Rewrite new scripting maven resolver directly to eclipse aether 2020-04-13 13:49:34 +02:00
Anatoly Nikitin c7e9a6c5d9 Add new script dependency resolvers
Changes in new API for dependency resolvers (GenericDependenciesResolver) comparing to an old one (GenericResolver:
- Add ability to fast check whether artifact or repository is suitable for current resolver to distinguish between unsuitable resolvers and resolution failures
- Return all artifact resolution failures in ResultWithDiagnostics
- Use single string for artifact coordinates
- Add compound resolver that combines several resolvers
- Merge Direct and FlatLib resolver into single FileSystemDependencyResolver
- Mark resolve() method as suspend to indicate long operation
- Add credentials support for maven resolver (https://youtrack.jetbrains.com/issue/KT-27701)
2019-11-14 08:38:50 +01:00