Commit Graph

10730 Commits

Author SHA1 Message Date
Ilya Chernikov c2316ca305 Scripting: avoid definitions discovery when compiling regular kotlin
If only regular kotlin .kt (and .java) files are compiled, do not
register file extensions that may come from discovered script
definitions. Since the discovery is lazy by itself, this should
skip jars processing for regular compilation scenarios without scripts.
#KT-47816 fixed
2022-06-16 21:28:07 +00:00
Ilya Chernikov a8c4ea04c8 Scripting: add check for 'kotlin' package similar to the regular sources
#KT-52598 fixed
2022-06-16 21:28:06 +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 9912df0daf minor: remove a warning in scripting tests 2022-06-16 21:28:04 +00:00
Ilya Chernikov da782fbfe8 Scripting: extend JSR-223 compilable with bindings test
proofs that #KT-47191 describes a misuse rather than a bug
2022-06-16 21:28:04 +00:00
Ilya Chernikov 597677dae3 Scripting: refactor history handling in legacy REPL using new infra
#KT-47187 fixed
2022-06-16 21:28:03 +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
Yan Zhulanow 3a6dd52833 [Pill] Update imported modules 2022-06-16 18:31:49 +00:00
Romain Guy 02a3915fdf KT-48232: Implement kotlin.math.cbrt() (cubic roots)
cbrt() is the standard cubic root function that provides several advantages over pow(x, 1.0/3.0):
- Better precision
- Faster
- Behaves better with negative values
2022-06-16 20:27:43 +03:00
Alexander Shabalin 29f3445721 [K/N] Deprecated freezing ^KT-50541
Starting with 1.7.20 freezing is deprecated. See https://github.com/JetBrains/kotlin/blob/master/kotlin-native/NEW_MM.md#freezing-deprecation for details.

Merge-request: KT-MR-6399
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2022-06-16 09:04:14 +00:00
Alexander Udalov 2d29f0ad05 kotlinx-metadata: prepare for release 0.5.0 2022-06-15 21:59:45 +02:00
Alexander Udalov 61652c04e1 kotlinx-metadata: support experimental context receivers 2022-06-15 21:59:45 +02:00
Alexander Udalov 6abf14087c kotlinx-metadata: add Flag.Type.IS_DEFINITELY_NON_NULL 2022-06-15 21:59:45 +02:00
Yahor Berdnikau dca59b0876 Drop AGP_34 version usage
^KT-45747 Fixed
2022-06-15 18:09:09 +00:00
Yahor Berdnikau ef4e87e122 Add @GradleAndroidTest annotation
This allows to run parameterized tests against combination of different
Gradle and Android Gradle plugin versions.

By default, test is provided with minimal supported Gradle + AGP version
and maximum supported Gradle + AGP version.

Migrate AGP versions to enum with compatibility fields.

^KT-45747 In Progress
2022-06-15 18:09:09 +00:00
Mads Ager a2e8ed0032 Do not use ThreadLocalRandom on Android until upcoming SDK 34.
On Android devices starting SDK 25, ThreadLocalRandom accidentally
started out from the same seed on all application starts. This
means that the same sequence of numbers is returned whenever the
application is started.

This will be fixed in SDK 34. We should avoid using
ThreadLocalRandom until then.

^KT-52618 Fixed
2022-06-15 14:52:09 +00:00
Sergey Bogolepov 351249d3a8 Mute testBuildWithPublishedDependency test until k/n update
MIPS targets are not Linux-host exclusive anymore, but k/n
from 1.7.20-dev-1583 does not know about it yet.
2022-06-15 14:37:21 +00:00
Yahor Berdnikau b6edf9a86e Shadow Gradle plugin 3rd party dependencies
Such dependencies will be embedded into plugin jar and their package
will be relocated. This is need to avoid dependency conflicts with
user build scripts dependencies or other Gradle plugins.

Kotlin project dependencies are not shadowed.

^KT-46034 Fixed
2022-06-15 10:57:56 +02:00
Yahor Berdnikau 236a0ca6f0 Move atomicfu plugin into common sourceset
This should fix missing classes in plugin variants artifacts

^KT-52777 Fixed
2022-06-15 10:01:18 +02:00
bennyhuo 20a9314b0b Embed 'kotlin-util-io' to fix the missing kotlinx.metadata.internal.konan.file.File problem in the published library 'kotlinx-metadata-klib' 2022-06-14 18:16:55 +03:00
Yahor Berdnikau c495c07b1a Drop convention usage on accessing Java SourceSet
This is only valid for Gradle 7.1+, so new plugin variant was added -
"gradle71". For Gradle <=7.0 old convention approach is still used.

^KT-47047 In Progress
2022-06-14 10:53:20 +00:00
Alexander Korepanov 9e780afdca [JS IR] Rework incremental cache invalidation
Replace loading the whole world IR with loading only exported (reachable) IR.

 For that purpose the direct and inverse dependency graph is used.
 It is stored in a cache directory and the cache updater keeps it up to date.
 If after loading it is found that other files must be also implicitly rebuilt
 (see rebuilt reasons below), IR for that files also will be loaded.
 This algorithm repeats until the number of implicitly rebuilt files is not 0.

 More rebuilt reasons (dirty state) have been added:
  - added file: this is a new file;
  - modified ir: ir of the file has been updated;
  - updated exports: exports from the file have been added or removed
    (e.g. a function has been used from another file);
  - updated inline imports: imported inline function has been modified
    (transitively);
  - removed inverse depends: a dependent file has been removed;
  - removed direct depends: a dependency file has been removed;
  - removed file: this file has been removed.

 Incremental cache tests has been refactored:
  - The supporting of all rebuilt reasons (dirty states) has been added;
  - New file name format "*.$suffix.kt" for the test steps has been allowed,
    so the syntax highlight works now;
  - Explicit stdlib dependency usage has been removed.
2022-06-13 20:04:05 +00:00
sebastian.sellmair 9c67276201 [Gradle][MPP] Cache kotlinProjectStructureMetadata for multiplatform projects
GranularMetadataTransformation requires the metadata for dependency
projects, for every given source set multiple times. This lead
to the metadata being built extremely often, causing a significant
bottleneck during import.
2022-06-13 11:34:41 +00:00
sebastian.sellmair d8b4a88400 [Gradle][MPP] GradleKpmFragmentGranularMetadataResolver: Avoid re-processing dependencies 2022-06-13 11:34:39 +00:00
sebastian.sellmair 8b595cd804 [Gradle][MPP] GranularMetadataTransformation: Avoid re-processing dependencies
Do not process any dependency that was already processed previously.
When filling up the 'resolvedDependencyQueue' there is already
one filter present, checking that the resolved dependency was not
already visited.

However, this filter is insufficient, since the queue is just an
ArrayDeque and not a set. It happened that many dependencies
were enqueued multiple, multiple times.
2022-06-13 11:34:38 +00:00
sebastian.sellmair 8c904fdab2 [Gradle][MPP] reportSourceSetCommonizerDependencies: Fix parentsClosure 2022-06-13 11:34:37 +00:00
sebastian.sellmair e6f04c84fa [Gradle][MPP] Increase test failure readability in reportSourceSetCommonizerDependencies 2022-06-13 11:34:36 +00:00
sebastian.sellmair 3c8a4c5896 [Gradle][MPP] Mark 'commonizeNativeDistribution' as UP-TO-DATE when cache hits
^KT-52632 Verification Pending
2022-06-13 11:34:35 +00:00
sebastian.sellmair 02601745a9 [Gradle] Simplify 'isHostSpecificKonanTargetsSet' implementation
The method is called pretty often during import and can return
faster and create less objects.
2022-06-13 11:34:34 +00:00
Anton Lakotka de875f6349 [Gradle] Support configuration cache for buildKotlinToolingMetadata
^KT-52694 Verification Pending
2022-06-13 07:26:24 +00:00
Anton Lakotka d8bc17a53c [Gradle] Test buildKotlinToolingMetadata with configuration cache
^KT-52694
2022-06-13 07:26:24 +00:00
nataliya.valtman 120fb56f8d KT-52549: ignore reportPerf property 2022-06-09 08:55:46 +00:00
Yahor Berdnikau 021e251143 Fix Gradle plugin inputs validation issue
Also add '@Internal' annotation in interface, so it propagated to all
inheritors.

^KT-52448 Fixed
2022-06-08 12:45:56 +02:00
Igor Yakovlev 3abcd84802 [WASM] Fix Kotlin.Test box tests 2022-06-07 20:59:03 +00:00
Igor Yakovlev f996278171 [WASM] Support for mjs universal launcher 2022-06-07 20:59:03 +00:00
Igor Yakovlev c8806763fa [WASM] Kotlin gradle plugin tests for Wasm nodejs and d8 support 2022-06-07 20:59:02 +00:00
Igor Yakovlev 4943d5d683 [WASM] Support wasm backend DSL for d8 2022-06-07 20:59:02 +00:00
Igor Yakovlev ee8a90f668 [JS] Fix implement MonotonicTimeSource for d8 2022-06-07 20:59:01 +00:00
Igor Yakovlev dec2426a54 [WASM] Add OptIn to declaration with JsExport 2022-06-07 20:59:01 +00:00
Igor Yakovlev 83ecafe8d1 [WASM] Add toString implementation to Throwable 2022-06-07 20:59:01 +00:00
Dmitriy Novozhilov cdbfa7fbbc [Plugins] Fix bundling sources of NoArg, AllOpen and Lombok for maven plugins 2022-06-07 14:12:27 +00:00
Dmitriy Novozhilov c62257bbab [Build] Use -Xuse-k2 flag instead of -Xuse-fir 2022-06-07 14:12:22 +00:00
Dmitriy Novozhilov c2bf68c9d3 [Lombok] Reorganize module structure of Lombok compiler plugin
Also rename its jar to `kotlin-lombok-compiler-plugin`

^KT-52468 Fixed
2022-06-07 14:12:19 +00:00
Ilya Goncharov 5abbb8666d rra/ilgonmic/statistics
[JS, Statistics] Register absence in legacy webpack

[JS, Statistics]Register build metrics reporter service for webpack task

[JS, Statistics] Use only bundle size

[JS, Statistic] Add bundle size to webpack task

[JS, Statistic] Collect information about compilation size

[Gradle, JS] Add size metrics

Merge-request: KT-MR-6388
Merged-by: Ilya Goncharov <Ilya.Goncharov@jetbrains.com>
2022-06-07 12:53:44 +00:00
Pavel Mikhailovskii 65b2cee913 KT-23397 Optimize out field for property delegate when it's safe (JVM) 2022-06-07 10:46:01 +00:00
Ilya Gorbunov 8da8c94363 Workaround KTIJ-21808 "Kotlin not configured" in Kotlin project
by avoiding problematic source root during IDEA project import.
2022-06-04 10:35:24 +00:00
Yahor Berdnikau 72b7d8da6d Drop gradleKotlinDsl dependency for KGP
This dependency brings gradleApi as a transitive dependency, which leads
to false-positive deprecation errors in plugin variants.

^KT-47047 In Progress
2022-06-03 08:29:58 +00:00
Yahor Berdnikau d924c14df7 Add convenient extension methods to get variant implementation factory
^KT-47047 In Progress
2022-06-03 08:29:58 +00:00
Yahor Berdnikau ebce1a1d2d Fix warnings in gradle70 variant
This allowed to enable warning-as-errors for :k-g-p:gradle70 compilation

^KT-47047 In Progress
2022-06-03 08:29:57 +00:00