Skip to content

Commit

Permalink
Updating fixtures to include project with remote and local Swift pack…
Browse files Browse the repository at this point in the history
…ages

Note: tests are currently failing
  • Loading branch information
kwridan committed Jun 7, 2019
1 parent bd18e39 commit e920ad4
Show file tree
Hide file tree
Showing 10 changed files with 124 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Fixtures/iOS/MyLocalPackage/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.DS_Store
/.build
/Packages
/*.xcodeproj
28 changes: 28 additions & 0 deletions Fixtures/iOS/MyLocalPackage/Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// swift-tools-version:5.1
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "MyLocalPackage",
products: [
// Products define the executables and libraries produced by a package, and make them visible to other packages.
.library(
name: "MyLocalPackage",
targets: ["MyLocalPackage"]),
],
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 which this package depends on.
.target(
name: "MyLocalPackage",
dependencies: []),
.testTarget(
name: "MyLocalPackageTests",
dependencies: ["MyLocalPackage"]),
]
)
3 changes: 3 additions & 0 deletions Fixtures/iOS/MyLocalPackage/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# MyLocalPackage

A description of this package.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
struct MyLocalPackage {
var text = "Hello, World!"
}
7 changes: 7 additions & 0 deletions Fixtures/iOS/MyLocalPackage/Tests/LinuxMain.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import XCTest

import MyLocalPackageTests

var tests = [XCTestCaseEntry]()
tests += MyLocalPackageTests.allTests()
XCTMain(tests)
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import XCTest
@testable import MyLocalPackage

final class MyLocalPackageTests: XCTestCase {
func testExample() {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct
// results.
XCTAssertEqual(MyLocalPackage().text, "Hello, World!")
}

static var allTests = [
("testExample", testExample),
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import XCTest

#if !canImport(ObjectiveC)
public func allTests() -> [XCTestCaseEntry] {
return [
testCase(MyLocalPackageTests.allTests),
]
}
#endif
38 changes: 37 additions & 1 deletion Fixtures/iOS/Project.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objectVersion = 52;
objects = {

/* Begin PBXBuildFile section */
Expand All @@ -18,6 +18,8 @@
23766C201EAA3484007A9026 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 23766C1E1EAA3484007A9026 /* LaunchScreen.storyboard */; };
23766C2B1EAA3484007A9026 /* iOSTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23766C2A1EAA3484007A9026 /* iOSTests.swift */; };
3CD1EADD205763E400DAEECB /* Model.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 3CD1EADB205763E400DAEECB /* Model.xcdatamodeld */; };
42AA1A1A22AAF48100428760 /* MyLocalPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 42AA1A1922AAF48100428760 /* MyLocalPackage */; };
42AA1A1C22AAF48100428760 /* RxSwift in Frameworks */ = {isa = PBXBuildFile; productRef = 42AA1A1B22AAF48100428760 /* RxSwift */; };
/* End PBXBuildFile section */

/* Begin PBXBuildRule section */
Expand Down Expand Up @@ -69,14 +71,17 @@
23766C2A1EAA3484007A9026 /* iOSTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iOSTests.swift; sourceTree = "<group>"; };
23766C2C1EAA3484007A9026 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
3CD1EADC205763E400DAEECB /* Model.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Model.xcdatamodel; sourceTree = "<group>"; };
42AA1A1822AAF41000428760 /* MyLocalPackage */ = {isa = PBXFileReference; lastKnownFileType = folder; path = MyLocalPackage; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
23766C0F1EAA3484007A9026 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
42AA1A1C22AAF48100428760 /* RxSwift in Frameworks */,
04D5C09F1F153824008A2F98 /* CoreData.framework in Frameworks */,
42AA1A1A22AAF48100428760 /* MyLocalPackage in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -101,6 +106,7 @@
23766C091EAA3484007A9026 = {
isa = PBXGroup;
children = (
42AA1A1822AAF41000428760 /* MyLocalPackage */,
23766C141EAA3484007A9026 /* iOS */,
23766C291EAA3484007A9026 /* iOSTests */,
23766C131EAA3484007A9026 /* Products */,
Expand Down Expand Up @@ -184,6 +190,10 @@
dependencies = (
);
name = iOS;
packageProductDependencies = (
42AA1A1922AAF48100428760 /* MyLocalPackage */,
42AA1A1B22AAF48100428760 /* RxSwift */,
);
productName = iOS;
productReference = 23766C121EAA3484007A9026 /* iOS.app */;
productType = "com.apple.product-type.application";
Expand Down Expand Up @@ -236,6 +246,9 @@
Base,
);
mainGroup = 23766C091EAA3484007A9026;
packageReferences = (
42AA19FF22AAF0D600428760 /* XCRemoteSwiftPackageReference "RxSwift" */,
);
productRefGroup = 23766C131EAA3484007A9026 /* Products */;
projectDirPath = "";
projectRoot = "";
Expand Down Expand Up @@ -511,6 +524,29 @@
};
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
42AA19FF22AAF0D600428760 /* XCRemoteSwiftPackageReference "RxSwift" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/ReactiveX/RxSwift";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 5.0.1;
};
};
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
42AA1A1922AAF48100428760 /* MyLocalPackage */ = {
isa = XCSwiftPackageProductDependency;
productName = MyLocalPackage;
};
42AA1A1B22AAF48100428760 /* RxSwift */ = {
isa = XCSwiftPackageProductDependency;
package = 42AA19FF22AAF0D600428760 /* XCRemoteSwiftPackageReference "RxSwift" */;
productName = RxSwift;
};
/* End XCSwiftPackageProductDependency section */

/* Begin XCVersionGroup section */
3CD1EADB205763E400DAEECB /* Model.xcdatamodeld */ = {
isa = XCVersionGroup;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"object": {
"pins": [
{
"package": "RxSwift",
"repositoryURL": "https://github.com/ReactiveX/RxSwift",
"state": {
"branch": null,
"revision": "b3e888b4972d9bc76495dd74d30a8c7fad4b9395",
"version": "5.0.1"
}
}
]
},
"version": 1
}
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,7 @@ final class PBXProjIntegrationTests: XCTestCase {
XCTAssertEqual(proj.objects.buildRules.count, 1)
XCTAssertEqual(proj.objects.versionGroups.count, 1)
XCTAssertEqual(proj.objects.projects.count, 1)
XCTAssertEqual(proj.objects.swiftPackageProductDependencies.count, 2)
XCTAssertEqual(proj.objects.remoteSwiftPackageReferences.count, 1)
}
}

0 comments on commit e920ad4

Please sign in to comment.