Commit Graph

106857 Commits

Author SHA1 Message Date
Alexander.Likhachev 0fbd2e960d [Build] Remove redundant .forUseAtConfigurationTime() calls
Starting from Gradle 7.4, these calls are no longer required.
^KTI-1473 In Progress
2023-12-07 18:31:06 +00:00
Alexander.Likhachev 1dc76f0b94 [Build] Fix configuration cache issue with :repo:artifacts-tests:test
^KTI-1473 In Progress
2023-12-07 18:31:06 +00:00
Alexander.Likhachev f915efab18 [Build] Update artifacts tests test data after the Gradle 8.4 upgrade
^KTI-1473 In Progress
2023-12-07 18:31:06 +00:00
Alexander.Likhachev eab2c6b9b9 [Build] Bump gradle-node-plugin version to 7.0.1
This change is required to fix a configuration cache problem revealed after migration to Gradle 8.4
^KTI-1473 In Progress
2023-12-07 18:31:06 +00:00
Alexander.Likhachev 35960f65fb [Build] Upgrade Gradle to 8.4
^KTI-1473 In Progress
2023-12-07 18:31:06 +00:00
Alexander.Likhachev ad677cb573 [Build] Use dependencies.create instead of dependencies.module
It seems there was no actual need for a call to `dependencies.module`.Also, it's going to be deprecated in Gradle 8.3
^KTI-1473 In Progress
2023-12-07 18:31:06 +00:00
Alexander.Likhachev a19bd2ed2e [Build] Migrate most of the build logic from Project.buildDir usage
It's going to be deprecated in Gradle 8.3

There's currently no way to pass a `org.gradle.api.provider.Provider` to the JavaExec.systemProperty or Test.systemProperty. There's a workaround using `org.gradle.process.CommandLineArgumentProvider`, but I intentionally don't rework these calls as Gradle is going to allow passing providers to configure system properties: https://github.com/gradle/gradle/issues/12247#issuecomment-1568427242
^KTI-1473 In Progress
2023-12-07 18:31:06 +00:00
Alexander.Likhachev b784544f8d [Gradle] Migrate functional tests from Project.buildDir usage
It's going to be deprecated in Gradle 8.3
^KTI-1473 In Progress
2023-12-07 18:31:06 +00:00
Kirill Rakhman 81517a3d29 [FIR] Set targets of annotation classes in FirJavaElementFinder
#KT-60504 Fixed
2023-12-07 18:29:45 +00:00
Kirill Rakhman daa02813c2 [FIR] Generate FIR diagnostics with explicit types
#KT-64147 Fixed
2023-12-07 18:29:28 +00:00
Dmitrii Krasnov fc1ada4896 [Gradle] Changed compileKotlinTask to compileTaskProvider 2023-12-07 18:14:13 +00:00
Dmitrii Krasnov eb69229b8f [Gradle] Removed using deprecated buildDir in GradleKotlinCompilerRunner
^KT-62527
2023-12-07 17:33:44 +00:00
Andrei Klunnyi 0a57c661fd Comment for LazyScriptDefinitionProvider's property
Relates to KTIJ-27951.
2023-12-07 16:37:35 +00:00
Yahor Berdnikau c26b5ca365 [Gradle] Slight improvement for generated compiler options KDoc
Separated possible and default value from the description.

^KT-58858 In Progress
2023-12-07 16:19:24 +00:00
Yahor Berdnikau aeaaf6dd8e [Gradle] Add a check that KGP API has consistent KDoc
^KT-58858 In Progress
2023-12-07 16:19:24 +00:00
Yahor Berdnikau 01e9ad1680 [Gradle] Update KDoc for KotlinTopLevelExtensionConfig
^KT-58858 In Progress
2023-12-07 16:19:24 +00:00
Yahor Berdnikau e7bd4e6dbd [Gradle] Update KDoc for KotlinHierarchyDsl
^KT-58858 In Progress
2023-12-07 16:19:24 +00:00
Yahor Berdnikau 1671c41652 [Gradle] Update KDoc for Kapt extension
^KT-58858 In Progress
2023-12-07 16:19:24 +00:00
Yahor Berdnikau 71a80b159b [Gradle] Add KDoc for KotlinCompile interface
^KT-58858 In Progress
2023-12-07 16:19:24 +00:00
Yahor Berdnikau 218d3b547b [Gradle] Add documentation for LanguageSettings
^KT-58858 In Progress
2023-12-07 16:19:24 +00:00
Yahor Berdnikau d12ba2976c [Gradle] Slightly update documentation in JvmTargetValidationMode
^KT-58858 In Progress
2023-12-07 16:19:24 +00:00
Yahor Berdnikau b22185f140 [Gradle] Add required suppressions for API .dsl package
Some classes or fields in this package should not be present in the
documentation.

^KT-58858 In Progress
2023-12-07 16:19:24 +00:00
Yahor Berdnikau f78cddcd3f [Gradle] Fix deprecated buildDir usage in DefaultKotlinCompilationOutputFactory
^KT-62527 In Progress
2023-12-07 15:30:22 +00:00
Svyatoslav Scherbina dd55ca6ed0 Native: fix Swift compilation in tests for tvos_simulator_arm64
e5ae32c removed bitcode embedding from tests. In particular, that commit
disabled bitcode embedding when compiling Swift code (e.g. in ObjCExport
tests).

It seems that bitcode embedding also enables adhoc codesigning in the
linker.
The linker doesn't seem to do adhoc codesigning by default for tvOS
arm64 simulator target, and without a signature the binaries can't run
on the simulator.

So disabling bitcode embedding also disabled adhoc codesigning and made
the tests fail on that target.

Fix this by explicitly passing `-Xlinker -adhoc_codesign` when compiling
Swift code in tests.
2023-12-07 15:10:04 +00:00
Dmitriy Dolovov c9f4a1a841 IR: Avoid overwriting of property signature descriptions
^KT-64085
^KT-64082
2023-12-07 15:02:24 +00:00
Nataliya.Valtman 03cf13705e Support "beta + number" library versions
#KT-64122 Fixed
2023-12-07 14:14:50 +00:00
Dmitrii Gridin 97956b4374 [LL FIR] resolve propagated type annotations correctly
This commit is Low Level FIR part of changes around propagated
annotations (aka foreign annotations).
It includes such changes as:
* implicit type phase postpones foreign annotations resolution
* annotation arguments are requests resolution for postponed
annotations from implicit type phase as a pre-resolve step
* body resolve phase just calls lazy resolution for foreign annotations
on demand
* isResolved check for type annotations to be sure that all annotations
are resolved after annotation arguments phase

^KT-63042 Fixed
^KT-63681 Fixed
2023-12-07 12:26:40 +00:00
Dmitrii Gridin cf11e26755 [FIR] do not transform file annotation arguments before annotations phase
^KT-63042
2023-12-07 12:26:40 +00:00
Dmitrii Gridin daaf30e056 [LL FIR] introduce LLImplicitBodyResolveComputationSession
This class will be used in the next commit to have a custom logic
in Low Level FIR

^KT-63042
2023-12-07 12:26:40 +00:00
Dmitrii Gridin 9888cbbfcd [FIR] do not transform propagated annotations from place other than declaration side
We shouldn't transform annotations not from declaration side due to
a possible different context and to avoid unexpected transformation of
unrelated declarations

Example:
```kotlin
fun implicitType1() = TopLevelObject.expectedType()

object TopLevelObject {
    private const val privateConstVal = "privateConstVal"
    fun expectedType(): @Anno(privateConstVal) Int = 4
}
```
Here we will try to transform the annotation from `expectedType`
during `implicitType1` and as the result, we will see unresolved
reference on the declaration side. This commit fixes this issue.

This solution is based on the fact that the compiler anyway will
resolve the propagated annotation on the declaration side.
And it doesn't matter if it is resolved before or after the call site
declaration transformation, because as a global result, we will observe
that all declarations are resolved correctly in the right context.

Hence, this commit fixes the issue in the case of "full resolution"
which is true for the compiler, but it is not correct for Low Level
FIR where we resolve declarations on demand. It will be solved in
the next commits

^KT-63042
2023-12-07 12:26:40 +00:00
Dmitrii Gridin 6f0d52f991 [FIR] runAllPhasesForLocalClass: drop redundant annotations transformation
Such annotations will be transformed as usual in `FirDeclarationsResolveTransformer.transformRegularClass`.
Also, this transformation doesn't have a corresponding class as a container

^KT-63042
2023-12-07 12:26:40 +00:00
Dmitrii Gridin a7afd1fe01 [FIR] ReturnTypeCalculatorWithJump: use outer transformer instead of type calculator
This is a more flexible solution

^KT-63042
2023-12-07 12:26:40 +00:00
Dmitrii Gridin edb496f260 [FIR] BodyResolveContext: withFile should add container as well
This container will be used during an annotation call owner search

^KT-63042
2023-12-07 12:26:40 +00:00
Dmitrii Gridin ed7415ab93 [FIR] BodyResolveContext: insideClassHeader should add container as well
This container will be used during an annotation call owner search

^KT-63042
2023-12-07 12:26:40 +00:00
Dmitrii Gridin ec180bca71 [FIR] ImplicitBodyResolveComputationSession: encapsulate compute logic
This is required to simplify the code and have only one enter point

^KT-63042
2023-12-07 12:26:40 +00:00
Dmitrii Gridin 83bdac8d61 [FIR] CustomAnnotationTypeAttribute: drop containerSymbols
Now annotations have the container symbol itself, so this property
is no longer needed.
This migration fixes issues with a missed container symbol, so now
all cases of lazy resolution from KtType are supported

^KT-63042
2023-12-07 12:26:39 +00:00
Dmitrii Gridin 264a151676 [FIR] do not copy annotations during type propagation
We should share the original instance to be able to later resolve it in
the original context. This commit returns the KT-60387 problem, but the
root cause (concurrent modification) will be fixed in the context of
KT-63042

^KT-63042
2023-12-07 12:26:39 +00:00
Dmitrii Gridin 69559689fd [LL/FIR] add more resolve tests for declarations with annotations
^KT-63042
2023-12-07 12:26:39 +00:00
Dmitrii Gridin 5bd1a97632 [FIR] LT builder: extract convertAnnotationList from convertModifierList
To simplify the logic around `convertModifierList` as a combination of
annotations and modifiers doesn't work well

^KT-63042
2023-12-07 12:26:39 +00:00
Dmitrii Gridin c5cba4c053 [FIR] builder: provide containingDeclarationSymbol
We cannot use only non-local declarations as anchors due to the same
resolution logic between member declarations of local classes, so we
have to support such cases as well

^KT-63042
2023-12-07 12:26:39 +00:00
Dmitrii Gridin be4bc81b1b [FIR] FirFileSymbol: add stable toString
It will be used in tests in the next commit

^KT-63042
2023-12-07 12:26:39 +00:00
Dmitrii Gridin 6eca9fe3a9 [FIR] tree: introduce containingDeclarationSymbol for annotation calls
This symbol will be used during resolution to avoid transformation
of annotations in the wrong context in the case of FIR node sharing.
The symbol should be some containing declaration symbol to be able
to answer the question "Are we own this annotation?" during resolution

^KT-63042
2023-12-07 12:26:39 +00:00
Dmitrii Gridin 1d5ab8c24f [FIR] builder: more tests for annotations
^KT-63042
2023-12-07 12:26:39 +00:00
Xin Wang 11749d7c89 [Codegen][JVM]: Mark line number before invoking intrinsics
Fixes #KT-61768
2023-12-07 11:54:12 +00:00
Nikita Nazarov 0898dd1e7f [FIR] Don't check Java annotations for cycles
^KT-64083 fixed
2023-12-07 08:56:56 +00:00
Yan Zhulanow 1726a94c87 [Pill] Update module structure 2023-12-07 08:53:35 +00:00
Yan Zhulanow 7129bcc2b1 [Pill] Support production-on-test dependencies 2023-12-07 08:53:35 +00:00
Yan Zhulanow a7f6029076 [Pill] Delete obsolete run configurations 2023-12-07 08:53:35 +00:00
Yan Zhulanow d9a33b53ce [Pill] Update Kotlin source set fetching 2023-12-07 08:53:35 +00:00
Yan Zhulanow e4da639e1c [Pill] Remove 'jps-compatible' plugin from the root Kotlin project
'excludedDirs' definition is not needed anymore, so the plugin usage
is not really useful.
2023-12-07 08:53:35 +00:00