diff --git a/RoadToSPMModuleNotFound/ObjcPackage/.gitignore b/RoadToSPMModuleNotFound/ObjcPackage/.gitignore new file mode 100644 index 0000000..bb460e7 --- /dev/null +++ b/RoadToSPMModuleNotFound/ObjcPackage/.gitignore @@ -0,0 +1,7 @@ +.DS_Store +/.build +/Packages +/*.xcodeproj +xcuserdata/ +DerivedData/ +.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata diff --git a/RoadToSPMModuleNotFound/ObjcPackage/Package.swift b/RoadToSPMModuleNotFound/ObjcPackage/Package.swift new file mode 100644 index 0000000..168f88e --- /dev/null +++ b/RoadToSPMModuleNotFound/ObjcPackage/Package.swift @@ -0,0 +1,29 @@ +// swift-tools-version:5.5 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "ObjcPackage", + products: [ + // Products define the executables and libraries a package produces, and make them visible to other packages. + .library( + name: "ObjcPackage", + type: .dynamic, + targets: ["ObjcPackage"]), + ], + dependencies: [ + // Dependencies declare other packages that this package depends on. + // .package(url: /* package url */, from: "1.0.0"), + ], + targets: [ + // Targets are the basic building blocks of a package. A target can define a module or a test suite. + // Targets can depend on other targets in this package, and on products in packages this package depends on. + .target( + name: "ObjcPackage", + dependencies: []), + .testTarget( + name: "ObjcPackageTests", + dependencies: ["ObjcPackage"]), + ] +) diff --git a/RoadToSPMModuleNotFound/ObjcPackage/README.md b/RoadToSPMModuleNotFound/ObjcPackage/README.md new file mode 100644 index 0000000..eebe818 --- /dev/null +++ b/RoadToSPMModuleNotFound/ObjcPackage/README.md @@ -0,0 +1,3 @@ +# ObjcPackage + +A description of this package. diff --git a/RoadToSPMModuleNotFound/ObjcPackage/Sources/ObjcPackage/ObjcPackageClass.m b/RoadToSPMModuleNotFound/ObjcPackage/Sources/ObjcPackage/ObjcPackageClass.m new file mode 100644 index 0000000..53264c9 --- /dev/null +++ b/RoadToSPMModuleNotFound/ObjcPackage/Sources/ObjcPackage/ObjcPackageClass.m @@ -0,0 +1,17 @@ +// +// ObjcPackageClass.m +// +// +// Created by Вильян Яумбаев on 30.06.2022. +// + +#import +#import "ObjcPackageClass.h" + +@implementation ObjcPackageClass + +-(void) doStuff { + [self.array addObject:self]; +} + +@end diff --git a/RoadToSPMModuleNotFound/ObjcPackage/Sources/ObjcPackage/include/ObjcPackageClass.h b/RoadToSPMModuleNotFound/ObjcPackage/Sources/ObjcPackage/include/ObjcPackageClass.h new file mode 100644 index 0000000..018ee5e --- /dev/null +++ b/RoadToSPMModuleNotFound/ObjcPackage/Sources/ObjcPackage/include/ObjcPackageClass.h @@ -0,0 +1,14 @@ +// +// ObjcPackageClass.h +// +// +// Created by Вильян Яумбаев on 30.06.2022. +// + +#import + +@interface ObjcPackageClass : NSObject + +@property NSMutableArray *array; + +@end diff --git a/RoadToSPMModuleNotFound/ObjcPackage/Sources/ObjcPackage/include/module.modulemap b/RoadToSPMModuleNotFound/ObjcPackage/Sources/ObjcPackage/include/module.modulemap new file mode 100644 index 0000000..1fa0b08 --- /dev/null +++ b/RoadToSPMModuleNotFound/ObjcPackage/Sources/ObjcPackage/include/module.modulemap @@ -0,0 +1,3 @@ +module ObjcPackage { + header "ObjcPackageClass.h" +} diff --git a/RoadToSPMModuleNotFound/ObjcPackage/Tests/ObjcPackageTests/ObjcPackageTests.swift b/RoadToSPMModuleNotFound/ObjcPackage/Tests/ObjcPackageTests/ObjcPackageTests.swift new file mode 100644 index 0000000..a9f9b92 --- /dev/null +++ b/RoadToSPMModuleNotFound/ObjcPackage/Tests/ObjcPackageTests/ObjcPackageTests.swift @@ -0,0 +1,11 @@ +import XCTest +@testable import ObjcPackage + +final class ObjcPackageTests: XCTestCase { + func testExample() throws { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct + // results. + XCTAssertEqual(ObjcPackage().text, "Hello, World!") + } +} diff --git a/RoadToSPMModuleNotFound/RoadToSPMModuleNotFound.xcodeproj/project.pbxproj b/RoadToSPMModuleNotFound/RoadToSPMModuleNotFound.xcodeproj/project.pbxproj index d4970a3..f05ab88 100644 --- a/RoadToSPMModuleNotFound/RoadToSPMModuleNotFound.xcodeproj/project.pbxproj +++ b/RoadToSPMModuleNotFound/RoadToSPMModuleNotFound.xcodeproj/project.pbxproj @@ -18,8 +18,21 @@ 25795C73286DD0B700AB1C29 /* ModuleB.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 25795C71286DD0B700AB1C29 /* ModuleB.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 25795C75286DD0DD00AB1C29 /* ModuleA in Embed Frameworks */ = {isa = PBXBuildFile; productRef = 25795C6F286DD0B400AB1C29 /* ModuleA */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 25795C7B286DD4D000AB1C29 /* Test.m in Sources */ = {isa = PBXBuildFile; fileRef = 25795C7A286DD4D000AB1C29 /* Test.m */; }; + 25795C89286DDBCA00AB1C29 /* RoadToSPMModuleNotFoundTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 25795C88286DDBCA00AB1C29 /* RoadToSPMModuleNotFoundTests.swift */; }; + 25795C90286DE14800AB1C29 /* ObjcPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 25795C8F286DE14800AB1C29 /* ObjcPackage */; }; + 25795C91286DE14800AB1C29 /* ObjcPackage in Embed Frameworks */ = {isa = PBXBuildFile; productRef = 25795C8F286DE14800AB1C29 /* ObjcPackage */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; /* End PBXBuildFile section */ +/* Begin PBXContainerItemProxy section */ + 25795C8A286DDBCA00AB1C29 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 25795C38286DD01600AB1C29 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 25795C3F286DD01600AB1C29; + remoteInfo = RoadToSPMModuleNotFound; + }; +/* End PBXContainerItemProxy section */ + /* Begin PBXCopyFilesBuildPhase section */ 25795C74286DD0B800AB1C29 /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; @@ -28,6 +41,7 @@ dstSubfolderSpec = 10; files = ( 25795C75286DD0DD00AB1C29 /* ModuleA in Embed Frameworks */, + 25795C91286DE14800AB1C29 /* ObjcPackage in Embed Frameworks */, 25795C73286DD0B700AB1C29 /* ModuleB.framework in Embed Frameworks */, ); name = "Embed Frameworks"; @@ -48,6 +62,8 @@ 25795C78286DD4BE00AB1C29 /* Test.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Test.h; sourceTree = ""; }; 25795C79286DD4D000AB1C29 /* RoadToSPMModuleNotFound-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "RoadToSPMModuleNotFound-Bridging-Header.h"; sourceTree = ""; }; 25795C7A286DD4D000AB1C29 /* Test.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Test.m; sourceTree = ""; }; + 25795C86286DDBCA00AB1C29 /* RoadToSPMModuleNotFoundTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RoadToSPMModuleNotFoundTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 25795C88286DDBCA00AB1C29 /* RoadToSPMModuleNotFoundTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoadToSPMModuleNotFoundTests.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -56,10 +72,18 @@ buildActionMask = 2147483647; files = ( 25795C70286DD0B400AB1C29 /* ModuleA in Frameworks */, + 25795C90286DE14800AB1C29 /* ObjcPackage in Frameworks */, 25795C72286DD0B700AB1C29 /* ModuleB.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; + 25795C83286DDBCA00AB1C29 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -67,6 +91,7 @@ isa = PBXGroup; children = ( 25795C42286DD01600AB1C29 /* RoadToSPMModuleNotFound */, + 25795C87286DDBCA00AB1C29 /* RoadToSPMModuleNotFoundTests */, 25795C41286DD01600AB1C29 /* Products */, 25795C6E286DD0B400AB1C29 /* Frameworks */, ); @@ -76,6 +101,7 @@ isa = PBXGroup; children = ( 25795C40286DD01600AB1C29 /* RoadToSPMModuleNotFound.app */, + 25795C86286DDBCA00AB1C29 /* RoadToSPMModuleNotFoundTests.xctest */, ); name = Products; sourceTree = ""; @@ -105,6 +131,14 @@ name = Frameworks; sourceTree = ""; }; + 25795C87286DDBCA00AB1C29 /* RoadToSPMModuleNotFoundTests */ = { + isa = PBXGroup; + children = ( + 25795C88286DDBCA00AB1C29 /* RoadToSPMModuleNotFoundTests.swift */, + ); + path = RoadToSPMModuleNotFoundTests; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -124,11 +158,30 @@ name = RoadToSPMModuleNotFound; packageProductDependencies = ( 25795C6F286DD0B400AB1C29 /* ModuleA */, + 25795C8F286DE14800AB1C29 /* ObjcPackage */, ); productName = RoadToSPMModuleNotFound; productReference = 25795C40286DD01600AB1C29 /* RoadToSPMModuleNotFound.app */; productType = "com.apple.product-type.application"; }; + 25795C85286DDBCA00AB1C29 /* RoadToSPMModuleNotFoundTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 25795C8C286DDBCA00AB1C29 /* Build configuration list for PBXNativeTarget "RoadToSPMModuleNotFoundTests" */; + buildPhases = ( + 25795C82286DDBCA00AB1C29 /* Sources */, + 25795C83286DDBCA00AB1C29 /* Frameworks */, + 25795C84286DDBCA00AB1C29 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 25795C8B286DDBCA00AB1C29 /* PBXTargetDependency */, + ); + name = RoadToSPMModuleNotFoundTests; + productName = RoadToSPMModuleNotFoundTests; + productReference = 25795C86286DDBCA00AB1C29 /* RoadToSPMModuleNotFoundTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -143,6 +196,10 @@ CreatedOnToolsVersion = 13.2.1; LastSwiftMigration = 1320; }; + 25795C85286DDBCA00AB1C29 = { + CreatedOnToolsVersion = 13.2.1; + TestTargetID = 25795C3F286DD01600AB1C29; + }; }; }; buildConfigurationList = 25795C3B286DD01600AB1C29 /* Build configuration list for PBXProject "RoadToSPMModuleNotFound" */; @@ -159,6 +216,7 @@ projectRoot = ""; targets = ( 25795C3F286DD01600AB1C29 /* RoadToSPMModuleNotFound */, + 25795C85286DDBCA00AB1C29 /* RoadToSPMModuleNotFoundTests */, ); }; /* End PBXProject section */ @@ -174,6 +232,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 25795C84286DDBCA00AB1C29 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -188,8 +253,24 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 25795C82286DDBCA00AB1C29 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 25795C89286DDBCA00AB1C29 /* RoadToSPMModuleNotFoundTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ +/* Begin PBXTargetDependency section */ + 25795C8B286DDBCA00AB1C29 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 25795C3F286DD01600AB1C29 /* RoadToSPMModuleNotFound */; + targetProxy = 25795C8A286DDBCA00AB1C29 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + /* Begin PBXVariantGroup section */ 25795C49286DD01600AB1C29 /* Main.storyboard */ = { isa = PBXVariantGroup; @@ -385,6 +466,40 @@ }; name = Release; }; + 25795C8D286DDBCA00AB1C29 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = ru.roadToSPM.RoadToSPMModuleNotFoundTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/RoadToSPMModuleNotFound.app/RoadToSPMModuleNotFound"; + }; + name = Debug; + }; + 25795C8E286DDBCA00AB1C29 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = ru.roadToSPM.RoadToSPMModuleNotFoundTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/RoadToSPMModuleNotFound.app/RoadToSPMModuleNotFound"; + }; + name = Release; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -406,6 +521,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + 25795C8C286DDBCA00AB1C29 /* Build configuration list for PBXNativeTarget "RoadToSPMModuleNotFoundTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 25795C8D286DDBCA00AB1C29 /* Debug */, + 25795C8E286DDBCA00AB1C29 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; /* End XCConfigurationList section */ /* Begin XCSwiftPackageProductDependency section */ @@ -413,6 +537,10 @@ isa = XCSwiftPackageProductDependency; productName = ModuleA; }; + 25795C8F286DE14800AB1C29 /* ObjcPackage */ = { + isa = XCSwiftPackageProductDependency; + productName = ObjcPackage; + }; /* End XCSwiftPackageProductDependency section */ }; rootObject = 25795C38286DD01600AB1C29 /* Project object */; diff --git a/RoadToSPMModuleNotFound/RoadToSPMModuleNotFound.xcodeproj/xcshareddata/xcschemes/RoadToSPMModuleNotFound.xcscheme b/RoadToSPMModuleNotFound/RoadToSPMModuleNotFound.xcodeproj/xcshareddata/xcschemes/RoadToSPMModuleNotFound.xcscheme new file mode 100644 index 0000000..b2fdeee --- /dev/null +++ b/RoadToSPMModuleNotFound/RoadToSPMModuleNotFound.xcodeproj/xcshareddata/xcschemes/RoadToSPMModuleNotFound.xcscheme @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/RoadToSPMModuleNotFound/RoadToSPMModuleNotFound.xcworkspace/contents.xcworkspacedata b/RoadToSPMModuleNotFound/RoadToSPMModuleNotFound.xcworkspace/contents.xcworkspacedata index f73471a..74c255e 100644 --- a/RoadToSPMModuleNotFound/RoadToSPMModuleNotFound.xcworkspace/contents.xcworkspacedata +++ b/RoadToSPMModuleNotFound/RoadToSPMModuleNotFound.xcworkspace/contents.xcworkspacedata @@ -1,6 +1,9 @@ + + diff --git a/RoadToSPMModuleNotFound/RoadToSPMModuleNotFound/ViewController.swift b/RoadToSPMModuleNotFound/RoadToSPMModuleNotFound/ViewController.swift index 7bf98ec..01e8307 100644 --- a/RoadToSPMModuleNotFound/RoadToSPMModuleNotFound/ViewController.swift +++ b/RoadToSPMModuleNotFound/RoadToSPMModuleNotFound/ViewController.swift @@ -8,6 +8,7 @@ import UIKit import ModuleA import ModuleB +import ObjcPackage class ViewController: UIViewController { @@ -17,6 +18,9 @@ class ViewController: UIViewController { let objc = ObjcClass() objc.swiftContainer.swiftclass.prop = 4 + + let objcPackageClass = ObjcPackageClass() + objcPackageClass.array.add(self) } } diff --git a/RoadToSPMModuleNotFound/RoadToSPMModuleNotFoundTests/RoadToSPMModuleNotFoundTests.swift b/RoadToSPMModuleNotFound/RoadToSPMModuleNotFoundTests/RoadToSPMModuleNotFoundTests.swift new file mode 100644 index 0000000..1b74e7d --- /dev/null +++ b/RoadToSPMModuleNotFound/RoadToSPMModuleNotFoundTests/RoadToSPMModuleNotFoundTests.swift @@ -0,0 +1,35 @@ +// +// RoadToSPMModuleNotFoundTests.swift +// RoadToSPMModuleNotFoundTests +// +// Created by Вильян Яумбаев on 30.06.2022. +// + +import XCTest + +class RoadToSPMModuleNotFoundTests: XCTestCase { + + override func setUpWithError() throws { + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDownWithError() throws { + // Put teardown code here. This method is called after the invocation of each test method in the class. + } + + func testExample() throws { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct results. + // Any test you write for XCTest can be annotated as throws and async. + // Mark your test throws to produce an unexpected failure when your test encounters an uncaught error. + // Mark your test async to allow awaiting for asynchronous code to complete. Check the results with assertions afterwards. + } + + func testPerformanceExample() throws { + // This is an example of a performance test case. + measure { + // Put the code you want to measure the time of here. + } + } + +}