Commit Graph

4982 Commits

Author SHA1 Message Date
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
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
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
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
Sebastian Sellmair 3032d02ce9 [Gradle] Ide Dependency Resolution: Provide attributes for binary coordinates
^KT-60053 Verification Pending
2023-07-14 12:09:09 +00:00
Sebastian Sellmair 6140854fa6 [Gradle] IdeBinaryDependencyResolver: Do not link dependencies to 'isIdeaProjectLevel' by default
As this caching of dependencies would also require
to include the attributes (or name of the variant) into the coordinates

^KT-60053 Verification Pending
2023-07-14 12:09:09 +00:00
Sebastian Sellmair 041b424bab [Gradle] Ide Dependency Resolution: Provide capabilities for binary coordinates
^KT-60053 Verification Pending
2023-07-14 12:09:09 +00:00
Sebastian Sellmair 7af254fbf2 [Gradle] Implement IdeaKotlinBinaryCoordinates.displayString and identityString
^KT-60053 In Progress
2023-07-14 12:09:09 +00:00
Sebastian Sellmair e3f0fa4257 [Gradle] IdeaKotlinBinaryCoordinates: Include 'Capabilities'
... in order to differentiate between feature variants of
published libraries (e.g. testFixtures)

^KT-60053 In Progress
2023-07-14 12:09:09 +00:00
Sebastian Sellmair 5f00bfecff [Gradle] KotlinJvmTarget.withJava(): Disable java *Elements configurations and tasks
... as it was done before commit:

[Gradle] KotlinJvmTarget: Apply java-base plugin instead of java plugin for `withJava` Sebastian Sellmair* 22.06.23, 15:19
e47f4137f4

^KT-60388 Verification Pending
2023-07-14 08:15:05 +00:00
Sebastian Sellmair 625ce4c9db [Gradle] Implement regression test for KT-60388
^KT-60388 In Progress
2023-07-14 08:15:05 +00:00
Yahor Berdnikau 7b665e7673 [Gradle] Move UsesKotlinJavaToolchain inheritance into api
Such way it will be visible which tasks are using this feature.

^KT-58858 In Progress
2023-07-13 19:20:19 +00:00
Dmitrii Krasnov f2816a5531 Added property for overriding konan distribution location
#KT-50463 Fixed

Merge-request: KT-MR-10310
Merged-by: Dmitrii Krasnov <Dmitrii.Krasnov@jetbrains.com>
2023-07-12 12:36:51 +00:00
Anton Lakotka 2f7f69ed4f [Gradle] Remove requiresVisibilityOf API and related checks
^KT-58228 Verification Pending
2023-07-12 11:59:27 +00:00
Sebastian Sellmair 14276642d4 [Gradle] Deprecate ios target shortcut
Which was forgotten in 0b57dac738

^KT-58676 Verification Pending
2023-07-12 10:51:01 +00:00
Anton Lakotka a55b74d4e0 [Gradle] Elevate DeprecatedJvmWithJavaPresetDiagnostic to error
^KT-59320 Verification Pending
2023-07-12 10:19:39 +00:00
Anton Lakotka cd5e4611eb [Gradle] Elevate CommonMainWithDependsOnDiagnostic to error
^KT-59311 Verification Pending
2023-07-12 10:19:38 +00:00
Artem Daugel-Dauge 2e5ae122ea [Gradle] Forbid manual pod install invocation when Kotlin framework is not yet built
^KT-59263 Verification Pending
2023-07-10 18:28:59 +00:00
Alexander.Likhachev 8ae0f61028 [Gradle] Associate the textFixtures source set with main and test ones
#KT-34901 Fixed
2023-07-10 18:23:20 +00:00
Sebastian Sellmair 817e3de8f5 [Gradle] Ensure java source sets being created eagerly for 'withJava'
^KT-60158 Verification Pending
2023-07-10 13:44:02 +00:00
Sebastian Sellmair 42d648f775 [Gradle] KotlinPluginLifecycle: Implement CoroutineStart and start futures 'Undispatched' by default
This API was inspired by kotlinx.coroutines and shall help
making Kotlin Gradle Plugins 'Future' type more applicable for situations
when the Future is used inside the Configuration Phase

^KT-60158 In Progress
2023-07-10 13:44:02 +00:00
Sebastian Sellmair 2d43476811 [Gradle] Implement test to ensure withJava creates java source sets eagerly
^KT-60158 In Progress
2023-07-10 13:44:02 +00:00
Artem Daugel-Dauge ddb27f2b26 [Gradle] Use framework name instead of baseName as the attribute value
^KT-58316 Verification Pending
2023-07-10 12:42:53 +00:00
Artem Kobzar 7c7aa98875 [K/JS] Throw error when a module contains file with the same name and package (ignoring case) 2023-07-07 13:50:04 +00:00
Anton Prokhorov 0e6930e7ef [Gradle] Getting a root project of root gradle after project loading
#KT-59863 Fixed
2023-07-07 13:43:43 +00:00
Artem Daugel-Dauge 9bbfdb708c [Gradle] Log reason why podInstall task is skipped
^KT-60050 Verification Pending
2023-07-06 14:57:40 +00:00
Artem Daugel-Dauge b381752074 [Gradle] Fix cocoapods' cinterops UTD
^KT-60112 Verification Pending
2023-07-06 13:53:52 +00:00
Anton Lakotka a171d0d88e [Gradle] Fix PomDependenciesRewriter to check Android-specific configurations
Initially it was implemented via "relatedConfigurations", but these
relatedConfigurations didn't contain outgoing configurations for default
base compilations, but for KotlinJvmAndroid did. There is no reason to
check incoming configurations for dependency rewriter. So for
KotlinJvmAndroidCompilation it is enough to check their variant-specific
outgoing configurations.

^KT-58225 Verification Pending
2023-07-06 13:23:16 +00:00
Anton Lakotka a5250839fa [Gradle] Include users attributes to host-specific metadata configuration
^KT-60134 Verification Pending
2023-07-06 13:23:16 +00:00
Anton Lakotka 24ff1c6285 [Gradle] Fix test compilation after removing relatedConfigurations
^KT-58225 Verification Pending
2023-07-06 13:23:16 +00:00
Anton Lakotka eb238c0da7 [Gradle] Remove maybeRegister in favor of getOrCreate
It had a little use and even this use was causing a problem. Since
inside `maybeRegister {  }` this block Gradle forbids creation of
other entities. Because this block is part of "entity configuration".

So it is recommended to replace with either
* `getOrCreate("foo", invokeWhenCreated = {})`
* or just getOrCreate("foo").apply {}
2023-07-06 13:23:16 +00:00
Anton Lakotka 001bdc411d [Gradle] Remove relatedConfigurationNames
It was public api which has not much use outside KGP.
Moreover, this api has a little use so it is ok list configuration names
in place.

^KT-58225 Verification Pending
2023-07-06 13:23:16 +00:00
Timofey Solonin 5026778cd1 [MPP] Inject CInteropCommonizerTask from outside instead of using a
future

^KT-58712
2023-07-06 10:20:04 +00:00
Timofey Solonin 2760a25e2c [MPP] Assert that the coroutine block actually runs
^KT-58712
2023-07-06 05:51:21 +00:00