Skip to content

Commit

Permalink
add ObjcPackage and UnitTestTarget and scheme configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Willianlike committed Jun 30, 2022
1 parent b2980c6 commit b8ab172
Show file tree
Hide file tree
Showing 12 changed files with 351 additions and 0 deletions.
7 changes: 7 additions & 0 deletions RoadToSPMModuleNotFound/ObjcPackage/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.DS_Store
/.build
/Packages
/*.xcodeproj
xcuserdata/
DerivedData/
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
29 changes: 29 additions & 0 deletions RoadToSPMModuleNotFound/ObjcPackage/Package.swift
Original file line number Diff line number Diff line change
@@ -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"]),
]
)
3 changes: 3 additions & 0 deletions RoadToSPMModuleNotFound/ObjcPackage/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# ObjcPackage

A description of this package.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// ObjcPackageClass.m
//
//
// Created by Вильян Яумбаев on 30.06.2022.
//

#import <Foundation/Foundation.h>
#import "ObjcPackageClass.h"

@implementation ObjcPackageClass

-(void) doStuff {
[self.array addObject:self];
}

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// ObjcPackageClass.h
//
//
// Created by Вильян Яумбаев on 30.06.2022.
//

#import <Foundation/Foundation.h>

@interface ObjcPackageClass : NSObject

@property NSMutableArray *array;

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module ObjcPackage {
header "ObjcPackageClass.h"
}
Original file line number Diff line number Diff line change
@@ -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!")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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";
Expand All @@ -48,6 +62,8 @@
25795C78286DD4BE00AB1C29 /* Test.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Test.h; sourceTree = "<group>"; };
25795C79286DD4D000AB1C29 /* RoadToSPMModuleNotFound-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "RoadToSPMModuleNotFound-Bridging-Header.h"; sourceTree = "<group>"; };
25795C7A286DD4D000AB1C29 /* Test.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Test.m; sourceTree = "<group>"; };
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 = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -56,17 +72,26 @@
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 */
25795C37286DD01600AB1C29 = {
isa = PBXGroup;
children = (
25795C42286DD01600AB1C29 /* RoadToSPMModuleNotFound */,
25795C87286DDBCA00AB1C29 /* RoadToSPMModuleNotFoundTests */,
25795C41286DD01600AB1C29 /* Products */,
25795C6E286DD0B400AB1C29 /* Frameworks */,
);
Expand All @@ -76,6 +101,7 @@
isa = PBXGroup;
children = (
25795C40286DD01600AB1C29 /* RoadToSPMModuleNotFound.app */,
25795C86286DDBCA00AB1C29 /* RoadToSPMModuleNotFoundTests.xctest */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -105,6 +131,14 @@
name = Frameworks;
sourceTree = "<group>";
};
25795C87286DDBCA00AB1C29 /* RoadToSPMModuleNotFoundTests */ = {
isa = PBXGroup;
children = (
25795C88286DDBCA00AB1C29 /* RoadToSPMModuleNotFoundTests.swift */,
);
path = RoadToSPMModuleNotFoundTests;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand All @@ -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 */
Expand All @@ -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" */;
Expand All @@ -159,6 +216,7 @@
projectRoot = "";
targets = (
25795C3F286DD01600AB1C29 /* RoadToSPMModuleNotFound */,
25795C85286DDBCA00AB1C29 /* RoadToSPMModuleNotFoundTests */,
);
};
/* End PBXProject section */
Expand All @@ -174,6 +232,13 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
25795C84286DDBCA00AB1C29 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
Expand All @@ -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;
Expand Down Expand Up @@ -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 */
Expand All @@ -406,13 +521,26 @@
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 */
25795C6F286DD0B400AB1C29 /* ModuleA */ = {
isa = XCSwiftPackageProductDependency;
productName = ModuleA;
};
25795C8F286DE14800AB1C29 /* ObjcPackage */ = {
isa = XCSwiftPackageProductDependency;
productName = ObjcPackage;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = 25795C38286DD01600AB1C29 /* Project object */;
Expand Down
Loading

0 comments on commit b8ab172

Please sign in to comment.