Skip to content

Commit

Permalink
Cocoapods integration (#91)
Browse files Browse the repository at this point in the history
* feat: crappy XMTPRustSwift usage

* feat: get Rust networking selftest in

* feat: add gRPC selftest

* test: grpc test

* feat: cleaned up Swift package to use local reference, works great

* feat: query using gRPC library works

* fix: refactor a bit but query still works

* feat: with local_test_only_005 branch, publish/query pass

* feat: all tests pass with rustClient

* feat: checkpoint - no more GRPC dependency

* Use remote package

* checkpoint: Getting closer to building, need to fix secp256k1 issues

* wip: commit code calling secp256k1

* wip

* wip

* Bring in the proto types for now

* Make version match XMTPRust

* add swift version

* wip

* Integrate xmtp-rust-swift 0.2.0-beta0 (#97)

* wip: does not build yet, no progress on subscribe needs AsyncIterator

* fix: some tests pass, subscribe still not implemented

* feat: initialize rust client outside of GRPCApiClient

* feat: partial integration of newest Rust<>Swift bindings

* feat: implement polling subscribe

* test: add test for content in testStreamingMessagesFromV2Conversations

* feat: working if you comment out NotificationService logic

* Get tests building again

* Cleanups

* Format

* Ignore pods

* Updates

* Update package.resolved

* Fix lint

* Fix more lint

* update pod

* Bump XMTPRust version

* Get example app building again

* Move everything to cocoapods

* Get rid of cocoapods for the example app

* Try to get XMTP buildable for testing

* Fix test building

* wip: tests seemed to pass

* fix: reset the cocoapod

* fix: tests pass with new paging info changes, removed some printlns, need to address QueryResponse ownership

* fix: upgrade to XMTPRust=0.2.2-beta0 to attempt to fix Package.resolved issue in Xcode cloud

* fix: delete Package.resolved from xcshareddata

* fix: attempt to use Package.resolved from a passing commit

* fix: open Example app and let swift re-resolve

* fix: use package.resolved after running example app successfully

* fix: try to undo changes to XMTP.xcscheme

---------

Co-authored-by: Michael Xu <[email protected]>

* Use Buf to generate proto code (#93)

* fix: remove proto dependency from Package.swift (#101)

* feat: remove proto Package.swift dependency

* fix: try a pod install

* fix: local tests failing due to improper mem copying, .bytes extension not available in pods (#102)

* fix: re-introduce 16.0 restriction

* fix: passes pod lint now

* fix: use exact secp256k1 version

* fix: utilize QueryResponse paging info

* fix: use 0.2.2-beta0 XMTPRust

* feat: prep for 0.2.0-alpha0 test release

* fix: commit updated dependency manifests

* fix: make sure to return cursor information from response

* style: fix indent in the ApiClient.swift file

* test: remove empty no-op gRPC test

* style: fix indents and remove imports

* fix: remove unnecessary Data extension and replace with existing for RustVecs

* test: add a PaginationTest class

* test: need to do unused client initializations to upload contact bundles

* fix: remove unnecessary comment and remaining unneeded Data<>RustVec extensions

* docs: add comment and flush out podspec description

* style: add spaces to example podfile

* test: remove extraneous takesAWallet test

* test: remove unnecessary test lines in TestHelper

* docs: fix comment about empty PublishResponse

* test: fix pagination test race condition with duplicate convos

* fix: attempt to see if xcode cloud works without cocoapods

* fix: attempt to revert example app to main

* fix: updated Package.resolved

* fix: delete unnecessary new schemes that are missing from main

* test: pagination tests should be local node only

---------

Co-authored-by: Michael Xu <[email protected]>
Co-authored-by: Michael Xu <[email protected]>
Co-authored-by: Nicholas Molnar <[email protected]>
Co-authored-by: Nicholas Molnar <[email protected]>
  • Loading branch information
5 people authored May 19, 2023
1 parent a18da1e commit dc2040a
Show file tree
Hide file tree
Showing 85 changed files with 7,713 additions and 322 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
XMTPiOSExample/Pods/
XMTPiOSExample/build

.DS_Store
/.build
/Packages
Expand All @@ -8,5 +11,5 @@ DerivedData/
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
.netrc

Package.resolved
.vscode
XMTPiOSExample/Pods
3 changes: 3 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
excluded:
- Sources/XMTP/Proto

disabled_rules: # rule identifiers turned on by default to exclude from running
- type_name
- identifier_name
Expand Down
14 changes: 12 additions & 2 deletions .swiftpm/xcode/xcshareddata/xcschemes/XMTP.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,24 @@
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
selectedDebuggerIdentifier = ""
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A628198E292DC825004B9117"
BuildableName = "XMTPiOSExample.app"
BlueprintName = "XMTPiOSExample"
ReferencedContainer = "container:XMTPiOSExample/XMTPiOSExample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
158 changes: 158 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
{
"pins" : [
{
"identity" : "bigint",
"kind" : "remoteSourceControl",
"location" : "https://github.com/attaswift/BigInt",
"state" : {
"revision" : "0ed110f7555c34ff468e72e1686e59721f2b0da6",
"version" : "5.3.0"
}
},
{
"identity" : "connect-swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/bufbuild/connect-swift",
"state" : {
"revision" : "6f5afc57f44a3ed15b9a01381ce73f84d15e43db",
"version" : "0.3.0"
}
},
{
"identity" : "generic-json-swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/zoul/generic-json-swift",
"state" : {
"revision" : "0a06575f4038b504e78ac330913d920f1630f510",
"version" : "2.0.2"
}
},
{
"identity" : "gzipswift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/1024jp/GzipSwift",
"state" : {
"revision" : "7a7f17761c76a932662ab77028a4329f67d645a4",
"version" : "5.2.0"
}
},
{
"identity" : "secp256k1.swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/GigaBitcoin/secp256k1.swift.git",
"state" : {
"revision" : "48fb20fce4ca3aad89180448a127d5bc16f0e44c",
"version" : "0.10.0"
}
},
{
"identity" : "swift-atomics",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-atomics.git",
"state" : {
"revision" : "919eb1d83e02121cdb434c7bfc1f0c66ef17febe",
"version" : "1.0.2"
}
},
{
"identity" : "swift-collections",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-collections.git",
"state" : {
"revision" : "f504716c27d2e5d4144fa4794b12129301d17729",
"version" : "1.0.3"
}
},
{
"identity" : "swift-docc-plugin",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-docc-plugin.git",
"state" : {
"revision" : "9b1258905c21fc1b97bf03d1b4ca12c4ec4e5fda",
"version" : "1.2.0"
}
},
{
"identity" : "swift-docc-symbolkit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-docc-symbolkit",
"state" : {
"revision" : "b45d1f2ed151d057b54504d653e0da5552844e34",
"version" : "1.0.0"
}
},
{
"identity" : "swift-log",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-log.git",
"state" : {
"revision" : "6fe203dc33195667ce1759bf0182975e4653ba1c",
"version" : "1.4.4"
}
},
{
"identity" : "swift-nio",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio.git",
"state" : {
"revision" : "edfceecba13d68c1c993382806e72f7e96feaa86",
"version" : "2.44.0"
}
},
{
"identity" : "swift-nio-ssl",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio-ssl.git",
"state" : {
"revision" : "4fb7ead803e38949eb1d6fabb849206a72c580f3",
"version" : "2.23.0"
}
},
{
"identity" : "swift-nio-transport-services",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio-transport-services.git",
"state" : {
"revision" : "c0d9a144cfaec8d3d596aadde3039286a266c15c",
"version" : "1.15.0"
}
},
{
"identity" : "swift-protobuf",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-protobuf.git",
"state" : {
"revision" : "ab3a58b7209a17d781c0d1dbb3e1ff3da306bae8",
"version" : "1.20.3"
}
},
{
"identity" : "web3.swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/argentlabs/web3.swift",
"state" : {
"revision" : "9da09d639d4e5d06eb59518e636b3ae957e8e9cd",
"version" : "1.3.0"
}
},
{
"identity" : "websocket-kit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/vapor/websocket-kit.git",
"state" : {
"revision" : "2d9d2188a08eef4a869d368daab21b3c08510991",
"version" : "2.6.1"
}
},
{
"identity" : "xmtp-rust-swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/xmtp/xmtp-rust-swift",
"state" : {
"revision" : "eccfc16bb8f866857ecbb1604c1dab855b1960f7",
"version" : "0.2.2-beta0"
}
}
],
"version" : 2
}
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,24 @@ let package = Package(
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),

.package(url: "https://github.com/xmtp/proto", branch: "main"),
.package(url: "https://github.com/GigaBitcoin/secp256k1.swift.git", exact: "0.10.0"),
.package(url: "https://github.com/argentlabs/web3.swift", from: "1.1.0"),
.package(url: "https://github.com/1024jp/GzipSwift", from: "5.2.0"),
.package(url: "https://github.com/bufbuild/connect-swift", from: "0.3.0"),
.package(url: "https://github.com/apple/swift-docc-plugin.git", from: "1.0.0"),
.package(url: "https://github.com/xmtp/xmtp-rust-swift", from: "0.2.2-beta0"),
],
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: "XMTP",
dependencies: [
.product(name: "XMTPProto", package: "proto"),
.product(name: "secp256k1", package: "secp256k1.swift"),
"web3.swift",
.product(name: "Gzip", package: "GzipSwift"),
.product(name: "Connect", package: "connect-swift"),
.product(name: "XMTPRust", package: "xmtp-rust-swift"),
]
),
.target(
Expand Down
Loading

0 comments on commit dc2040a

Please sign in to comment.