71 Commits

Author SHA1 Message Date
Sergey Bogolepov d31201e05f [Swift export] Umbrella publishing task
As the set of published artifacts might change over time,
we introduce :native:swift:publishAllArtifacts task that hides
all the Swift export publishing details.
2024-03-19 20:32:36 +00:00
Sergey Bogolepov 5ddd253091 [Swift export] Publish non-embedded artifacts
In some cases we can't use embedded artifact, and need to rely on
un-shadowed paths.

^KT-66702 fixed
2024-03-19 20:32:36 +00:00
Artem Olkov eaa50fbf37 add export from kotlin into swift of simple documentation comment #KT-65913 fixed
Merge-request: KT-MR-14622
Merged-by: Artem Olkov <artem.olkov@jetbrains.com>
2024-03-15 11:40:13 +00:00
Artem Olkov fcc4470b74 KT-65897: add exporting of kotlin constructors as Swift constructors #KT-65897 fixed
Merge-request: KT-MR-14734
Merged-by: Artem Olkov <artem.olkov@jetbrains.com>
2024-03-14 12:21:39 +00:00
Yan Zhulanow 507ab1e619 [Pill] Enable Pill for Swift export modules 2024-03-07 06:25:00 +00:00
Artem Olkov a26ffe360c KT-65907: add handling for nested classes #KT-65907 fixed 2024-03-06 14:40:17 +00:00
Wojciech Litewka eec14f0054 [tree generator] Remove Suppress("unused") from implementation classes
Those only implement base classes, their members are not supposed
to be referenced directly (those sometimes they are).
So unused code in there can be suspicious.

On the other hand, some generated builders are truly unused, so leave
the suppression for them.
2024-03-05 13:06:03 +00:00
Sergey Bogolepov 35579692d9 [Swift export] Move swift-export-standalone tests
Move them under `nativeCompilerTest` for the sake of unification, and
running under proper CI configuration.
2024-03-04 08:57:32 +00:00
Artem Olkov e16714fcf9 add export from kotlin into swift of class content #KT-65896 fixed
Merge-request: KT-MR-14624
Merged-by: Artem Olkov <artem.olkov@jetbrains.com>
2024-02-29 18:37:38 +00:00
Artem Olkov e6705e9db2 add distinction between functions and methods in SIR #KT-65046 fixed
Merge-request: KT-MR-14667
Merged-by: Artem Olkov <artem.olkov@jetbrains.com>
2024-02-29 12:52:10 +00:00
Artem Olkov ac403a466e add support for classes with packages #KT-65909 fixed
Merge-request: KT-MR-14623
Merged-by: Artem Olkov <artem.olkov@jetbrains.com>
2024-02-29 12:04:23 +00:00
Artem Olkov ff5098d716 Refactor sir from psi builder, in order to check transatability of psi element
Merge-request: KT-MR-14555
Merged-by: Artem Olkov <artem.olkov@jetbrains.com>
2024-02-28 10:32:11 +00:00
Wojciech Litewka 6cdddaacb0 [IR] Final preparation to autogenerate IR declaration implementations
IR expressions are left out for now, because unlike declarations,
which are mostly created via IrFactory, expressions' constructors are
widely used, and it's hard to replicate the exact signatures of those
constructors with the tree generator.

Therefore, some other approach is expected to be taken when generating
them in the future.

^KT-65773 In Progress
2024-02-28 09:29:56 +00:00
Wojciech Litewka 6fadc51856 [tree generator] Minor: pass model inside ImplementationConfigurator
Needed for config across many elements in subsequent commits.

^KT-65773 In Progress
2024-02-28 09:29:56 +00:00
Wojciech Litewka e737320d01 [FIR generator] Specify Field.isChild in base tree configuration
instead of inside implementation configuration.

Whether a field is a child element is a core concept of the tree,
not a matter of particular implementation class.

It is especially visible in IR tree, where the base classes implement the
acceptChildren method. It will also be more relevant in the future.

This also aligns the config style between IR and FIR tree generators.

^KT-65773 In Progress
2024-02-28 09:29:56 +00:00
Marco Pennekamp 708ed81eb2 [Test] Avoid importing unused @Nested annotations in generated tests
- Unused `Nested` imports frequently cause unused import warnings in the
  IDE, which are especially annoying in after-commit warning/error
  analysis.
2024-02-27 20:30:06 +00:00
Artem Olkov e4acb396ba Add SIR builder and printer for classes #KT-65905 fixed
Merge-request: KT-MR-14478
Merged-by: Artem Olkov <artem.olkov@jetbrains.com>
2024-02-26 14:30:07 +00:00
Artem Olkov dd9332d9e1 Add kotlin runtime modulemap for swift export as part of kotlin-native dist #KT-65673 fixed
Co-authored-by: Alexander Shabalin <alexander.shabalin@ashabalin.me>

Merge-request: KT-MR-14493
Merged-by: Artem Olkov <artem.olkov@jetbrains.com>
2024-02-26 12:51:57 +00:00
Andrey Yastrebov 28a305a826 KT-65928 Worker API for Swift Export 2024-02-26 12:44:22 +00:00
Andrey Yastrebov 9d30fb1b1c KT-65741 Fix SIR visitor parameter name & fix typo 2024-02-22 18:46:01 +00:00
Yahor Berdnikau 6b19b8b9d0 [Repo] Don't use kotlinOptions in repo build scripts
^KT-63419 In Progress
2024-02-22 14:48:10 +00:00
Andrey Yastrebov 60071cbb54 KT-65740 Create swift-export-embeddable module 2024-02-19 10:55:55 +00:00
Dmitriy Novozhilov acf2296590 [Test] Regenerate tests after two previous commits 2024-02-16 12:48:24 +00:00
Artem Olkov 16b985b36e Support for Unsigned Types in swift export #KT-65668 fixed
Merge-request: KT-MR-14300
Merged-by: Artem Olkov <artem.olkov@jetbrains.com>
2024-02-14 11:10:51 +00:00
Artem Olkov 6cd2a5932a Fix generation of KtBridges, now it is using actual C Function Name
Merge-request: KT-MR-14337
Merged-by: Artem Olkov <artem.olkov@jetbrains.com>
2024-02-13 08:03:33 +00:00
Sergey Bogolepov 300369000f [KT-65126] Fix visibility of enums according to failing tests 2024-02-10 14:31:42 +00:00
Artem Olkov b6c805bbb6 Remove KotlinSirOrigin hierarchy in favour of direct AA usage #KT-65335 Fixed
Merge-request: KT-MR-14229
Merged-by: Artem Olkov <artem.olkov@jetbrains.com>
2024-02-09 18:34:52 +00:00
Sergey Bogolepov 6ecc612363 [Swift export][KT-65672] Fix test data to include imports 2024-02-09 10:15:50 +00:00
Sergey Bogolepov 996f47502c [Swift export][KT-65672] Print import declarations 2024-02-09 10:15:50 +00:00
Sergey Bogolepov 168e4414a1 [Swift export][KT-65672] Import bridges module in the generated one 2024-02-09 10:15:50 +00:00
Sergey Bogolepov 10e4d34868 [Swift export][KT-65672] Add SIR node for import declaration 2024-02-09 10:15:50 +00:00
Sergey Bogolepov f5b273a6d9 [Swift export][KT-65672] Update SwiftExportRunner
1. Add a trivial logger interface as a way to communicate with environment
2. Add a settings key for bridge module name.
2024-02-09 10:15:50 +00:00
Gleb Lukianets f262247b2b [Swift Export] KT-65008: support simple top-level properties
Merge-request: KT-MR-14131
Merged-by: Gleb Lukianets <Gleb.Lukianets@jetbrains.com>
2024-02-05 16:29:37 +00:00
Artem Olkov b317a88536 add Initial support for comments in SIR #KT-65174 Fixed
Merge-request: KT-MR-14007
Merged-by: Artem Olkov <artem.olkov@jetbrains.com>
2024-01-29 14:22:42 +00:00
Artem Olkov de6a27aeeb KT-65123: move Swift Export Compiler Plugin into swift-export-standalone module
Merge-request: KT-MR-14031
Merged-by: Artem Olkov <artem.olkov@jetbrains.com>
2024-01-29 10:32:09 +00:00
Artem Olkov 37a8723a79 KT-64931: add convertion of kotlin top-lvl functions into swift static functions
Merge-request: KT-MR-13878
Merged-by: Artem Olkov <artem.olkov@jetbrains.com>
2024-01-17 20:30:04 +00:00
Sergey Bogolepov 591e98a947 [KT-63275] Generate wrapper bodies in the SwiftExportExtension 2024-01-12 15:06:18 +00:00
Sergey Bogolepov cb19e291a3 [KT-63275] Implement trivial bodies in SIR functions 2024-01-12 15:06:18 +00:00
Sergey Bogolepov 5dd1d7c9c1 [KT-63275] Add a nullable body property to SIR functions 2024-01-12 15:06:18 +00:00
Sergey Bogolepov d54877be87 [KT-63275] Prepare SirAsSwiftSourcesPrinter for non-empty bodies 2024-01-12 15:06:18 +00:00
Dmitrii Gridin d828a646cf [Analysis API] move allKtFiles util from LL FIR module
^KT-64805
2024-01-10 22:07:03 +00:00
Dmitrii Gridin b6d373d8e5 Update copyright to 2024 2024-01-05 13:43:17 +00:00
cristiangarcia 5a1fb78fcd Declare generated SourceSets correctly
Allow Gradle to keep the track of the task generating the sources
KTI-1502 Fixed
2023-12-24 00:01:59 +00:00
Sergey Bogolepov 00caf0f1e1 [Swift Export] Check SIR validity in pass tests 2023-12-14 12:38:12 +00:00
Sergey Bogolepov 9fde7e0d35 [Swift Export] Create infrastructure for SIR validation 2023-12-14 12:38:12 +00:00
Sergey Bogolepov 01976990e8 [Swift Export] Use ExportedBridge instead of ExportForCppRuntime
ExportedBridge annotation actually does what we need in Swift Export.
Unlike ExportForCppRuntime, it prevents symbol from DCE.
2023-12-13 14:09:58 +00:00
Artem Olkov 5fcdd4a9f6 KT-63748: Pack Swift Export Frontend into compiler plugin
Co-authored-by: Sergej Jaskiewicz <jaskiewiczs@icloud.com>


Merge-request: KT-MR-13351
Merged-by: Artem Olkov <artem.olkov@jetbrains.com>
2023-12-13 10:40:38 +00:00
Sergej Jaskiewicz f844a86057 [utils] Introduce the bind function and use it throughout 2023-12-13 10:04:45 +00:00
Gleb Lukianets 64ebec7955 [Swift Export]: KT-63280: Package inflation
Merge-request: KT-MR-13331
Merged-by: Gleb Lukianets <Gleb.Lukianets@jetbrains.com>
2023-12-12 16:05:22 +00:00
Sergej Jaskiewicz dada4a60bd [SIR] Use shorter parameter names for some elements in visitor methods 2023-12-12 14:27:57 +00:00