Commit Graph

10713 Commits

Author SHA1 Message Date
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
Yahor Berdnikau 1be8480aed Suppress deprecations for MavenPluginConfiguratorG6
This allowed to enable warning-as-errors for :k-g-p:main compilation

^KT-47047 In Progress
2022-06-03 08:29:56 +00:00
Alexander Likhachev e9a231e97e [Gradle, JS] Reuse yarn resolution results from configuration cache 2022-06-02 10:41:14 +00:00
Igor Yakovlev 6c5fdfe070 [WASM] Disable wasm std tests tc service output for local builds 2022-06-02 12:02:34 +02:00
Pavel Kirpichenkov 023def9d25 fixup! fixup! [MPP] Fix dependencies of a platform compilation source set 2022-05-31 16:47:37 +00:00
Pavel Kirpichenkov 4d023e873d [MPP] Fix dependencies of a platform compilation source set
Leave empty new visible source sets in a metadata transformation
for a platform (leaf) source set.

Motivation:
* Platform source sets should get their deps from the compilation
* Metadata dependencies in platform source set shouldn't be used
as transitive library dependencies won't be correct in this case

KT-52216
2022-05-31 16:47:36 +00:00
Vyacheslav Gerasimov 7360dff0da Build: Fix test forks and memory calculations for low memory cases 2022-05-30 21:43:23 +03:00
Nikita Bobko 2d5132b313 kotlin-dist-for-jps-meta: drop not needed dependencies
For elaboration on the list see KTIJ-20875

This commit won't be cherry-picked to old Kotlin version. Only 1.7.20
and bigger
2022-05-30 17:13:46 +02:00
Nikita Bobko b033b9a48d Introduce kotlin-dist-for-jps-meta maven artifact
^KTIJ-20875 Fixed

This artifact is used to denote maven artifacts from which IDEA Kotlin
plugin should compose kotlinc dist layout to use it in unbundled JPS
(KTIJ-11633)

Right now kotlin-dist-for-jps-meta tries as close as possible to a real
dist except for:
```
   js.engines.jar
   kotlin-ant.jar
   kotlin-preloader.jar
   mutability-annotations-compat.jar

   // It's compiler/cli/cli-runner.
   // It is `kotlin` in CLI and not needed for JPS
   kotlin-runner.jar

   // JPS doesn't support KAPT
   kotlin-annotation-processing-cli.jar

   // Sources
   kotlin-annotations-jvm-sources.jar
   kotlin-reflect-sources.jar
   kotlin-script-runtime-sources.jar
   kotlin-stdlib-jdk7-sources.jar
   kotlin-stdlib-jdk8-sources.jar
   kotlin-stdlib-js-sources.jar
   kotlin-stdlib-sources.jar
   kotlin-test-js-sources.jar
   kotlin-test-junit5-sources.jar
   kotlin-test-junit-sources.jar
   kotlin-test-sources.jar
   kotlin-test-testng-sources.jar
```
^ for elaboration on the list see KTIJ-20875

This commit is going to be cherry-picked to a bunch of old Kotlin
versions, so it needs to be conservative

Alternative fix: I could create a Gradle module but I didn't do that,
because I can't refer to compiler plugin maven modules which are also
specified in Maven poms `libraries/tools/kotlin-maven-*/pom.xml`.
  1. `api(project(":kotlin-maven-allopen"))` in imaginary Gradle fix
     obviously doesn't work
  2. `api("org.jetbrains.kotlin:kotlin-maven-noarg:${project.version}")`
     kinda works... but at least breaks IDE import (most probably, it
     breaks something else as well)
2022-05-30 17:09:20 +02:00
Ilya Goncharov 0b9e5e14be [Gradle, JS] Use overlay with false warnings
Merge-request: KT-MR-6343
Merged-by: Ilya Goncharov <Ilya.Goncharov@jetbrains.com>

^KT-51527 fixed
2022-05-30 11:36:52 +00:00
Nkolay Krasko 388e55c198 Inability to load plugin from jcenter in testSubprojectWithAnotherClassLoader 2022-05-30 08:43:57 +00:00
Igor Yakovlev 641b2c6974 [WASM] Remove redundant bootstrap code 2022-05-28 13:26:14 +02:00
Alexander Likhachev e1f5dc483c [Gradle] Add test for KT-52392 2022-05-27 18:30:09 +03:00
Svyatoslav Scherbina c45a3d39b1 [Gradle, Native, IT] Add test for exporting published lib
This test checks that `transitiveExport = true` is no longer required
for exporting a published multiplatform library in a native library.
2022-05-27 07:58:33 +00:00
Svyatoslav Scherbina 045528e643 [Gradle, Native, IT] Add missing assertion 2022-05-27 07:58:33 +00:00
sebastian.sellmair ae493e04c0 [kpm] kotlin-gradle-plugin-idea: Update version for backwards compatibility tests
... to "1.7.20-dev-1435 to bootstrap incompatible naming changes
for IdeaKotlin* -> IdeaKpm*
2022-05-25 13:15:48 +00:00
sebastian.sellmair efcdfab9a4 [kpm] Minor: GradleKpmFragmentInternal: Rename _directRefinesDependencies
... to _declaredRefinesDependencies to match the public counterpart
2022-05-25 13:15:47 +00:00
sebastian.sellmair c9a079f908 [kpm] serializationUtil.kt: Implement custom ClassLoaderObjectInputStream
Previously used the Gradle implementation, which had an undesirable
fallback for the case of missing classes in the given class loader.

For our tests, we want to ensure that only the specified class loader
is used.
2022-05-25 13:15:46 +00:00