Commit Graph

3105 Commits

Author SHA1 Message Date
Igor Laevsky 36d9001d54 [Wasm] Teach gradle plugin to run wasm unit tests for nodejs and Mocha 2021-11-03 16:23:02 +03:00
Ilya Goncharov 540419a5d7 [Gradle, JS] Do not force dukat in separate dukat task
^KT-34014 fixed
^KT-49505 fixed
2021-11-03 09:53:54 +00:00
Ilya Goncharov ce57826ed3 [Gradle, JS] Configure requires NPM dependencies inside rootPackageJson
^KT-34014 fixed
^KT-49505 fixed
2021-11-03 09:53:53 +00:00
Ilya Goncharov 4bf6e6d722 [Gradle, JS] Use node_modules dir existence as marker of up-to-date
^KT-34014 fixed
^KT-49505 fixed
2021-11-03 09:53:52 +00:00
Ilya Goncharov 21249a1dcb [Gradle, JS] Use separate task class for good configuration caching
^KT-34014 fixed
^KT-49505 fixed
2021-11-03 09:53:52 +00:00
Ilya Goncharov 4caa3ad562 [Gradle, JS] Configure tasks in after evaluate block
^KT-34014 fixed
^KT-49505 fixed
2021-11-03 09:53:52 +00:00
Ilya Goncharov e496c638ad [Gradle, JS] Ignore scripts by default
^KT-34014 fixed
^KT-49505 fixed
2021-11-03 09:53:51 +00:00
Ilya Goncharov a03f346296 [Gradle, JS] Persist yarn lock by default
^KT-34014 fixed
^KT-49505 fixed
2021-11-03 09:53:51 +00:00
Ilya Goncharov c34884b0b6 [Gradle, JS] Update Node.JS onto 16.13.0 and Yarn onto 1.22.17
^KT-49530 fixed
2021-11-03 11:33:24 +03:00
konstantin.tskhovrebov b0c34e217b FatFrameworkTask: Fix dSYM extension check. 2021-11-02 21:08:16 +00:00
Ivan Gavrilovic 0ee4e386be KGP - Fix flaky tests invoking javac through JDK APIs
Tests invoking javac APIs were flaky because ClasspathAnalyzerTest
was using Gradle's ProjectBuilder, which appends tools.jar to
the system class loader. Other tests do not do that, and they
invoke javac APIs directly.

In some executions, this causes some javac classes to be loaded
from the system class loader (the one patched by Gradle), while
some of them will be loaded by UrlClassLoader which points to tools.jar
in java.home. Having javac classes from different class loaders causes
java.lang.IllegalAccessError as package private access across class loaders
is not allowed. https://bugs.openjdk.java.net/browse/JDK-8068152 has more
information on this issue.

This change fixes the issue by fully removing usage of ProjectBuilder.

Test: ClasspathAnalyzerTest
2021-11-02 18:03:34 +01:00
Konstantin Tskhovrebov a9f850dac0 Refactor FatFrameworkTask: use FrameworkDescriptor instead Framework.
for independence from module compilation.
2021-11-02 06:18:25 +00:00
Sergey Igushkin 05822c59b5 Fix Android Lint dependency resolution issues (KT-49483)
Android Gradle plugin resolves the *Classpath configurations in an
artifact view with an artifactType attribute set, which should
give a resolved variant with a different `org.gradle.category`
attribute. With `org.gradle.category=library` set by the Kotlin
Gradle plugin, that couldn't work.

To fix this, don't set the `org.gradle.category` attribute on the
Android resolvable configurations.

TODO: Add integration tests!
2021-11-01 14:57:50 +00:00
Mikhail Glukhikh 8bd0b237b7 Convert EXPOSED_PROPERTY_TYPE_IN_CONSTRUCTOR into deprecation error
#KT-28078 Fixed
2021-10-27 19:43:01 +03:00
Dmitriy Novozhilov f26059a7d3 [FE] Add clear warning about future changes about nullability of safe call with non nullable receiver
^KT-46860
2021-10-27 16:28:37 +03:00
Ilya Gorbunov 4e6243c4f7 Restore useIR Gradle option as HIDDEN (KT-45504)
This will allow to KEEP binary compatibility with
the Compose plugin 1.0.1 for a bit longer

Merge-request: KT-MR-4857
2021-10-26 15:37:31 +00:00
nataliya.valtman eec4ac644c KT-49159 Transform KotlinGradleBuildService to BuildService 2021-10-26 09:56:15 +00:00
Anton Lakotka dbe134e8b2 [Gradle] KT-48818 Fix mpp13XFlagsSetByPlugin setter
Use mpp13XFlagsSetByPlugin to prevent false-positive "GranularMetadataTrueHasNoEffect" warning

#KT-48818 Fixed
2021-10-25 08:05:26 +00:00
Anton Lakotka cb103dae75 [Gradle] Don't show false positive warning about old hmpp flags
When HMPP is enabled by default it is still printing warnings about
enableDependencyPropagation and enableGranularSourceSetsMetadata flags

#KT-48818 Fixed
2021-10-25 08:05:25 +00:00
Alexander Likhachev e9c8135dfa [Gradle] Add Gradle & task property to set compiler execution strategy
#KT-49299 Fixed
2021-10-22 09:57:54 +00:00
Alexander Likhachev b4cb7f3610 [Gradle, JS] Make packageJsonHandlers compatible with configuration cache
#KT-49061 Fixed
2021-10-22 09:57:54 +00:00
Alexander Likhachev 1160e3875a [Gradle] Declare kotlin.caching.enabled system property read
#KT-49107 Fixed
2021-10-22 09:57:53 +00:00
Alexander Likhachev f9d4e0639c [Gradle, JS] Reduce KotlinJsTest configuration cache footprint
#KT-49095 Fixed
2021-10-22 09:57:52 +00:00
Yahor Berdnikau ae2d447ef4 Update KGP tests readme.
Reflect actual test setup information.

^KT-45745 In Progress
2021-10-22 07:18:43 +00:00
Sergey Igushkin 8868738ac8 KT-48709: Fix CInterop configurations ambiguity with user variants
* Introduce a new org.gradle.usage value: kotlin-cinterop

* Add compatibility+disambiguation rules to ensure that kotlin-cinterop
  consumers can also fall back to ordinary (kotlin-api) published
  variants, but not vice versa

  * This ensures that ordinary kotlin-api consumers don't encounter
    equally-compatible candidates where one is the normal API elements
    and the other is C interop API elements

* Set org.gradle.usage = kotlin-cinterop in the C interop API elements
  configurations and dependency-consuming configurations

Issue #KT-48709
2021-10-21 10:17:52 +00:00
Sergey Igushkin a474e8a00b KT-49189: fix project(...) dependencies on MPP from pure-Java consumers
* Don't set the localToProject attribute anymore, as it prevents proper
  disambiguation if not set properly on all configurations, while all
  the intentionally-public configurations
  should already have the same value.

* Disambiguate o.j.k.platform.type Android vs JVM preferring JVM, as
  Android should have other attributes which make pure-Android consumers
  match the Android MPP variants.

* With Gradle 7.0+, set the attribute
  `org.gradle.api.attributes.java.TargetJvmEnvironment` on the JVM &
  Android elements configurations, which helps pure-Android consumers
  to match the Android, not JVM variants. This fixes KT-30961 for
  Gradle 7.0+ and AGP 7.0+

Issues: KT-49189, KT-30961
2021-10-21 10:17:52 +00:00
Viacheslav Kormushkin 9307757bb4 [Gradle][Cocoapods] Error messages for the case of invalid pod repo
#KT-42202

Merge-request: KT-MR-4790
2021-10-19 08:15:38 +00:00
Viacheslav Kormushkin 86c6ca7f5f [Gradle][Cocoapods] Private Pods with SSH Git Url not allowed in custom specRepos
#KT-48887

Merge-request: KT-MR-4770
2021-10-15 06:36:22 +00:00
Alexander Likhachev 754595e496 [Gradle, JS] Fix NPM resolution synchronization issues
#KT-49201 Fixed
2021-10-15 00:32:40 +00:00
Viacheslav Kormushkin fcb8f331dc KMM: can't set isAllowInsecureProtocol using cocoapods plugin
#KT-48259

Merge-request: KT-MR-4728
2021-10-13 12:59:49 +00:00
Alexander Likhachev 8c8b311d9f [Gradle, JS] Detect classpath changes in KotlinJsDce
Now -Xdev-mode-overwriting-strategy=older compiler argument is handled on Gradle side to detect incremental changes to increase performance
#KT-35640 Fixed
2021-10-12 09:31:09 +00:00
Alexander Likhachev a0e6fb03f0 [Gradle] Do not register compilation outputs in clean task
Calculations of compilation outputs implicitly requires compile task configuration to execute `clean` task. This implicit configuration works unstable in parallel builds. We probably fine with the fact that outputs that are configured to be outside of build directory will not be cleaned by `clean` task
#KT-48046 Fixed
2021-10-12 09:29:57 +00:00
Konstantin Tskhovrebov be0c4da04a Migrate KotlinNativeTasks to KN compiler arg builder. 2021-10-11 16:42:32 +03:00
Konstantin Tskhovrebov 54b3de775d Add K/N compiler args builders. 2021-10-11 16:42:32 +03:00
Viacheslav Kormushkin b00a43802a [Gradle, MPP] address KT-42755 Cocoapods plugin using backslashes on Windows
Co-authored-by: Andreas Mattsson <andreas@andreasmattsson.com>

Merge-request: KT-MR-4719
2021-10-11 13:04:05 +00:00
Viacheslav Kormushkin 57ce178bb3 Build with CocoaPods plugin fails if CONFIGRATION contains spaces
#KT-48771

Merge-request: KT-MR-4724
2021-10-11 12:03:51 +00:00
Ilya Goncharov 4925beedc0 [Gradle, JS] Update NPM versions
^KT-49124 fixed
2021-10-07 15:48:36 +03:00
Viacheslav Kormushkin cd9d74b029 Generate podspec for XCFramework suitable for publishing
#KT-47812
#KT-47633
#KT-43815
#KT-42630
#KT-42105
#KT-48808

Merge-request: KT-MR-4483
2021-10-07 08:14:57 +00:00
Dmitry Savvinov 50050154d3 [gradle, mpp] Change how outputs of associated compilations are handled 2021-10-06 17:10:17 +03:00
Yahor Berdnikau b7cfbf031c Snapshot compile tasks outputs and restoring them on compilation error.
It happens Gradle has low performance on passing 'Array<Byte>' or
'List<Byte>' via properties api. In this change, task outputs approach
was changed to snapshot pre-execution state by coping outputs to the new
directory and coping them back on incremental compilation error.

^KT-46406 Fixed
2021-10-06 11:56:21 +00:00
Yahor Berdnikau dd0f01d93d Deprecate 'kapt.use.workers.api' property.
^KT-48826 Fixed
2021-10-06 10:10:34 +00:00
nataliya.valtman d3dc9b19b8 KT-48620: Avoid build scan listener creation without --scan property 2021-10-05 09:06:21 +00:00
Ivan Gavrilovic 32bf7f33a7 KT-49066: Use correct moduleName in the incremental compilation
When storing mapping from moduleName to module information, ensure
that values from kotlinOptions DSL objects are taken into
consideration.

Fixes #KT-49066
Test: KotlinAndroid70GradleIT.testCustomModuleName
2021-10-04 18:41:52 +03:00
Alexander Likhachev 0eca8b9727 [Gradle] Optimize configuration time
#KT-48884 Fixed
2021-10-02 03:00:41 +00:00
Alexander Likhachev a1424489b7 [Gradle, JS] Reduce configuration cache state size by data deduplication
#KT-49037 Fixed
2021-10-01 13:44:09 +00:00
Abduqodiri Qurbonzoda 83364d78f5 Replace JVM StringBuilder.appendln usages with appendLine 2021-10-01 15:12:16 +03:00
Yahor Berdnikau 013139f18e Unset MapProperty if not task outputs is present.
By default, Gradle creates such property as empty. 'isPresent' returns
'true' in such case.

^KT-46406 Fixed
2021-09-30 18:55:42 +02:00
Yahor Berdnikau de8d4e9e3c Fix reflection call is not working on older Gradle versions.
It happens, older Gradle versions has two functions with the same name,
but different parameters.
2021-09-30 18:55:42 +02:00
Hung Nguyen b5f74ef9a6 KT-45777: Add tests for top-level functions
Address review + Minor changes
Fix error when building with -Pbootstrap.local=true
Fix tests failing on Windows due to '/' character
2021-09-30 17:57:47 +03:00
Hung Nguyen e26dc4d574 KT-45777: Compute classpath changes based on changed snapshots only
to avoid unnecessarily loading unchanged ones.

Duplicate classes will make this a bit tricky. This commit outlines the
algorithm to handle them, the full implementation will follow later.

Also handle removed classes when computing classpath changes.

Test: New tests in ClasspathChangesComputerTest
2021-09-30 17:57:47 +03:00