Commit Graph

9487 Commits

Author SHA1 Message Date
Yahor Berdnikau 3b878336dd [Gradle] Fix additional java resource dirs are erased on KGP/Jvm plugin apply
User scripts may apply KGP/Jvm plugin not immediately in 'plugins {}'
block. And a script may also already add some additional resources into
a java source set before plugin apply. On apply plugin has erased such
additionally configured resource dirs as it assumed only the default one
are set. Now it also syncs them.

^KT-60459 Fixed
2023-07-26 12:50:51 +00:00
Yahor Berdnikau 11cefc52a7 [Gradle] Introduce ResourcesIT test suite
This suite will check how resources are handled in the plugin.

^KT-60459 In Progress
2023-07-26 12:50:51 +00:00
Ilya Goncharov bfe73567c1 [Gradle, JS] Remove deprecated methods for methods with Action input parameter to be chosen
^KT-60218 fixed

Merge-request: KT-MR-11280
Merged-by: Ilya Goncharov <Ilya.Goncharov@jetbrains.com>
2023-07-26 10:32:45 +00:00
Sebastian Sellmair f883079988 [Gradle] IdeBinaryDependencyResolver: Support opaque file dependencies
^KT-60612 In Progress
2023-07-26 09:50:12 +00:00
Sebastian Sellmair 6c4ce81237 [Gradle] Implement 'KotlinOutputDependency' to retain information about kotlin produced dependencies
^KT-60612 In Progress
2023-07-26 09:50:12 +00:00
Stanislav Erokhin ecbc40cf92 [mpp] Mark Kotlin12XMppDeprecation as FATAL
Old MPP plugins are deprecated for a long time. It is time to report
fatal error for such cases.
Our stdlib still and kotlin-test still using them, so we cannot just
completely remove them, but there is a way to suppress this error:
kotlin.internal.mpp12x.deprecation.suppress=true

Code for the old plugins (together with the remaining testsdata)
will be completely removed once stdlib and kotlin-test
migration completed. ETA: ~ 2.0-Mx

#KT-60553 Verification Pending
2023-07-26 09:25:50 +00:00
Stanislav Erokhin 955520f69e [Gradle] Fix the verbose rendering for FATAL diagnostics
During the tests we are using the verbose way of render the diagnostic
meaning, that we are adding the diagnostic id to the diagnostic message.
And we previously didn't have that for one case, so we were unable to
detect in tests that diagnostic with FATAL severity was reported
2023-07-26 09:25:50 +00:00
Ilya Chernikov 895a811b47 K2 Scripting: fix capturing from the imported scripts 2023-07-26 08:49:27 +00:00
Ilya Chernikov 1d88c307ea K2 Scripting: fix locality of script declarations
the script declarations are considered public, at least because they
can be reused from another script then used with the `importedScripts`
configuration property. It also improves the compatibility with K1
scripting.
2023-07-26 08:49:27 +00:00
Ilya Chernikov 020a590df7 K2 Scripting: fix order of arguments processing
and base class handling:
Since in K2 we do not distinguish between script arguments taken from
the base class and provided properties, we need this extra functionality
to preserve the argument order of K1 scripts.
This is a temporary measure, since we're going to deprecate base class
usage at some point (KT-60449), so the relevant constructor arguments
should disappear too.
2023-07-26 08:49:27 +00:00
Ilya Chernikov d24fc3b581 K2 Scripting: add support for result field 2023-07-26 08:49:26 +00:00
Ilya Chernikov 480ea80fc4 Enable K2 scripting tests 2023-07-26 08:49:26 +00:00
Ilya Chernikov 266a223460 Update scripting plugin autoload logic for K2 2023-07-26 08:49:26 +00:00
Nikita Bobko f4ba5aaf9a [FE 1.0] Prohibit implicit Java actualization in K1
^KT-58545 Fixed
Review: https://jetbrains.team/p/kt/reviews/10561

It's not yet supported in K2 KT-59213

Related tests:
- ApiTest.testStdlib
- RuntimePublicAPITest.kotlinStdlibRuntimeMerged
- KotlinProjectViewTestGenerated.test_Arrays (in Kotlin plugin)
2023-07-25 22:30:09 +02:00
Abduqodiri Qurbonzoda e5ab1d9ccf Commonize the ExperimentalNativeApi annotation 2023-07-25 15:01:49 +00:00
Timofey Solonin cd073690fa [MPP] Add LC_ALL to CocoaPods IT
^KT-60394
2023-07-25 13:11:02 +00:00
Timofey Solonin f47ebcf1b7 [MPP] Fail pod install in IT if it returns non-zero exit code
^KT-60394
2023-07-25 13:11:02 +00:00
Ilya Goncharov 54debac4c5 [Gradle, JS] Remove K/JS legacy support from Gradle plugin 2023-07-25 13:08:23 +00:00
Svyatoslav Scherbina 61dbe7fb75 [Gradle] temporarily change error to warning for linuxArm32Hfp
^KT-58864
2023-07-25 12:33:46 +00:00
Svyatoslav Scherbina ec985b1ffe [Gradle] Add ExperimentalForeignApi opt-ins to integration tests
3f3f6eb marks all cinterop-generated declarations with
@ExperimentalForeignApi. As a result, all usages of such declarations
have to opt-in explicitly. This commit adds those opt-ins to all
usages in the Kotlin Gradle plugin integration tests.

^KT-58362
2023-07-25 11:49:35 +00:00
Mikhail Glukhikh 3547b404d5 Use language version 1.9 in KAPT3 tests to avoid 2.0 migration problems 2023-07-24 12:45:07 +00:00
Roman Efremov 12eb6d97bf [Stdlib] Remove @InlineOnly from expect declarations of minOf(), maxOf()
to satisfy MPP annotation checker.
It has reporting because @InlineOnly is absent on declarations with
Long parameter (removed in 233376eef0).

^KT-58551
2023-07-24 09:48:49 +00:00
Alexander Udalov 1cd24c61b8 Build: suppress warnings in kotlin-gradle-plugin
There's a lot of warnings which are distracting during each build.

 #KT-60498 Fixed
2023-07-21 15:33:09 +00:00
Sebastian Sellmair 96b33007e5 [Gradle] Implement 'publishJvmEnvironmentAttribute' flag
When the flag is 'on', then publications will include
The 'org.gradle.jvm.environment' Gradle attribute.

We previously did not publish this attribute, as it lead
to problems for 'old' consumers.

We will roll out publications gradually with this feature flag.
The external Android target is expected to opt into this flag
as it is necessary for disambiguating Android from JVM targets
when the external Android target also uses KotlinPlatformType.jvm
2023-07-21 14:24:10 +00:00
Anton Lakotka 67f4343137 [Gradle] rework addSourceSet to not let sourceSets be exposed in groovy
Also mark it as deprecated to prevent internal misuses.

^KT-58234 Verification Pending
2023-07-21 11:47:01 +00:00
Anton Lakotka f05856f6a0 [Gradle] Lower deprecation level of KotlinCompilation source method
It makes IDE Import failing when method is used.
So tooling diagnostic with ERROR level is preferred in such cases.

^KT-58234 Verification Pending
2023-07-21 11:47:01 +00:00
Anton Lakotka c3b09e148b [Gradle] Add KotlinCompilationSourceDeprecation diagnostic
^KT-58235 Verification Pending
2023-07-21 11:47:01 +00:00
Anton Lakotka 245825cf8b [Gradle] Elevate KotlinCompilation.source deprecation to ERROR
Fix internal use of this API with dedicated internal function.

^KT-58234 Verification Pending
2023-07-21 11:47:01 +00:00
Dmitrii Krasnov 04dce8a3f0 Added configuring <SingleNativeTarget> for subprojects nativeProject form testDsl
#KT-51553 In Progress
2023-07-20 11:05:05 +00:00
Yahor Berdnikau 19a60d6b85 [Gradle] Fix kapt test with different JDK versions
This test was incorrect as it configured JVM toolchain to use JDK 1.8.
This configured JVM toolchain forced kapt tasks to always use JDK 1.8
even if the build itself was running on different JDK versions. Now test
uses different values for JVM toolchain which should correctly
configure kapt JDK.

^KT-59588
2023-07-19 18:58:53 +00:00
Anton Lakotka 325d184419 [Gradle] Update documentation in KotlinTargetAlreadyDeclared
^KT-59316 Verification Pending
2023-07-19 16:38:37 +00:00
Anton Lakotka bb7e738b9e [Gradle] Remove TargetsNeedDisambiguation diagnostic
It is overlapping with KotlinTargetAlreadyDeclared which is stricter
and recommends users to migrate away from multiple target set up at all.

^KT-59316 Verification Pending
2023-07-19 16:38:37 +00:00
Anton Lakotka b08d12e477 [Gradle] Report KotlinTargetAlreadyDeclared from checker
Rephrase diagnostic message and add kotl.in link for details.

^KT-59316 Verification Pending
2023-07-19 16:38:37 +00:00
Anton Lakotka 0e34d0b01a [Gradle] Deprecate multiple same targets
Having multiple jvm, js and other targets in the same project
is now deprecated and will be forbidden in the future.

Users should migrate away from that by using custom compilations
or different projects.

^KT-59316 Verification Pending
2023-07-19 16:38:37 +00:00
Yahor Berdnikau dc5660d98c [Gradle] Add 'validatePlugins' tasks for Gradle plugin dependencies
Gradle 8 has removed "validate-external-gradle-plugin" plugin which we
used before to run validate task inputs proper annotations.

With this change, every Gradle dependency that is not published as a
Gradle plugin but uses Gradle API types is also running
'validatedPlugins' task registered manually via a build script.

^KT-59827 Fixed
2023-07-19 13:36:03 +00:00
Yahor Berdnikau f5889bcc6c [Gradle] Update plugin variant used test 2023-07-19 13:36:03 +00:00
Kirill Rakhman 987867fe12 [FIR2IR] Fix crash caused by unresolved annotation argument in deserialized class
#KT-60181 Fixed
2023-07-19 11:07:11 +00:00
Yahor Berdnikau faa74d124f [Gradle] Fix kapt tests compatability with Gradle 8.0
^KT-59588 Fixed
2023-07-19 08:14:50 +00:00
Bogdan Mukvich 3aee0ab994 Add SBOM for gradle plugins
^KTI-1299
2023-07-19 06:57:32 +00:00
Sebastian Sellmair a4a0da267e [Gradle] KotlinJvmCompilation: Implement 'javaSourceSet' as safe Future<SourceSet?>
^KT-60441 Verification Pending
2023-07-17 22:22:02 +00:00
Sebastian Sellmair a49db89024 [Gradle] CompletableFuture: Add 'isCompleted' API
^KT-60441 Verification Pending
2023-07-17 22:22:02 +00:00
Sebastian Sellmair 0feecebc07 [Gradle] jvm().withJava(): Fix Zombie compilation instance returned from create()
^KT-60462 Verification Pending
2023-07-17 22:22:01 +00:00
Zalim Bashorov 5db493a475 [Wasm, JS] Update v8 to 11.7.186 2023-07-17 23:57:34 +02:00
Zalim Bashorov b744f2ef82 [Wasm] Stop using "--type-ssa" since without "--type-merging" it increases output size
"--type-merging" was disabled before because it requires "--close-world"
which we can't use in general (specifically in Compose applications).
2023-07-17 23:57:34 +02:00
Timofey Solonin 6edfda0204 [MPP] Run pod install through env to prevent ProcessBuilder from missing
PATH modifications

^KT-60394
2023-07-17 14:18:37 +00:00
Sebastian Sellmair f47b2f404f [Gradle][Minor] Rename IdeArtifactResolutionQuerySourcesAndDocumentationResolver to IdeArtifactResolutionQuerySourcesResolver
^KT-59595 Verification Pending
2023-07-17 13:56:09 +00:00
Sebastian Sellmair e5ac2f2788 [Gradle] Multiplatform Import: Support intellij/gradle 'idea.gradle.download.sources' flag
^KT-60441 Verification Pending
2023-07-17 13:56:09 +00:00
Yahor Berdnikau 851a925b4e [Gradle] Fix tags count violation in tests
^KT-59799 Fixed
2023-07-17 13:23:08 +00:00
Yahor Berdnikau 2d6bb3b744 [Gradle] Add tags count validator for Gradle integration tests
Our current test tasks setup relies on filtering tests by tags. When a
test accidentally has more than one tag, it will never run on CI because
every test task will filter it out.

Validator will check test method tags count and fail the test if they
are more than one.

^KT-59799 In Progress
2023-07-17 13:23:08 +00:00
Nataliya.Valtman 27043bd8a6 Catch NoClassDefFoundError when BuildScanExtension is not found
Add simple test with init script

#KT-59589
2023-07-17 09:21:42 +00:00