10537 Commits

Author SHA1 Message Date
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
Yahor Berdnikau 6d36ba04f8 [Gradle] Document IncrementalSyncTask
^KT-58858 In Progress
2023-08-03 12:39:51 +00:00
Yahor Berdnikau f988de60c3 [Gradle] Document KotlinToolTask
^KT-58858 In Progress
2023-08-03 12:39:51 +00:00
Yahor Berdnikau 2e8d2800f5 [Gradle] Document KotlinCompilationTask
Remove KotlinCompilationTask from KotlinCompile class as it anyway comes
via KotlinJvmCompile interface.

^KT-58858 In Progress
2023-08-03 12:39:51 +00:00
Dmitry Savvinov 027fdb86a5 [Gradle] Print diagnostics stacktrace only under --stacktrace or higher
Most of the changes in commit are test-related, as our tests launched
with '-full-stacktrace' by defayult + asserting full stacktrace is
flaky and unreliable

^KT-59774 Fixed
2023-08-03 10:02:25 +00:00
Dmitry Savvinov e334523fd8 [Gradle] Minor: rename verboseDiagnostics -> useParsableDiagnosticsFormat
^KT-59615 Fixed
2023-08-03 10:02:25 +00:00
Alexander.Likhachev 83c53b7ce3 [BT] Implement classpath snapshotting in the Build Tools API
#KT-57565 In Progress
2023-08-03 08:55:32 +00:00
Alexander.Likhachev 442d1cf711 [BT] Move ClassSnapshotGranularity to the Build Tools API package 2023-08-03 08:55:32 +00:00
Alexander Udalov d4b5599373 Add JVM target bytecode version 21
Unfortunately, there are still problems with running JVM backend tests
with JVM target 21 because:

1) The D8 version that we use does not support bytecode version 21, and
   updating to a newer version requires to change JVM target of compiler
   tests to 11. This will be addressed separately when we enable JVM 21
   in tests-different-jdk.
2) Some tests are failing because of KT-60659 and KT-60770:
   - builtinStubMethods/bridgesForStubs/emptyStringListAdd.kt
   - jdk/stream.kt
   - regressions/kt528.kt

 #KT-60662 Fixed
2023-08-03 08:43:22 +00:00
Sebastian Sellmair b5e80fe060 [Gradle] KotlinMultiplatformSourceSetConventions: Do not configure source sets in 'lazy' context
As source sets are not lazy. This avoids unnecessary exceptions
in user buildscripts.

^KT-60842 Verification Pending
2023-08-02 07:44:19 +00:00
Ilya Goncharov 3450e60a1f [Gradle, Wasm] Fix test data for wasm js test 2023-08-01 19:48:36 +00:00
Alexander.Likhachev 61f404e493 [BT] Implement incremental compilation within the daemon
#KT-57398 In Progress
2023-08-01 16:24:37 +00:00
Alexander.Likhachev b3677fa0ca [IC] Allow to not specify the modules info 2023-08-01 16:24:37 +00:00
Kirill Rakhman 38a54549ff [FIR] Fix serialization of empty varargs in annotations in KLIBs
#KT-59249 Fixed
2023-08-01 15:31:18 +00:00
Ilya Goncharov b9e5b8a087 [Gradle, Wasm] Add wasmWasi target, replace wasm target onto wasmJs
KT-60654
2023-08-01 13:11:36 +00:00
Dmitry Savvinov a65953a7fb [Gradle] Minor, rename task
EnsureNoKotlinGradlePluginErrors ->
CheckKotlinGradlePluginConfigurationErrors
2023-08-01 13:03:29 +00:00
Dmitry Savvinov 7cc72f096a [Gradle] Don't use PropertiesProvider.propertiesWithPrefix in checker
It causes weird failures in functional tests, see KT-60712.

Instead, enumerate all known KGP properties and report only them. Note
that internal properties, unknown to the current version of KGP, won't
be reported. Such cases can appear because of a typo or after migrating
to version of KGP that dropped support for that property. It's not
considered to be a problem at the moment
2023-08-01 13:03:29 +00:00
Dmitry Savvinov 34f4e3cbf6 [mpp, tests] Modernize and simplify new-mpp-lib-with-tests
- Don't use presets (they are deprecated and provoke ERROR, causing
  build to fail)
- Drop two JVM targets (cause issues because ambiguous consumable
  configuration will be created; proper setup needs disambiguation
  attribute, but that's too much for this test)
- Drop jvmWithJava-target (this test case is used in several places
  as "just some MPP project", so specific advanced features like
  jvmWithJava shouldn't be covered here)

Refer to KT-60745 for proper jvmWithJava support
2023-08-01 13:03:29 +00:00
Dmitry Savvinov a9a6441d2d [Gradle] Improve tests on diagnostics rendering, suppression, failures 2023-08-01 13:03:29 +00:00
Dmitry Savvinov a132d37292 [Gradle] Introduce checker of 'kotlin.internal' properties
Those properties are meant for internal use and/or "hacking". Using them
by design provokes big non-suppressible warning
2023-08-01 13:03:29 +00:00
Dmitry Savvinov 6c88b92b88 [Gradle] Fail compileKotlin-tasks if ERROR-diagnostics were reported
KT-60237
2023-08-01 13:03:29 +00:00
Dmitry Savvinov c544d68a64 [Gradle] Do not store suppressed diagnostics 2023-08-01 13:03:28 +00:00
Dmitry Savvinov 71c1abde5c [mpp] Minor: use ToolingDiagnostic for reporting cyclic dependsOn-edges 2023-08-01 13:03:28 +00:00
Dmitry Savvinov 7abb0d9f0c [Gradle] Minor: prettify extraction of Tooling diagnostics from output 2023-08-01 13:03:28 +00:00