Commit Graph

9871 Commits

Author SHA1 Message Date
Dmitriy Novozhilov a35f2eb90e Build: switch language level for compilation to 2.0
KT-61951
2023-10-18 07:59:26 +00:00
Sebastian Sellmair 5642f2a8c4 [build] acceptAndroidSdkLicenses, functionalTest: Support Gradle configuration cache 2023-10-18 07:51:17 +00:00
Anton Lakotka d090791e40 [Gradle] Change rootOutputDirectoryProperty to be DirectoryProperty
^KT-61359 Verification Pending
2023-10-18 04:50:47 +00:00
Anton Lakotka d74a1133e9 [Gradle] Merge testCommonizer and testCleanCommonizationWithConfigurationCache
They are essentially testing the same thing. So it is logical
to merge them into single test run.

^KT-61359 Verification Pending
2023-10-18 04:50:47 +00:00
Anton Lakotka 251f52586e [Gradle] Add fileProperty(initialValue: File) utility function
^KT-61359 Verification Pending
2023-10-18 04:50:47 +00:00
Anton Lakotka 6ee4cbb6ec [Gradle, Test] Let resolveAllConfiguration depend on commonizeNativeDistribution
after introducing changes as part of KT-61359

^KT-61359 Verification Pending
2023-10-18 04:50:47 +00:00
Anton Lakotka c08fb1cae6 [Gradle] add rootOutputDirectoryProperty to NativeDistributionCommonizerTask
And read commonized klibs in execution time only.
it is possible only when rootOutputDirectoryProperty is marked as
OutputDirectory.

```kotlin
class Producer {
  @get:OutputDirectory
  val foo: RegularFileProperty

  @get:Internal
  val bar: RegularFileProperty
}

val foo = producer.flatMap { it.foo.map { it.listFiles() } }
val bar = producer.flatMap { it.bar.map { it.listFiles() } }
```

`foo` file collection will be evaluated at execution time.
Because `Producer.foo` is an OutputDirectory and its content unknown
during configuration time.
But `bar` file collection will be evaluated at configuration time.
Because according to gradle model it is not Output and therefore
its content can be evaluated before task execution.

^KT-61359 Verification Pending
2023-10-18 04:50:47 +00:00
Anton Lakotka 2111bfae40 [Gradle] Test commonizeNativeDistribution task is not initialized
^KT-61359 In Progress
2023-10-18 04:50:47 +00:00
Anton Lakotka e16f03fc49 [Gradle] Test commonize native distribution and compile task with GCC
It should be possible to commonize native distribution from clean state
and compile shared native code in the same gradle build with enabled
configuration cache.

^KT-61359 In Progress
2023-10-18 04:50:47 +00:00
Anton Lakotka 657dd31493 [Gradle] Remove up-to-date checks in CleanNativeDistributionCommonizer
Gradle doesn't track removed files in OutputDirectory after task
execution. So if task removed some files and if these files
are added back the task would be still UP-TO-DATE. Which is incorrect.

Executing clean task on empty directory is the same as check that
directory is empty. Therefore, this up-to-date check can be removed.

^KT-62611 Verification Pending
2023-10-18 04:50:47 +00:00
Anton Lakotka 16c17d3c22 [Gradle] Check that commonized native distribution can be cleaned
^KT-62611 In-Progress
2023-10-18 04:50:47 +00:00
Ilya Gorbunov db6dfe99a0 Update Dokka to 1.9.10 2023-10-17 15:43:59 +00:00
Sebastian Sellmair ca79860a71 [Gradle] Move 'whenEvaluated' util function into 'utils' package 2023-10-17 13:58:02 +00:00
Sebastian Sellmair 6240e2eddb [Gradle] Rename KotlinMultiplatformPlugin.kt to KotlinLegacyMultiplatformPlugin.kt 2023-10-17 13:58:01 +00:00
Sebastian Sellmair a8e637205c [Gradle] Migrate extraProperties.getOrPut usages to *StoredProperty
KT-61634
2023-10-17 12:10:15 +00:00
Sebastian Sellmair ecbd741e40 [Gradle] Rename stored{Classifier}Property to {classifier}StoredProperty
This change is intended to improve the intuition of developers.
After adding the two functions, many times developers (me) have
tried to use the 'wrong' (which is now the new name) function name.

KT-61634
2023-10-17 12:10:15 +00:00
Sebastian Sellmair 08241acb6f [Gradle] Demote ExtrasProperty APIs with little usage
Those APIs can either be replaced with StoredProperty
Some APIs also have shown to be 'hard to understand'

KT-61634
2023-10-17 12:10:15 +00:00
Ilya Goncharov 22a01432df [Gradle,JS] Remove legacy target in Gradle plugin
This reverts commit 4c82206d

^KT-60694 fixed
2023-10-17 09:42:38 +00:00
Ilya Goncharov 4e37ac6ed8 [JS] Silent rollup build
^KT-53077 fixed
2023-10-16 21:20:49 +00:00
Ilya Goncharov 1cde8c3624 [JS] Fix kotlin bom to use type klib 2023-10-16 13:34:37 +00:00
Ilya Goncharov 1b7e7dfed7 [JS] Fix JS artifacts in maven build 2023-10-16 13:34:36 +00:00
strangepleasures ac51e7b407 KT-61628 [KAPT] Re-enable testAndroidDaggerIC in K2 2023-10-13 16:23:14 +00:00
Artem Daugel-Dauge 9c1fa93607 [Gradle] Fix CocoaPods-Xcode tests 2023-10-13 14:03:45 +00:00
Sebastian Sellmair 4c15509776 [Gradle] Rename KotlinExtensionPoint to KotlinGradlePluginExtensionPoint
KT-61634
2023-10-12 18:24:17 +00:00
Sebastian Sellmair d471a5ed4a [Gradle] Migrate KotlinGradleProjectChecker to KotlinExtensionPoint
KT-61634
2023-10-12 18:24:17 +00:00
Sebastian Sellmair 30665c3e02 [Gradle] Implement KotlinExtensionPoint to allow extensible designs inside the KotlinGradlePlugin
KT-61634
2023-10-12 18:24:17 +00:00
Sebastian Sellmair e78331cd5c [Gradle] Implement generic 'StoredProperty' mechanism
This will allow extending objects of 'Project' or 'HasMutableExtras'
with generic, stored instances

KT-61634
2023-10-12 18:24:17 +00:00
strangepleasures 2319e11ff1 [KAPT] KT-62059 Disable incremental stub generation in K2 2023-10-12 13:37:23 +00:00
Ilya Goncharov 376d27dc6a [Gradle, Wasm] Fix proxy for karma wasm tests on windows
^KT-62128 fixed
2023-10-12 09:27:34 +00:00
Artem Daugel-Dauge c19fc3ced3 [Gradle] Fix some macOS Gradle IT 2023-10-10 10:57:08 +00:00
Ilya Goncharov ed247a3892 [JS] Remove kotlin-archetype-js
^KT-54868 fixed
2023-10-10 09:16:14 +00:00
Dmitrii Krasnov 9bda7571fd [Gradle IT] Removed old configuration for K/N IT
#KT-51553 Fixed
2023-10-10 09:10:14 +00:00
Alexander Udalov 9164b7d405 K2 kapt: remove reference to "kapt 4" from the warning
#KT-62438 Fixed
2023-10-09 16:08:45 +00:00
Alexander.Likhachev afdd8466cc [Gradle] Introduce KotlinBuildStatsServicesRegistry to manage FUS services
KT-57371 introduced a legacy JMX service without proper management.
#KT-62318 Fixed
2023-10-09 13:44:29 +00:00
Alexander.Likhachev bb23602cb3 [Gradle] Do not hold a reference to Gradle objects in FUS services
Despite the FUS services are intended to be scoped to a build, the legacy compatibility service wasn't properly managed and that caused a significant memory leak together with changes in KT-59826.
#KT-62318 In Progress
2023-10-09 13:44:29 +00:00
Evgenii Mazhukin 203b7a4da3 [KGP] Treat friendPaths as non-incremental Input property
When friendPaths change, internal symbols from other modules become hidden
or visible. This might change which functions are called, which types
are returned, etc. So we should recompile the affected classes.

Gradle doesn't allow Input policy on FileCollection properties, so we
introduce friendPathsSet. It allows us to keep the ABI of BaseKotlinCompile
unchanged, detect non-incremental configuration changes on Gradle side,
and use normal incremental compilation for everything else.

^KT-61918 Fixed


Merge-request: KT-MR-12372
Merged-by: Evgenii Mazhukin <evgenii.mazhukin@jetbrains.com>
2023-10-09 11:23:02 +00:00
Anton Lakotka d820ddc27d [Gradle] Mark "main" metadata compilation as non-klib in all cases
Metadata compilation with name "main" isn't used in Hierarchical
Multiplatform. It used to compile commonMain source set to legacy
metadata artifacts. With Hierarchical MPP common source sets start
to compile to klib metadata.
2023-10-06 15:39:05 +00:00
Anton Lakotka f01c8de216 [Gradle] Add multiplatformExtension.metadataTarget 2023-10-06 15:39:05 +00:00
Anton Lakotka 0230f809c4 [Gradle] Fix CME when subplugins create source sets
GranularMetadataTransformation.ProjectData is created for all projects
There was a chance when it is created too early before some projects
evaluation. And if that happened that these projects contained some
subplugins (for example KSP) that add more source sets. Then old
algorithm of collecting sourceSetsMetadataOutputs() would fail with
ConcurrentModificationException. For example in this scenario:

Lets assume we evaluate sourceSetsMetadataOutputs for project with
just one common source set: commonMain.
And therefore one metadata compilation whose default source set name is:
commonMain.
On top of that a subplugin applied to this project. This subplugin
creates additional source set for each metadata compilation.

Then with old algorithm following would happen:

* start iterating over sourceSets
* for `commonMain` source set await its Metadata Compilation
* * When Metadata Compilation gets configured at some point of time
 it will reach KotlinCommonSourceSetProcessor.doTargetSpecificProcessing
 method. Which will apply subplugins.
* * When subplugin is applied it adds a new Source Set to
  the sourceSets collections: CME is occurred!

Adding a source set in subplugins should be regulated
either allow it and fix related side effects OR deprecate it.

The current fix doesn't solve all potential issues with adding new
source sets from subplugins. It primarily focused on CME occurrence
for the case above.

^KT-62299 Verification Pending
2023-10-06 15:39:05 +00:00
Ilya Gorbunov 7bdcaff89a KT-61126 Change test expectations
Also improve failure diagnostics in test
2023-10-06 00:46:08 +00:00
Ilya Gorbunov 785d6858ea KT-62004 Drop legacy JS build of kotlin-stdlib
- preserve kotlin-stdlib-js.jar in dist and maven
- change packaging to klib in .pom
- fix manifest attributes of kotlin-stdlib-js
2023-10-06 00:46:08 +00:00
Ilya Gorbunov 2590e7f48b KT-62004 Add kotlin-test maven artifacts to BOM integration test 2023-10-06 00:46:08 +00:00
Ilya Gorbunov eb813b7837 KT-62004 Drop legacy JS build of kotlin-test 2023-10-06 00:46:08 +00:00
Artem Daugel-Dauge 62544ec9c8 [Gradle] Don't copy DSYM in embedAndSign task
^KT-62232 Verification Pending
2023-10-05 14:40:15 +00:00
Ilmir Usmanov e5aa737eaf Do not trim getType from com.intellij.lang.jvm.JvmParameter
Since K2 KAPT uses this API, absence of class bodies in classes
from the package leads to java.lang.NoSuchMethodError

 #KT-61879 Fixed
2023-10-04 17:15:05 +00:00
Sebastian Sellmair 1dad890652 [Gradle][KMP] Remove top level and target level compilerOptions APIs
as those experimental APIs have shown to negatively affect usages
of stable APIs (because of resolve confusion), whilst also
failing to address popular use cases.

KT-61636
KT-61355
KT-61368
2023-10-04 12:23:39 +00:00
Dmitry Savvinov 23dbe5ed3e [mpp, tests] Minor: fix incorrect testdata
It was missed on rr/CI because those tests run only on macs, and
currrently CI has some troubles with that
2023-10-03 15:55:37 +00:00
Ilya Goncharov 68b55181fe [Gradle, JS] Fix muted JS gradle integration tests 2023-10-03 12:40:27 +00:00
Sebastian Sellmair 750ae2c850 [Gradle][KMP] IdeJvmAndAndroidPlatformDependencyResolver: Do not filter ProjectDependencies
as this will result in losing transitive dependencies from said
project dependency.

KT-59020 is now fixed by detecting this case
before creating the 'IdeaKotlinUnresolvedBinaryDependency'

Caused by: KT-59020
^KT-62029 Verification Pending
2023-10-03 11:59:50 +00:00
Ilya Goncharov 7e52aa7b00 [Gradle, JS] Not depends on kotlin npm package 2023-10-03 10:40:21 +00:00