Commit Graph

8893 Commits

Author SHA1 Message Date
Dmitriy Dolovov d9cd293eaa [PL][JS] Disable PL for Kotlin2JsIrBeIncrementalCompilationIT.testRebuildAfterError
This test is not supposed to be ever successful with enabled PL.
2023-04-18 09:22:53 +00:00
Sebastian Sellmair 5d0bf2de24 [CLI] Restore K2JVMCompilerArguments.classpath and javaModulePath
to support IDEs < 2023.2

Reverts:
- 9dcd40d7b7
- fb66764c4d

KTIJ-25227
2023-04-18 09:18:10 +00:00
Sebastian Sellmair 0f5f4fd8fa [Gradle] Overwrite setupCompilerArgs methods in compile tasks...
... to ensure compatibility with reflection code
in IDEs < 2023.2 which is looking for setupCompilerArgs methods
with specific compiler arguments type instead of a
generic function

KTIJ-25227
2023-04-18 09:18:10 +00:00
Sebastian Sellmair 9309a864ce [Gradle] IdeCompilerArgumentsResolver: Do not resolve compile tasks DependencyClasspath
as it is not needed for JPS builds.
JPS will build the classpath by reading the IJ project model.
Classpath entries added as freeCompilerArgs will still be forwarded

KTIJ-25227
2023-04-18 09:18:09 +00:00
Sebastian Sellmair 62df30134f [Gradle][Minor] CompilerArgumentAware: Remove unnecessary suppress 2023-04-18 09:18:09 +00:00
Yahor Berdnikau 1eb27f2aac Update publishing and usage of kotlin-annotation-processing plugin
- removed 'kotlin-annotation-processing-gradle' publication as it
duplicated 'kotlin-annotation-processing-embeddable'
- removed 'kotlin-annotation-processing-maven' as it is embedded into
  'kotlin-maven-plugin'. Instead 'kotlin-maven-plugin' now depends on
  'kotlin-annotation-processing' directly.

^KT-52811 In Progress
2023-04-17 14:40:51 +00:00
Yahor Berdnikau a58d6fd13a Publish 'kotlinx-serialization-compiler-plugin' separately
- Also publish 'kotlinx-serialization-compiler-plugin-embeddable' to be
used with 'kotlin-compiler-embeddable'.
- Now Serialization Maven and Gradle plugins do not embed plugin into
itself, but declare on published one normal dependency.
- 'kotlin-serialization-unshaded' publication is deprecated.

^KT-52811 In Progress
2023-04-17 14:40:50 +00:00
Yahor Berdnikau 78c94b65b9 Change sam-with-receiver plugin to use published compiler plugin
- also publish 'kotlin-sam-with-receiver-compiler-plugin-embeddable' to
  be used with 'kotlin-compiler-embeddable'
- 'kotlin-maven-sam-with-receiver' now just adds
  'kotlin-sam-with-receiver-compiler-plugin' as normal dependency
  instead of embedding it into itself

^KT-52811 In Progress
2023-04-17 14:40:50 +00:00
Yahor Berdnikau a58266050f Publish noarg compiler plugin separately
- also publish 'kotlin-noarg-compiler-plugin-embeddable' to be used with
  'kotlin-compiler-embeddable'
- 'kotlin-noarg-maven' plugin now just adds
  'kotlin-noarg-compiler-plugin' as normal dependency instead embedding
  it into itself

^KT-52811 In Progress
2023-04-17 14:40:50 +00:00
Yahor Berdnikau 1a4d203d1c Publish lombok compiler plugin separately
- also add 'kotlin-lombok-compiler-plugin-embeddable' to be used with
  'kotlin-compiler-emebeddable'
- 'kotlin-maven-lombok' does not try to embed plugin into itself and
  just depends on compiler plugin as normal dependency

^KT-52811 In Progress
2023-04-17 14:40:50 +00:00
Yahor Berdnikau 5e41cbda75 Change kotlin-assignment plugin to use published compiler plugin
^KT-52811 In Progress
2023-04-17 14:40:49 +00:00
Yahor Berdnikau 1ccd7afde7 Publish allopen compiler plugin separately
- added also 'kotlin-allopen-compiler-plugin-embeddable' to be used with
  'kotlin-compiler-embeddable'
- 'kotlin-maven-allopen' now just depends on
  'kotlin-allopen-compiler-plugin' instead of "embeding" it into itself

^KT-52811 In Progress
2023-04-17 14:40:49 +00:00
Yahor Berdnikau 64f8b87b66 Publish atomicfu compiler plugin separately
- rename plugin into 'kotlin-atomicfu-compiler-plugin'
- add 'kotlin-atomicfu-compiler-plugin-embeddable' to be used with
  'kotlin-comiler-embeddable'

^KT-52811 In Progress
2023-04-17 14:40:49 +00:00
Yahor Berdnikau 8ad67faa60 Resolve also transitive dependencies for compilerPluginClasspath in maven
This allows to depend on actual compiler plugin instead of embedding it into maven compiler plugin.

^KT-52811 In Progress
2023-04-17 14:40:48 +00:00
Dmitrii Krasnov 9c32a66e9c migrated NativeExternalDependenciesIT to gradle TestKit 2023-04-17 13:22:25 +00:00
Yahor Berdnikau 86540bdbb4 [Gradle] Fix flaky test
Commonizer may run first and produce compiler arguments output as well
in test output.
2023-04-17 11:45:57 +00:00
Filipp Zhinkin 368f21461c KT-55091 Optimize Sequence::toSet/toList implementation
Sequence::toSet and Sequence::toList both create a
collection, fill it with elements, and then try to optimize a result
by returning empty, singleton, or the allocated collection depending on
the elements count.
Instead of allocating the collection and then trying to return
an optimized instance it is worth checking the sequence's size
beforehand and return empty/singleton collection when possible.

Proposed change optimize performance of aforementioned functions and
also reduce allocation rate when a sequence consists of 0 or 1 elements.

^KT-55091 fixed
2023-04-17 08:58:20 +00:00
Anton Lakotka 4819593bf4 [Gradle] Mark nullable visibleSourceSetProvidingCInterops as Optional
^KT-57677 Verification Pending
2023-04-14 22:39:34 +00:00
nataliya.valtman 4bb8bd3901 KT-57224 Support Language version Tag 2023-04-14 08:34:29 +00:00
Pavel Kargashinsky 4ad16d5cf6 [Gradle][Tests][MPP] Specify warningMode = Fail, for tests without warnings. 2023-04-13 13:15:30 +00:00
Yahor Berdnikau 85644bbbf6 [Gradle] Don't fail TC configuration on expected OOM in test
Test produces as expected OOM exception, but it should not output test
logs into build logs. As TeamCity will parse them and fail because build
 logs contains OOM which is false-positive.
2023-04-13 12:29:39 +00:00
Dmitriy Novozhilov b253a3a47e [FIR] Don't lose non-serializable properties during metadata deserialization
^KT-57941 Fixed
2023-04-13 10:38:52 +00:00
Artem Kobzar f0aa6c6d32 [K/JS Gradle] Remove forceLegacyBackendUsage from KotlinGradlePlugin previously added with the compiler flags refactoring, also fix bootstrap compilation of atomicfu plugin 2023-04-12 14:04:34 +00:00
Nataliya.Valtman 2c2a01113e KT-57371: Add versions for FUS statistic bean 2023-04-12 11:04:35 +00:00
Alexander.Likhachev 0d1500f23f [Gradle] Disable the Kotlin daemon fallback strategy for integration tests
#KT-57782 Fixed
2023-04-12 06:16:36 +00:00
Yahor Berdnikau f7522ec796 Better approach to handle 'moduleName' in project level DSL
Now project level DSL only configures base part of module name, which
latter is enhanced by Kotlin compilation suffix. In this case
'KotlinCompilation.moduleName' is not used.

Additionally,
'KotlinJvmTask.moduleName' usage was deprecated in favor of
'compilerOptions.moduleName'. Though warning is only produced in case
project is using 'org.jetbrains.kotlin.jvm' or
'org.jetbrains.kotlin.android' plugins.

- 'moduleName' is always required to be non-null.

^KT-57688 Fixed
2023-04-12 06:16:36 +00:00
Iaroslav Postovalov fb80c0cb0d Override toString function in stdlib delegates
Co-authored-by: ilya-g <ilya.gorbunov@jetbrains.com>
2023-04-11 14:46:29 +00:00
Alexander.Likhachev b750e1e62c [Gradle, K/N] Fix a small typo in a test name 2023-04-11 16:19:15 +02:00
Alexander.Likhachev f439d4d147 [Gradle, K/N] Improve message when a simulator for test is not booted
If a simulator test task is configured to disable standalone mode and the simulator isn't booted, the default error message might sound cryptic, so we can give a more user-friendly error message
#KT-38317 Fixed
2023-04-11 16:16:31 +02:00
Alexander.Likhachev 5486b39d04 [Gradle, K/N] Add a standalone mode toggle for K/N simulator tests
#KT-38317 In Progress
2023-04-11 16:16:31 +02:00
Alexander.Likhachev d6077923c4 [Gradle, K/N] Use default deviceId as a convention 2023-04-11 16:16:30 +02:00
Alexander.Likhachev 282a4ca09d [Gradle] Add a test for KT-38317 2023-04-11 16:16:29 +02:00
Sebastian Sellmair d40a20f90b [Gradle] AbstractCInteropCommonizerTask: Do not use ':' character in fileName
":" is not allowed on Windows. Using _ instead

^KT-57796 Verification Pending
2023-04-11 13:55:05 +00:00
Dmitriy Novozhilov 94f77add49 [FIR] Try to load properties in order according to kotlinx.serialization metadata extension
Move metadata extension with property order from kotlinx.serialization to core

After fix of KT-54792 properties will be deserialized in declaration order
  if corresponding class was compiled with modern compiler. But this order
  is needed for kotlinx.serialization for binaries compiled with any
  kotlin compiler >= 1.4. Since we don't plan to add any extension points
  into (de)serialization into FIR, we need to take into account existing
  metadata extension from kotlinx.serialization in compiler itself

^KT-57769 Fixed
2023-04-11 13:43:39 +00:00
Ivan Kylchik b8b8570a60 Add instruction on how to debug kotlin gradle plugin integration tests 2023-04-11 11:59:12 +00:00
Ilya Goncharov d2c2a86cb7 [Gradle, JS] Existence of node_modules for up-to-date of kotlinNpmInstall
[Gradle, JS] No dev deps in packages_imported

^KT-57920 fixed
2023-04-11 11:52:29 +00:00
Sebastian Sellmair 9442009d91 [Gradle][Minor] Add comments for IdeCompilerArgumentsResolverImpl
KTIJ-24976
2023-04-06 16:03:13 +00:00
Sebastian Sellmair 1573f0250a [Gradle][Minor] Add documentation on 'runSafe' to provide guidance on when to use it
KTIJ-24976
2023-04-06 16:03:12 +00:00
Sebastian Sellmair 777955b4e2 [Gradle] Ensure pluginClasspath is imported into the IDE
See
`[KTIJ-24976] Implement initial KotlinMppCompilerPluginImportingTests`
in intellij.git

KTIJ-24976
2023-04-06 16:03:12 +00:00
Sebastian Sellmair 6c2087983c [Gradle] Kotlin2JsCompile: Remove old createCompilerArgs
KTIJ-24976
2023-04-06 16:03:11 +00:00
Sebastian Sellmair ca84505376 [Gradle] KotlinJsIrLink: Handle KotlinBuildStatsService invocation outside of creating compiler args
KTIJ-24976
2023-04-06 16:03:11 +00:00
Sebastian Sellmair fc05d001c6 [Gradle] Implement additional IdeCompilerArgumentsResolverTest
KTIJ-24976
2023-04-06 16:03:11 +00:00
Sebastian Sellmair 446c6793a4 [Gradle] Kotlin2JsCompile: Remove redundant processArgs
KTIJ-24976
2023-04-06 16:03:10 +00:00
Sebastian Sellmair 014bb0214f [Gradle][Minor] Kotlin2JsCompile: Make contributeAdditionalCompilerArguments protected
KTIJ-24976
2023-04-06 16:03:10 +00:00
Sebastian Sellmair 1cebf24bed [Gradle] GenerateGradleOptions: Remove fillDefaultValues
KTIJ-24976
2023-04-06 16:03:09 +00:00
Sebastian Sellmair d6cc9e2476 [Gradle] KotlinCompile: Prevent iterating calling FileCollection.getFiles multiple times for sources
KTIJ-24976
2023-04-06 16:03:09 +00:00
Sebastian Sellmair b8f8b9b344 [Gradle][Minor] Remove redundant args.moduleName = compilerOptions.moduleName.orNull
KTIJ-24976
2023-04-06 16:03:09 +00:00
Sebastian Sellmair 1844aab35d [Gradle] KotlinCompile: Move allowNoSourceFiles = true to KotlinJvmCompilerOptionsHelper
KTIJ-24976
2023-04-06 16:03:08 +00:00
Sebastian Sellmair e5fbb253c5 [Gradle][Minor] createCompilerArguments(default) -> createCompilerArguments()
KTIJ-24976
2023-04-06 16:03:08 +00:00
Sebastian Sellmair d85d6fc0bb [Gradle][Minor] IdeCompilerArgumentsResolver: Replace if with when
KTIJ-24976
2023-04-06 16:03:07 +00:00