Commit Graph

9610 Commits

Author SHA1 Message Date
Artem Kobzar a29fa428b3 [K/JS] Add warning for ES-modules on the klibgen stage on the uniqueness of the exported names from the module 2023-08-08 15:45:02 +00:00
Kirill Rakhman 8ae751926c [FIR] Let OptIn LV checker only run on last module in HMPP compilation
This fixes an issue where the opt-in annotation is defined in one of the
source sets of the compilation but opt-ins are defined for the whole
compilation which leads to false-positive "Opt-in requirement marker is
unresolved" in (e.g. common) source sets that don't have a dependency on
the module that contains the annotation.

#KT-60755 Fixed
2023-08-08 07:57:56 +00:00
Nataliya.Valtman 2719dd188f Added build metrics for Kotlin/Native tasks
#KT-58315 Fixed

Co-authored-by: Nataliya Valtman <Nataliya.Valtman@jetbrains.com>


Merge-request: KT-MR-11343
Merged-by: Dmitrii Krasnov <Dmitrii.Krasnov@jetbrains.com>
2023-08-08 07:43:18 +00:00
Ivan Kylchik 7cbf3b28ca [K2] Properly serialize annotation that has vararg with single argument
#KT-60163 Fixed
2023-08-08 07:01:48 +00:00
Sebastian Sellmair 8ff2782045 [Gradle] Promote val Project.kotlinToolingVersion
^KT-61034 Verification Pending
2023-08-08 06:50:01 +00:00
Yahor Berdnikau 1b82477ffa [Gradle] Add multiplatform compiler options DSL integration test
^KT-57292 Fixed
2023-08-07 14:09:31 +00:00
Yahor Berdnikau 07593da3f0 [Gradle] Update how JVM toolchain is wired in MPP projects
^KT-57292 In Progress
2023-08-07 14:09:31 +00:00
Yahor Berdnikau bc871c6cfa [Gradle] Add multiplatform extension compiler options DSL
Now the multiplatform extension exposes compiler option DSL for common
compiler arguments. This compiler option synced as a convention for
targets compiler option.

In the case of Kotlin source sets which are not used as defaultSourceSet
 in compilations - extension compiler options are synced as convention
 into those.

^KT-57292 In Progress
2023-08-07 14:09:31 +00:00
Sebastian Sellmair 41e5a31e1b [Gradle] ObservableSet: Only add listeners when a new object is indeed added
^KT-60937 Verification Pending
2023-08-07 13:40:33 +00:00
Sebastian Sellmair d2bd749861 [Gradle] Add integration test for associated 'functionalTest' style sources
Experiments with the DefaultKotlinCompilationAssociator where made
during KT-60937. One experiment broke running functionalTests in
kotlin.git in bootstrap mode. This case was not yet covered by
CI.

^KT-60937 Verification Pending
2023-08-07 13:40:32 +00:00
Sebastian Sellmair 6c6200a9c5 [Gradle][Minor] Deprecate 'KotlinCompilation.associateWith' property...
... in favor of associateCompilations and allAssociateCompilations

^KT-60937 Verification Pending
2023-08-07 13:40:32 +00:00
Sebastian Sellmair 8ce820d944 [Gradle][Minor] KotlinJsIrSourceSetProcessor: Access runtimeDependencyFiles safely
As it might happen, that the configure code could be triggered
too early, capturing the state of 'runtimeDependencyFiles' to early as well.

^KT-60937 Verification Pending
2023-08-07 13:40:32 +00:00
Sebastian Sellmair ba270fc7df [Gradle][Minor] KotlinCompilationAssociator: Use listProperty util function
^KT-60937 Verification Pending
2023-08-07 13:40:32 +00:00
Sebastian Sellmair d978640c42 [Gradle] Remove KotlinOutputDependency
The IdeBinaryDependencyResolver will filter respective
files by using a simpler check: testing if the files
do reside within the build dir of the current project.

^KT-60937 Verification Pending
2023-08-07 13:40:32 +00:00
Sebastian Sellmair d510c93241 [Commonizer] Support generic/simple annotation commonization (to support kotlinx.cinterop.* annotations)
^KT-59302 Verification Pending
2023-08-04 11:29:23 +00:00
Timofey Solonin 65649673a7 [MPP] Only add test framework dependency once per configuration
^KT-56828
2023-08-04 09:50:35 +00:00
Timofey Solonin 256d9da24c [MPP] Emit a warning when kotlin-test testing framework couldn't be inferred
^KT-56828
2023-08-04 09:50:35 +00:00
Sebastian Sellmair 2ab2f408f3 [Gradle] PomDependenciesRewriter: Fix missing 'component' in configuration cache
^KT-60159 Verification Pending
2023-08-04 07:22:20 +00:00
Sebastian Sellmair b9a520b593 [Gradle] createMavenPublications: Defensively defer adding gradleComponents to 'AfterFinaliseCompilations'
... as the code previously states that this code might race
with actually adding variants from configurations

^KT-60159 Verification Pending
2023-08-04 07:22:20 +00:00
Sebastian Sellmair 84eacd5cde [Gradle] KotlinProjectStructureMetadata: Use name from KotlinUsageContext by: 'kotlinVariantNameFromPublishedVariantName'
^KT-60159 Verification Pending
2023-08-04 07:22:20 +00:00
Sebastian Sellmair fd50b80aa1 [Gradle][Minor] Handle 'isSourcesPublishable' more lazily
... as the value is allowed to change until 'finaliseDsl'

^KT-60159 Verification Pending
2023-08-04 07:22:20 +00:00
Sebastian Sellmair 9f2c2b7265 [Gradle] Implement tests for External target publications
^KT-60159 Verification Pending
2023-08-04 07:22:20 +00:00
Sebastian Sellmair 06d5d2522c [Gradle] Multiplatform publishing: Support external targets
...by only requiring InternalKotlinTarget instead of AbstractKotlinTarget

KT-60159
2023-08-04 07:22:20 +00:00
Sebastian Sellmair 3d593f0ee9 [Gradle] ExternalKotlinTargetComponent: Implement 'usages' as 'KotlinUsageContext'
... to support multiplatform publication components as
re-writing pom dependencies and project structure metadata

KT-60159
2023-08-04 07:22:20 +00:00
Sebastian Sellmair 93f8e21e9e [Gradle][Minor] Add assertion on KotlinAndroidTarget checking components do not get created to early
KT-60159
2023-08-04 07:22:20 +00:00
Sebastian Sellmair 2734207b52 [Gradle][Minor] Make Future<T> covariant Future<out T>
KT-60159
2023-08-04 07:22:20 +00:00
Sebastian Sellmair 29d15235bb [Gradle][Minor] Add Property.awaitFinalValueOrThrow util function
KT-60159
2023-08-04 07:22:20 +00:00
Ilya Gorbunov 171d156688 [stdlib-mpp] Disable/ignore failing tests in Kotlin Dev
KT-60901, KT-59000, KT-56106
2023-08-03 14:47:21 +00:00
Yahor Berdnikau 73e8fc6183 [Gradle] Always add kotlin-stdlib-wasm
Published kotlin-stdlib with Gradle metadata does not yet include
kotlin-stdlib-wasm variant, so KGP should always add it separately even
if kotlin-stdlib was added into a common source set.

^KT-59000
2023-08-03 14:47:21 +00:00
Yahor Berdnikau 94013b1ff2 [Gradle] Updated logic to add stdlib default dependency published with Gradle metadata
Since Kotlin 1.9.20, Kotlin stdlib is published with Gradle metadata,
which allows Gradle itself to select proper dependency subtypes. Now
stdlib in MPP projects is only added to common dependencies.

The default artifact for JVM was changed from 'kotlin-stdlib-jdk8' to
'kotlin-stdlib'.

^KT-59000 Fixed
2023-08-03 14:47:21 +00:00
Yahor Berdnikau 8154f7ab37 [Gradle] Remove adding stdlib to KPM modules
KPM is deprecated and scheduled for removal

^KT-59000 In Progress
2023-08-03 14:47:21 +00:00
Ilya Gorbunov 21565c6128 [stdlib-mpp] Add dependency constraints to JVM variant, KT-55297 2023-08-03 14:47:21 +00:00
Ilya Gorbunov 09bb0b5566 Draft: change stdlib autoconfiguration and import expectations for mpp stdlib
#KT-59000
2023-08-03 14:47:20 +00:00
Ilya Gorbunov d5fd6937ce Fix HierarchicalMppIT: kotlin-stdlib now contains composite metadata artifact
KT-56106
2023-08-03 14:47:20 +00:00
Ilya Gorbunov cfa6c39015 [stdlib-mpp] Change path to the new stdlib artifact in BCV and JdkApi tests
KT-56106
2023-08-03 14:47:20 +00:00
Yahor Berdnikau 8469b8cbb5 [Gradle] Simplify wiring target compiler options to compilations options
Now it happens as a default postConfigure action in factories for all
KotlinCompilations including external one.

^KT-57292 In Progress
2023-08-03 14:29:44 +00:00
Yahor Berdnikau 3a148f97b5 [Gradle] Configure tryK2 for target compiler options
^KT-57292 In Progress
2023-08-03 14:29:44 +00:00
Yahor Berdnikau 7dfbf28d93 [Gradle] Introduce compilerOptions for Kotlin external target
Kotlin external target now properly exposes compilerOptions which could
be used by target users to configure target compilations compiler
options.

^KT-57292 In Progress
2023-08-03 14:29:44 +00:00
Yahor Berdnikau c1e26bfa47 [Gradle] Introduce compilerOptions for Kotlin metadata target
KotlinMetadataTarget now exposes experimental compiler options DSL that
are passed as a convention into target compilations compiler options.

^KT-57292 In Progress
2023-08-03 14:29:44 +00:00
Yahor Berdnikau a40e59306a [Gradle] Introduce compilerOptions for Kotlin js target
KotlinJsIrTarget now exposes experimental compiler options DSL that
are passed as a convention into target compilations compiler options.

^KT-57292 In Progress
2023-08-03 14:29:44 +00:00
Yahor Berdnikau a158d09768 [Gradle] Introduce compilerOptions for Kotlin native target
KotlinNativeTarget now exposes experimental compiler options DSL that
are passed as a convention into target compilations compiler options.

^KT-57292 In Progress
2023-08-03 14:29:43 +00:00
Yahor Berdnikau 6f394f42a6 [Gradle] Introduce compilerOptions on Kotlin targets for JVM
KotlinJvmTarget, KotlinAndroidTarget, KotlinWithJavaTarget now expose
compiler options that are passed as a convention into target
compilations compiler options. Compiler options from Kotlin/JVM and
Kotlin/Android plugins compiler options are used now as convention for
target compiler options.

^KT-57292 In Progress
2023-08-03 14:29:43 +00:00
Yahor Berdnikau 38b17420c1 [Gradle] Introduce compilerOptions on KotlinTarget
This will allow configuring compiler options for all compilations in the
target.

^KT-57292 In Progress
2023-08-03 14:29:43 +00:00
Stanislav Erokhin d99f8ac9b4 [mpp] Test that every deprecated pre-HMPP property triggers an Error
Previously all these properties were put together, so only one
of them could have triggered the Error

#KT-59304 Verification Pending
2023-08-03 13:27:37 +00:00
Stanislav Erokhin fcd440fd9e KT-59304 Elevate warning to Error for pre-HMPP flags
Flag `kotlin.mpp.deprecatedProperties.nowarn` was removed.
Diagnostic could be temporarily suppressed by the:
kotlin.internal.suppressGradlePluginErrors=PreHMPPFlagsError
2023-08-03 13:27:37 +00:00
Stanislav Erokhin cfcb0690d7 [mpp] Remove usage of deprecated pre-HMPP properties from tests
#KT-59304 In Progress
2023-08-03 13:27:36 +00:00
Stanislav Erokhin a3eb472e5f [mpp] Update the IdeImportPropertiesConsistencyTest
#KT-48554 Fixed
2023-08-03 13:27:36 +00:00
Stanislav Erokhin a58dd84cdc [mpp] Remove the kotlin.native.enableDependencyPropagation property
This property isn't used in IDE import since 222 (KTIJ-21525)
De-facto it was set to false by the code in
hierarchicalStructureMigrationHandling.kt if HMPP is enabled.
And in the future commit we will forbid to disable the HMPP

#KT-48554 In progress
2023-08-03 13:27:36 +00:00
Yahor Berdnikau 020ad64b3c [Gradle] Update documentation for Kotlin tasks
^KT-58858 In Progress
2023-08-03 12:39:51 +00:00
Yahor Berdnikau 365c04a7f7 [Gradle] Update documentation for CompileUsingKotlinDaemon
^KT-58858 In Progress
2023-08-03 12:39:51 +00:00