diff --git a/client/ios/Core/Base/ArrayBuilder.swift b/client/ios/Core/Base/ArrayBuilder.swift deleted file mode 100644 index bc8da8dc5..000000000 --- a/client/ios/Core/Base/ArrayBuilder.swift +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2022 Yandex LLC. All rights reserved. - -import Foundation - -@resultBuilder -public enum ArrayBuilder { - public typealias Component = [Element] - public typealias Expression = Element - - public static func buildExpression(_ element: Expression) -> Component { - [element] - } - - public static func buildExpression(_ element: Expression?) -> Component { - element.map { [$0] } ?? [] - } - - public static func buildOptional(_ component: Component?) -> Component { - component ?? [] - } - - public static func buildEither(first component: Component) -> Component { - component - } - - public static func buildEither(second component: Component) -> Component { - component - } - - public static func buildArray(_ components: [Component]) -> Component { - Array(components.joined()) - } - - public static func buildBlock(_ components: Component...) -> Component { - Array(components.joined()) - } -} - -extension Array { - public static func build( - @ArrayBuilder _ builder: () -> [Element] - ) -> [Element] { - builder() - } -} diff --git a/client/ios/Core/CommonCore/Exported.swift b/client/ios/Core/CommonCore/Exported.swift index a2e2aa2b7..a9e8dd76b 100644 --- a/client/ios/Core/CommonCore/Exported.swift +++ b/client/ios/Core/CommonCore/Exported.swift @@ -1,4 +1,3 @@ // Copyright 2021 Yandex LLC. All rights reserved. @_exported import Base -@_exported import CommonCoreTiny diff --git a/client/ios/Core/CommonCore/Theme.swift b/client/ios/Core/CommonCore/Theme.swift index f4d3657ac..41b0a9deb 100644 --- a/client/ios/Core/CommonCore/Theme.swift +++ b/client/ios/Core/CommonCore/Theme.swift @@ -1,7 +1,7 @@ // Copyright 2021 Yandex LLC. All rights reserved. +import BaseTiny import BaseUI -import CommonCoreTiny public enum Theme: String { case dark diff --git a/client/ios/Core/CommonCoreTiny/Exports.swift b/client/ios/Core/CommonCoreTiny/Exports.swift deleted file mode 100644 index 996528e01..000000000 --- a/client/ios/Core/CommonCoreTiny/Exports.swift +++ /dev/null @@ -1,3 +0,0 @@ -// Copyright 2022 Yandex LLC. All rights reserved. - -@_exported import BaseTiny diff --git a/client/ios/Core/copy.sh b/client/ios/Core/copy.sh index 4406c3eb3..937f37dff 100755 --- a/client/ios/Core/copy.sh +++ b/client/ios/Core/copy.sh @@ -94,7 +94,6 @@ cp $1/src/base/ios/yandex/thick_ui/uikit/ImageExtensions.swift Base cp $1/src/base/ios/yandex/thick_ui/uikit/UIScrollView+Extensions.swift Base cp $1/src/base/ios/yandex/thick_ui/uikit/UIViewExtensions.swift Base cp $1/src/base/ios/yandex/thick_ui/iOS.swift Base -cp $1/src/base/ios/yandex/tiny/extensions/ArrayBuilder.swift Base cp $1/src/base/ios/yandex/BaseExports.swift Base cp $1/src/base/ios/yandex/InvalidArgumentError.swift Base cp $1/src/base/ios/yandex/RWLock.swift Base @@ -145,9 +144,6 @@ cp $1/src/yandex/ios/search_app/CommonCore/CommonCore/NativeHTMLParser/HTMLTag.s cp $1/src/yandex/ios/search_app/CommonCore/CommonCore/NativeHTMLParser/HTMLTaggedString.swift CommonCore cp $1/src/yandex/ios/search_app/CommonCore/CommonCore/Exported.swift CommonCore -rm CommonCoreTiny/*.* -cp $1/src/yandex/ios/search_app/CommonCore/CommonCoreTiny/Exports.swift CommonCoreTiny - rm Networking/*.* cp $1/src/yandex/ios/search_app/CommonCore/Networking/ActiveRequestsTracker.swift Networking cp $1/src/yandex/ios/search_app/CommonCore/Networking/AsyncResourceRequester.swift Networking diff --git a/client/ios/DivKit.xcodeproj/project.pbxproj b/client/ios/DivKit.xcodeproj/project.pbxproj index 2dabac2bf..be0f3b0dd 100644 --- a/client/ios/DivKit.xcodeproj/project.pbxproj +++ b/client/ios/DivKit.xcodeproj/project.pbxproj @@ -9,6 +9,11 @@ /* Begin PBXBuildFile section */ 0A9A9AA028CB1A9200D1D810 /* Lottie in Frameworks */ = {isa = PBXBuildFile; productRef = 0A9A9A9F28CB1A9200D1D810 /* Lottie */; }; 0AB4193E28BCF61D00FDAAD5 /* LottieAnimationFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AB4193D28BCF61D00FDAAD5 /* LottieAnimationFactory.swift */; }; + 6178F76B28E2095100FE1648 /* LayoutKit in Frameworks */ = {isa = PBXBuildFile; productRef = 6178F74E28E2095100FE1648 /* LayoutKit */; }; + 6178F77128E2097A00FE1648 /* TabInterimItemExtensionsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6178F74728E2042200FE1648 /* TabInterimItemExtensionsTests.swift */; }; + 6178F77228E2097A00FE1648 /* Array+UIViewRenderableTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6178F74028E2042200FE1648 /* Array+UIViewRenderableTests.swift */; }; + 6178F77328E2097A00FE1648 /* UIViewRenderable+AccessibilityTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6178F74128E2042200FE1648 /* UIViewRenderable+AccessibilityTests.swift */; }; + 6178F77428E2097A00FE1648 /* TabListSelectionDataSourceImplTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6178F74428E2042200FE1648 /* TabListSelectionDataSourceImplTests.swift */; }; 89D02B1428C891890041EC18 /* RadioButtonsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89D02B1328C891890041EC18 /* RadioButtonsView.swift */; }; 89D02B1A28C8EBC40041EC18 /* Palette.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89D02B1928C8EBC40041EC18 /* Palette.swift */; }; 8C0149982873297900BA5402 /* DivKit in Frameworks */ = {isa = PBXBuildFile; productRef = 8C0149972873297900BA5402 /* DivKit */; }; @@ -226,6 +231,11 @@ /* Begin PBXFileReference section */ 0AB4193D28BCF61D00FDAAD5 /* LottieAnimationFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LottieAnimationFactory.swift; sourceTree = ""; }; + 6178F74028E2042200FE1648 /* Array+UIViewRenderableTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Array+UIViewRenderableTests.swift"; sourceTree = ""; }; + 6178F74128E2042200FE1648 /* UIViewRenderable+AccessibilityTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIViewRenderable+AccessibilityTests.swift"; sourceTree = ""; }; + 6178F74428E2042200FE1648 /* TabListSelectionDataSourceImplTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TabListSelectionDataSourceImplTests.swift; sourceTree = ""; }; + 6178F74728E2042200FE1648 /* TabInterimItemExtensionsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TabInterimItemExtensionsTests.swift; sourceTree = ""; }; + 6178F77028E2095100FE1648 /* LayoutKit_iOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LayoutKit_iOSTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 89D02B1328C891890041EC18 /* RadioButtonsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RadioButtonsView.swift; sourceTree = ""; }; 89D02B1928C8EBC40041EC18 /* Palette.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Palette.swift; sourceTree = ""; }; 8C01499B287329D000BA5402 /* unit_test_data */ = {isa = PBXFileReference; lastKnownFileType = folder; name = unit_test_data; path = ../../../test_data/unit_test_data; sourceTree = ""; }; @@ -431,6 +441,14 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + 6178F76A28E2095100FE1648 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 6178F76B28E2095100FE1648 /* LayoutKit in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 8C1CF631286B58810016D0A1 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -493,6 +511,66 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 6178F73D28E2042200FE1648 /* LayoutKit_iOSTests */ = { + isa = PBXGroup; + children = ( + 6178F73E28E2042200FE1648 /* UI */, + 6178F74528E2042200FE1648 /* ViewModels */, + ); + name = LayoutKit_iOSTests; + path = LayoutKit/LayoutKit_iOSTests; + sourceTree = ""; + }; + 6178F73E28E2042200FE1648 /* UI */ = { + isa = PBXGroup; + children = ( + 6178F73F28E2042200FE1648 /* Blocks */, + 6178F74228E2042200FE1648 /* Views */, + ); + path = UI; + sourceTree = ""; + }; + 6178F73F28E2042200FE1648 /* Blocks */ = { + isa = PBXGroup; + children = ( + 6178F74028E2042200FE1648 /* Array+UIViewRenderableTests.swift */, + 6178F74128E2042200FE1648 /* UIViewRenderable+AccessibilityTests.swift */, + ); + path = Blocks; + sourceTree = ""; + }; + 6178F74228E2042200FE1648 /* Views */ = { + isa = PBXGroup; + children = ( + 6178F74328E2042200FE1648 /* TabbedPages */, + ); + path = Views; + sourceTree = ""; + }; + 6178F74328E2042200FE1648 /* TabbedPages */ = { + isa = PBXGroup; + children = ( + 6178F74428E2042200FE1648 /* TabListSelectionDataSourceImplTests.swift */, + ); + path = TabbedPages; + sourceTree = ""; + }; + 6178F74528E2042200FE1648 /* ViewModels */ = { + isa = PBXGroup; + children = ( + 6178F74628E2042200FE1648 /* TabbedPages */, + ); + path = ViewModels; + sourceTree = ""; + }; + 6178F74628E2042200FE1648 /* TabbedPages */ = { + isa = PBXGroup; + children = ( + 6178F74728E2042200FE1648 /* TabInterimItemExtensionsTests.swift */, + ); + path = TabbedPages; + sourceTree = ""; + }; 8C0E7384288AED99009BEB3C /* Fonts */ = { isa = PBXGroup; children = ( @@ -634,6 +712,7 @@ 8C9284C5288ACCBA00BEA1FA /* DivKitSnapshotTests.xctest */, 8C9284F7288ADEEA00BEA1FA /* SnapshotTestsHostApp.app */, 8C6E40B128AAA47B0038E107 /* LayoutKitSnapshotTests.xctest */, + 6178F77028E2095100FE1648 /* LayoutKit_iOSTests.xctest */, ); name = Products; sourceTree = ""; @@ -905,6 +984,7 @@ 8C7B1B1B2865BFF10036EF4C /* DivKitTests */, 8C6E40B228AAA47B0038E107 /* LayoutKitSnapshotTests */, 8CF329252875D534003F799A /* LayoutKitTests */, + 6178F73D28E2042200FE1648 /* LayoutKit_iOSTests */, 8C9284F8288ADEEA00BEA1FA /* SnapshotTestsHostApp */, 8C1CF635286B58810016D0A1 /* TemplatesSupportTests */, 8C7B1B112865BF4C0036EF4C /* Frameworks */, @@ -922,7 +1002,8 @@ 8CF3295F2875D5D6003F799A /* ViewModels */, 8CF32B7D2875E12F003F799A /* Utils.swift */, ); - path = LayoutKitTests; + name = LayoutKitTests; + path = LayoutKit/LayoutKitTests; sourceTree = ""; }; 8CF329312875D5C8003F799A /* UI */ = { @@ -1013,6 +1094,27 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ + 6178F74C28E2095100FE1648 /* LayoutKit_iOSTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 6178F76D28E2095100FE1648 /* Build configuration list for PBXNativeTarget "LayoutKit_iOSTests" */; + buildPhases = ( + 6178F74F28E2095100FE1648 /* Sources */, + 6178F76A28E2095100FE1648 /* Frameworks */, + 6178F76C28E2095100FE1648 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 6178F74D28E2095100FE1648 /* PBXTargetDependency */, + ); + name = LayoutKit_iOSTests; + packageProductDependencies = ( + 6178F74E28E2095100FE1648 /* LayoutKit */, + ); + productName = LayoutKitTests; + productReference = 6178F77028E2095100FE1648 /* LayoutKit_iOSTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; 8C1CF633286B58810016D0A1 /* TemplatesSupportTests */ = { isa = PBXNativeTarget; buildConfigurationList = 8C1CF638286B58810016D0A1 /* Build configuration list for PBXNativeTarget "TemplatesSupportTests" */; @@ -1227,6 +1329,7 @@ 8C7B1B192865BFF10036EF4C /* DivKitTests */, 8C6E40B028AAA47B0038E107 /* LayoutKitSnapshotTests */, 8CF329232875D534003F799A /* LayoutKitTests */, + 6178F74C28E2095100FE1648 /* LayoutKit_iOSTests */, 8C9284F6288ADEEA00BEA1FA /* SnapshotTestsHostApp */, 8C1CF633286B58810016D0A1 /* TemplatesSupportTests */, ); @@ -1234,6 +1337,13 @@ /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ + 6178F76C28E2095100FE1648 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 8C1CF632286B58810016D0A1 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -1311,6 +1421,17 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ + 6178F74F28E2095100FE1648 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6178F77228E2097A00FE1648 /* Array+UIViewRenderableTests.swift in Sources */, + 6178F77428E2097A00FE1648 /* TabListSelectionDataSourceImplTests.swift in Sources */, + 6178F77128E2097A00FE1648 /* TabInterimItemExtensionsTests.swift in Sources */, + 6178F77328E2097A00FE1648 /* UIViewRenderable+AccessibilityTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 8C1CF630286B58810016D0A1 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -1526,6 +1647,10 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ + 6178F74D28E2095100FE1648 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + productRef = 8CF3296D2875D645003F799A /* LayoutKit */; + }; 8C0149902873296000BA5402 /* PBXTargetDependency */ = { isa = PBXTargetDependency; productRef = 8C01498F2873296000BA5402 /* DivKit */; @@ -1575,6 +1700,26 @@ /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ + 6178F76E28E2095100FE1648 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 8C87CF1B28AD059600D262E1 /* Debug.xcconfig */; + buildSettings = { + PRODUCT_BUNDLE_IDENTIFIER = tech.divkit.LayoutKitTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 6178F76F28E2095100FE1648 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 8C87CF1C28AD05AB00D262E1 /* Release.xcconfig */; + buildSettings = { + PRODUCT_BUNDLE_IDENTIFIER = tech.divkit.LayoutKitTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + }; + name = Release; + }; 8C1CF639286B58810016D0A1 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 8C87CF1B28AD059600D262E1 /* Debug.xcconfig */; @@ -1816,6 +1961,15 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + 6178F76D28E2095100FE1648 /* Build configuration list for PBXNativeTarget "LayoutKit_iOSTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6178F76E28E2095100FE1648 /* Debug */, + 6178F76F28E2095100FE1648 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; 8C1CF638286B58810016D0A1 /* Build configuration list for PBXNativeTarget "TemplatesSupportTests" */ = { isa = XCConfigurationList; buildConfigurations = ( @@ -1907,6 +2061,10 @@ package = 0A9A9A9E28CB1A9200D1D810 /* XCRemoteSwiftPackageReference "lottie-ios" */; productName = Lottie; }; + 6178F74E28E2095100FE1648 /* LayoutKit */ = { + isa = XCSwiftPackageProductDependency; + productName = LayoutKit; + }; 8C01498F2873296000BA5402 /* DivKit */ = { isa = XCSwiftPackageProductDependency; productName = DivKit; diff --git a/client/ios/DivKit.xcodeproj/xcshareddata/xcschemes/LayoutKit_iOSTests.xcscheme b/client/ios/DivKit.xcodeproj/xcshareddata/xcschemes/LayoutKit_iOSTests.xcscheme new file mode 100644 index 000000000..7cf506d50 --- /dev/null +++ b/client/ios/DivKit.xcodeproj/xcshareddata/xcschemes/LayoutKit_iOSTests.xcscheme @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/client/ios/DivKit.xcodeproj/xcshareddata/xcschemes/UnitTests.xcscheme b/client/ios/DivKit.xcodeproj/xcshareddata/xcschemes/UnitTests.xcscheme index 95bd0f6c8..a7e62170a 100644 --- a/client/ios/DivKit.xcodeproj/xcshareddata/xcschemes/UnitTests.xcscheme +++ b/client/ios/DivKit.xcodeproj/xcshareddata/xcschemes/UnitTests.xcscheme @@ -72,6 +72,16 @@ ReferencedContainer = "container:DivKit.xcodeproj"> + + + +