Skip to content

Swift Package Manager support #37

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

madhikarma
Copy link

@madhikarma madhikarma commented Jan 7, 2022

Hi there 👋

We're using this component in our app but the iOS team are moving towards just using Swift Package Manager for managing dependencies.

So I've added a Package.swift file to this library via the initialisation steps and kept the same iOS support as the CocoaPod spec file and updated the README file.

Note. since it's Objective-C I've needed to mention where the public header files can be found in the Package.swift file and I had change the folder structure to remove the Demo project for some reason it produced module not found errors

I've tested integration here in a demo project https://github.com/madhikarma/BDKCollectionIndexViewSPMDemo and everything appears to be working.

Please take a look when you can and let me know what you think.

Thank you in advance

@kreeger
Copy link
Owner

kreeger commented Jan 13, 2022

Thanks a ton for this, @madhikarma! I'll take a look hopefully today or tomorrow.

Copy link
Owner

@kreeger kreeger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@madhikarma By moving the files around for SwiftPM support, you've broken CocoaPods support. Can you fix the .podspec so that it references the new paths?

@@ -1,5 +1,5 @@
#import <UIKit/UIKit.h>

// @import UIKit;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you still need this in here?

Comment on lines +1 to +11
import XCTest
@testable import BDKCollectionIndexView

final class BDKCollectionIndexViewTests: 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(BDKCollectionIndexView().text, "Hello, World!")
}
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove this stub tests file if you're not going to need it?

@madhikarma
Copy link
Author

@madhikarma By moving the files around for SwiftPM support, you've broken CocoaPods support. Can you fix the .podspec so that it references the new paths?

Hi @kreeger sorry, I realised this after I authored the PR but looks like I forgot to add it to the PR description.

I will fix the Pod spec with the new path and test that the library can still be installed via CocoaPods as well as Swift Package Manager.

Q. Is there any other Pods related admin I need to do e.g. version bump? Pushing spec to the pods repo or is it just the path I need to change? (it's been a while since I authored a Pod)

Thank you for the other bits of code review / things to tidy up too

ETA: maybe sometime over this weekend

@kreeger
Copy link
Owner

kreeger commented Jan 21, 2022

There's no need for you to do any version bumping or pushing to the spec repo! I can take care of that once this PR makes it in.

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.

2 participants