Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Carthage fix #149

Closed
wants to merge 15 commits into from
Closed

Carthage fix #149

wants to merge 15 commits into from

Conversation

madhavajay
Copy link
Contributor

Okay so this time its much better.
This relies on the PR over at geos:
GEOSwift/geos#5

  1. I added a Cartfile which uses the above geos Carthage dependency
  2. I added the xcconfig files to the Repo that way they dont need to be removed from the project
  3. I removed the test target because of this error:
Carthage/Checkouts/GEOSwift/GEOSwiftTests/QuickLookTests.swift:13:18: error: module 'GEOSwift' was not compiled for testing
@testable import GEOSwift

We shouldn't compile the library for Production with @testable enabled so this should be done as part of an App Target or its own Test Target, but not attached to the Framework directly.

  1. I added a Preprocessing Target step which Copies the geos.framework from Carthage to a folder and filename that the Cocoapods setup is expecting and it works. This is skipped if the CARTHAGE=YES environment variable isn't set.

It seems to work great! :)

Also, it should be pretty easy to add the additional tvOS and macOS targets to this library if you wish now that they are part of the geos dependency.

Thoughts?

@madhavajay madhavajay mentioned this pull request Apr 9, 2019
@madhavajay
Copy link
Contributor Author

Okay so I have the tests running again but two are failing:

QuickLookTests
[01:41:44]: ▸ ✗ testDrawGeometryCollection, XCTAssertEqual failed: ("Optional(6088 bytes)") is not equal to ("Optional(6098 bytes)")
[01:41:44]: ▸ ✗ testDrawWaypoint, XCTAssertEqual failed: ("Optional(4514 bytes)") is not equal to ("Optional(4491 bytes)")

Is it possible something has changed in QuickLook?

@macdrevx
Copy link
Member

I'd check to make sure the tests are still running on "iPhone XS" simulator. The snapshot tests are simulator-dependent for some reason.

@madhavajay
Copy link
Contributor Author

@macdrevx 😅Looks like it worked. 😎

@madhavajay
Copy link
Contributor Author

@macdrevx Anything preventing this from being merged?

@macdrevx
Copy link
Member

I just need some time to review it. Sorry for the delay.

@macdrevx
Copy link
Member

@madhavajay I pushed a branch https://github.com/GEOSwift/GEOSwift/tree/carthage with a different approach. Can you try it out and let me know if it works for you?

Instead of working around CocoaPods, I switched the project to use Carthage for development purposes. CocoaPods is still available for consumers. This seems simpler to me.

The only problem left that I'm aware of is that I get an error when I try running the playground.

error: Couldn't lookup symbols:
  type metadata accessor for GEOSwift.MultiPolygon
  type metadata accessor for GEOSwift.Feature
  type metadata accessor for GEOSwift.Polygon
  type metadata accessor for GEOSwift.Envelope
  GEOSwift.Geometry.convexHull() -> Swift.Optional<GEOSwift.Polygon>
  GEOSwift.Geometry.difference(GEOSwift.Geometry) -> Swift.Optional<GEOSwift.Geometry>
  GEOSwift.Geometry.intersection(GEOSwift.Geometry) -> Swift.Optional<GEOSwift.Geometry>
  GEOSwift.Geometry.pointOnSurface() -> Swift.Optional<GEOSwift.Waypoint>
  GEOSwift.Geometry.__allocating_init(WKT: Swift.String) -> Swift.Optional<GEOSwift.Geometry>
  GEOSwift.Geometry.union(GEOSwift.Geometry) -> Swift.Optional<GEOSwift.Geometry>
  GEOSwift.Geometry.buffer(width: Swift.Double) -> Swift.Optional<GEOSwift.Geometry>
  GEOSwift.Geometry.boundary() -> Swift.Optional<GEOSwift.Geometry>
  GEOSwift.Geometry.centroid() -> Swift.Optional<GEOSwift.Waypoint>
  GEOSwift.Geometry.envelope() -> Swift.Optional<GEOSwift.Envelope>
  GEOSwift.Geometry.mapShape() -> Swift.Optional<__C.MKShape>
  type metadata accessor for GEOSwift.Geometry
  type metadata accessor for GEOSwift.Waypoint
  static (extension in GEOSwift):Swift.Array<A where A == GEOSwift.Feature>.fromGeoJSON(Foundation.URL) throws -> Swift.Optional<Swift.Array<GEOSwift.Feature>>

Do you have any ideas on how to get it working again?

Regarding number 3 in your PR description: I saw that error too, but it was solved by a change to the scheme to prevent the tests from being compiled unless we're actually building for test.

scheme change

@madhavajay
Copy link
Contributor Author

Yes, I think using Carthage is a nicer solution than the above hack but I wasn't sure you would want to overhaul the whole dependency management system.

I have added a PR which fixes the Playground issue.
#152

Let me know if you have any issues with it! :)

@macdrevx
Copy link
Member

Closing this in favor of #153.

@macdrevx macdrevx closed this Apr 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants