Commit Graph

9989 Commits

Author SHA1 Message Date
Anton Lakotka 8d54b8d79a Don't publish wasm targets with KotlinJsCompilerAttribute
Currently JS/IR and WASM targets share this attribute.
This causes issues for HMPP projects on
Variant-resolution stage when both JS/IR and WAS published.
Given the fact that WASM compilation uses IR only it is logical
to exclude such attribute which should fix variant resolution in HMPP
2021-11-29 10:44:06 +01:00
Yahor Berdnikau 8ea97758c0 Make tasks outputs snapshot into zip file.
Kotlin's compilation task outputs usually contains a lot of small files,
which is not so performant to copy as-is into new location. In this
change coping was replaced by using zip archive with no compression.

From my test I see around 2x performance improvement on doing task
 outputs snapshot.

Further optimizations will be done via separate issue as they are
non-trivial and requires some changes on the compiler side.

^KT-49782 Fixed
2021-11-26 16:29:36 +01:00
Ivan Gavrilovic f6263e64e0 KT-49910: Fix adding sources for Android projects
Avoid adding ConfigurableFileTrees to sources as that causes
individual *.java files to be evaluated as sources roots. To
pass the dependency info, manual dependsOn is used, but in the
future SourceRoots should be fixed to carry the dependency info.
2021-11-26 16:00:25 +01:00
Artem Kobzar 08b0e17d47 feat(polyfills): use stdlib for js polyfills. 2021-11-26 08:14:34 +00:00
Yahor Berdnikau 2766dc938b Disabled compiler plugin tests on Windows.
Kotlin compiler is leaking file descriptor to plugin jar file.

^KT-38570 Fixed
2021-11-25 15:10:23 +01:00
Sergey Igushkin 844876a974 KT-49835: Exclude org.gradle.jvm.environment attribute from publishing
Not publishing this attribute fixes the consumers that don't set it.
Those may encounter either a conflict of Kotlin <= 1.5.31 rule on
{JVM, Android} -> Android vs Gradle rule
{standard-jvm, android} -> standard-jvm (causing disambiguation
failures). Or they may run Gradle < 7.0 which doesn't have
disambiguation rules for `org.gradle.jvm.environment` and therefore
treats it as an ordinary extra attribute, thus eventually preferring
variants which don't have it if no other disambiguation rule worked
(again causing disambiguation failures since some rules may prefer the
variants where this attribute *is* set).

Also set a "non-jvm" value of this attribute for non-JVM variants for
project-to-project dependencies in order to "align" them so that Gradle
doesn't prefer variants not marked with this attribute.

Extend the set of dependency resolution tests which check
compatibility of different kinds of Android & JVM consumers against
project and published library: add Kotlin 1.5.31 consumers, also check
consumption with different Gradle version than the one which did the
publication.

Issue #KT-49835
2021-11-25 13:10:27 +00:00
Yahor Berdnikau d253f9ba0e Add test to validate incremental changes in compiler plugin.
If compiler plugin was recompiled incrementally, other projects in the
same build should pick it up and regenerate sources.

^KT-38570 Fixed
2021-11-25 12:45:29 +01:00
Yahor Berdnikau d205c376a7 Move JavaUpToDateIT tests into 'JvmGradlePluginTests'.
^KT-45745 In Progress
2021-11-25 11:03:14 +01:00
Yahor Berdnikau b6c11b544e Move kapt tests into 'OtherGradlePluginTests'.
^KT-45745 In Progress
2021-11-25 10:57:23 +01:00
Pavel Punegov 0249b7ed74 [K/N] Stdlib: warnings as errors
Fix or suppress warnings in Native stdlib.
2021-11-25 08:08:38 +00:00
Igor Chevdar d3d21f072a [K/N][gradle] Added a test for KT-49248 2021-11-25 12:37:01 +05:00
Nikolay Krasko 7457d54360 Drop junit 3.8.1 dependency
junit:junit:3.8.1
  org.codehaus.plexus:plexus-container-default:1.0-alpha-9-stable-1
    org.apache.maven:maven-artifact-manager:2.2.0
      org.apache.maven:maven-project:2.2.0
        org.apache.maven.shared:maven-dependency-tree:2.1
          org.jetbrains.kotlin:jcabi-aether:1.0-dev-3
            :kotlin-script-util compileClasspath
2021-11-24 19:35:34 +03:00
Nikolay Krasko 84a189b6cc Update transitive dependency for kotlin-test - junit 4.12 -> 4.13.2 2021-11-24 19:35:33 +03:00
Nikolay Krasko 317b0b4495 Update junit dependency 4.12 -> 4.13.2 in tests 2021-11-24 19:35:32 +03:00
Nikolay Krasko af8faadca5 Update internal project junit dependency 4.12 -> 4.13.2 2021-11-24 19:35:31 +03:00
Glen K. Peterson 25d962b591 Bumped Junit dependency to fix CVE-2020-15250
Junit >= 4.7 and < 4.13.1 is vulnerable to https://nvd.nist.gov/vuln/detail/CVE-2020-15250   Sorry, I didn't build or test this change.
2021-11-24 19:35:30 +03:00
Nikolay Krasko 58d7bd0baf Minor: clean up warnings in ScriptUtilIT 2021-11-24 19:35:24 +03:00
Nikolay Krasko af185ab870 Remove couple scripting tests commented for 2 years
There're similiar tests:
hello-resolve-junit-dynver.main.kts
hello-resolve-junit-dynver-error.main.kts
2021-11-24 19:35:23 +03:00
Yahor Berdnikau 9d686165fc Add test tag and task for KGP Android tests.
^KT-45747 In Progress
2021-11-24 17:20:24 +01:00
Yahor Berdnikau 2c7913627d Add test tag and task for KGP MPP tests.
^KT-45749 In Progress
2021-11-24 17:20:21 +01:00
Alexander Likhachev 4181429c7e [Gradle, JS] Add missing dependsOn on kotlinNpmCachesSetup task
It's already was not causing the build failure because of changes related to persisted yarn.lock but this fix is more reliable.
Also hidden `kotlinNpmCachesSetup` task by unsetting task group as it's not supposed to be executed directly and moreover direct execution makes no sense.
#KT-47215 Fixed
2021-11-24 14:49:28 +03:00
Igor Chevdar 8b859e6558 [gradle] Added option to customize class loaders map
This will be used in the K/N build for automatic cleaning of the daemon
2021-11-24 16:08:33 +05:00
Ilya Gorbunov d7c31fbe82 Disregard PlatformImplementation class loaded from parent classloader
Such type cannot be cast to a base type, if the former is loaded from
a different, parent classloader.

#KT-47857 Fixed

Co-authored-by: Aleksei.Cherepanov <aleksei.cherepanov@jetbrains.com>
2021-11-24 01:59:48 +03:00
Ilya Goncharov ffbf2ea1a5 [Gradle, JS] Remove redundant build.gradle modification in test 2021-11-23 18:48:33 +03:00
Ilya Goncharov 01deac5e5c [Gradle, JS]Run kotlinNodeJsSetup ad kotlinYarnSetup instead of assemble 2021-11-23 11:41:20 +00:00
Ilya Goncharov e32a1ca562 [Gradle, JS] Not resolve configuration with nodejs and yarn if it should not be downloaded 2021-11-23 11:41:19 +00:00
Alexander Udalov 0048540652 Prepare kotlinx-metadata-jvm 0.4.0 for release 2021-11-23 02:17:01 +01:00
Viacheslav Kormushkin a695d9bf59 KT-49771 - podInstall task is not executed after adding a pod dependency to the shared module
#KT-49771
2021-11-22 13:19:03 +00:00
Ilya Goncharov f48436b35e rra/ilgonmic/eager-like-native
[JS IR] Leave JsEagerInitialization until bootstrap update

[JS IR] Fix js stdlib api

[JS IR] Change annotation on eager initialization in sources

[JS IR] Make eager initialization consistent with native

Merge-request: KT-MR-5030
2021-11-22 12:45:37 +00:00
sebastian.sellmair d5a081bf03 [MPP] [Android] KotlinAndroidTarget: filter AgpVersionAttr attribute
Ensure that the attribute com.android.build.api.attributes.AgpVersionAttr
is not published when creating the android usage contexts.

^KT-49798 Verification Pending
2021-11-22 10:48:43 +00:00
sebastian.sellmair 95018a9de0 [MPP] [Android] implement testAndroidMultiplatformPublicationAGPCompatibility
This test publishes a Multiplatform/Android library locally with
a given AGP version (7.1-*+) and tests the compatibility with older
AGP consumer versions.

Two projects will be tested:

multiplatformAndroidConsumer:
kotlin("multiplatform") + android target depending on
the previous publication as 'commonMainImplementation' dependency

plainAndroidConsumer:
kotlin("android") depending on the previous publication
as 'implementation' dependency.

Both projects will test the 'assemble' umbrella task to ensure,
compatibility with the given publication.

^KT-49798 implicitly covered as well
2021-11-22 10:48:43 +00:00
sebastian.sellmair 8c5f980c16 [MPP] [Android] implement testKT49798AgpVersionAttrNotPublished
This test covers ^KT-49798 by publishing an Android library and
checking that 'AgpVersionAttr' is not mentioned in any .module files
of those publications.
2021-11-22 10:48:42 +00:00
sebastian.sellmair f864e19d95 [Android] Add Gradle integration tests for AGP 7.1
^KT-49798
2021-11-22 10:48:42 +00:00
Aleksei.Cherepanov 8e21e954ad Disable functionalTest source set for JPS build
Exclude functionalTest from :kotlin-gradle-plugin module for JPS build
2021-11-22 08:15:37 +00:00
Steven Schäfer 4b4ee78e5d kotlinx-metadata: Fix parsing of inlineClassUnderlyingType 2021-11-20 12:39:15 +01:00
Dmitry Petrov 77dde26c7c JVM KT-48944 improve performance of FunctionReference#equals
'getOwner()' computes KDeclarationContainer for function references,
which can be costly. Compare other FunctionReference properties first.
2021-11-20 10:31:07 +03:00
Nikolay Krasko 987cbd58e9 Refactoring: restore empty javadoc for all publications in kotlin-test
Partially revert 4dc45a4118
2021-11-20 10:11:37 +03:00
Nikolay Krasko 6a2c607862 Return source and javadoc publication for kotlin-test-wasm
Setting packaging to klib didn't work because it was overwritten below.

^KTI-692 Fixed
2021-11-20 10:11:32 +03:00
Nikolay Krasko 18ed361f9b Narrow down suppressAllPomMetadataWarnings() in kotlin-test publication 2021-11-20 10:11:27 +03:00
Ilya Goncharov 7aef45d5cf [JS] Implement strategy with adapterTransformer on global object to mutate adapter of kotlin-test 2021-11-19 21:39:23 +00:00
wrongwrong 6ecb5a1bd3 Fix ReadMe 2021-11-19 14:48:22 +01:00
Roman Artemev 7f27ebc589 [JS IR] Add API to js runtime to throw linkage errors 2021-11-19 01:16:35 +03:00
Anton Bannykh 4e0d91d463 [JS IR] don't pack tests for kolin.test library into the klib. 2021-11-19 00:39:09 +03:00
Anton Bannykh ee6d3ea281 [JS IR] mark coroutine intrinsics as inline
They are de-facto inlined, but their bodies don't get
loaded when using the "no bodies except for inline functions"
deserializtion mode.
2021-11-19 00:39:06 +03:00
Anton Bannykh b684c2f8d7 Revert "JS IR gradle plugin: don't run IC for the main module"
This reverts commit 525c5b886f.
2021-11-19 00:38:48 +03:00
Zac Sweers 7f5eb3f5ff Fix incorrect kapt classpath error message.
The correct value is `kapt.include.compile.classpath`

^KT-47002 Fixed
2021-11-18 16:43:45 +01:00
Ivan Gavrilovic 684273783f Kotlin Gradle Plugin - clean caches for in-process compilation
This is to prevent file handle leaks on Windows. This
commit disposes KotlinCoreEnvironment used during
in-process compilation.

^KT-49772 Fixed
2021-11-18 16:20:10 +01:00
Svyatoslav Kuzmich f833fc4bcb [Wasm] Default parameter values for external functions
+ import top-level external functions wrapped in lambdas
2021-11-17 19:28:14 +00:00
Yahor Berdnikau 4c3404888a Set minimal supported Gradle version to 6.7.1.
^KT-49733 Fixed
2021-11-17 14:10:24 +00:00
Ilya Goncharov fb6eb414ad [Gradle, JS] Fix afterEvaluate not inside task configuration 2021-11-17 12:19:39 +03:00