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

New project layout, Carthage, SPM [WIP] #187

Closed
wants to merge 66 commits into from
Closed

New project layout, Carthage, SPM [WIP] #187

wants to merge 66 commits into from

Conversation

fulldecent
Copy link
Collaborator

@fulldecent fulldecent commented Jul 13, 2016

Status

If you are using Swift 3 and working on a NEW project, check out https://github.com/fulldecent/swift3-module-template it is better than pod-template.

You can use this NOW for production code if your your project is Swift and has tests. See "How can I play..." below.

PR merge blockers:

How can I play with this PR?

  • Clone and cd into the directory
  • Run some stuff you need to run for any Ruby project:
    • gem install bundler
    • bundle install
  • Run the included test suite:
    • rake
    • Note: this uses the latest released version of CocoaPods to run this template (retrieved with Bundler above)
  • Try it for real:
    • cd ~/Desktop
    • pod lib create --verbose --template-url='file:///PATH/TO/pod-template' NewPod
    • Note: this uses your INSTALLED VERSION of pod to run this template
  • Hacking:
    • Note: you MUST commit to git BEFORE you do rake testing or pod lib create testing. Both of those tools pull from master in your local repository. Learn how to squash commits :-)

PR Improvements to Master

Wording:

  • pod-template -- this project
  • template -- a model that can have things changed
  • vendored -- a chosen template with variable substitutions and other updates applied and ready for making an iOS framework

pod-template progress:

  • Make vendoring work
  • Set up testing with rake/rspec to validate the vendoring process (fixes Create a full test #79)
  • Set up Travis CI
  • Update variable substitution process, remove unused code
  • Add testing and make it work if "Would you like to do view based testing" is NO (Template on develop is broken #186)

baseline template progress: (new feature)

swift template progress:

  • Create a hello world example (this is a change), it actually does something
  • Remove FDChessboardView and my name from project, use variable substitution
  • Remove XCode warnings (fixes Recommended project settings #131)
  • Has "hello world"-level functionality

objective-c template progress:

@fulldecent
Copy link
Collaborator Author

@orta I have added a blocker for CocoaPods/CocoaPods#5787 in the notes above. CocoaPods 2.1.0 doesn't even have a milestone yet. Do you have a specific issue we can reference as a blocker?

@orta
Copy link
Member

orta commented Aug 24, 2016

This is the issue, see the discussion above with ben + I, #187 (comment) ( It's for CP 1.1.0, which is currently in beta )

@fulldecent
Copy link
Collaborator Author

Thank you, blocker added

@fulldecent
Copy link
Collaborator Author

FYI, this PR is usable for production code today -- assuming you use Swift and testing. I have updated notes above for same.

fulldecent added a commit to fulldecent/FDWaveformView that referenced this pull request Sep 1, 2016
@fulldecent
Copy link
Collaborator Author

Most people that are making new pods will probably want to use https://github.com/fulldecent/swift3-module-template

Long term, I would like to replace CocoaPods/pod-template with what is at swift3-module-template and cover all the other use cases that CocoaPods/pod-template does.

@orta
Copy link
Member

orta commented Oct 20, 2016

1.1.0 is now out, and we're good to start thinking about getting this in

@orta
Copy link
Member

orta commented Oct 20, 2016

I've my plan is to make a CP Mac release at the weekend, and get this out, do you want to consider writing a blog post for this? I'd love to get your name out about the changes

@fulldecent
Copy link
Collaborator Author

Update to CocoaPods Pod Template

by William Entriken, posted 2016-10-21

The newest CocoaPods release 1.1.1 is now compatible with the updated Pod Template and it brings new features to all pod authors!

Pod Template (pod-template) is used when you run pod lib create MyNewAwesomePod. It is an opinionated starting point for all pod authors and it gives you everything you need to start delivering a nice and reusable pod.

All the best practices for pod authors are already built in. But the 1.1.1 release bring many new features. To recount, here is everything:

  • Prompt-based project generation
  • Support for CocoaPods, Carthage and project layout compatible with Swift Package Manager
  • Clean folder structure
  • MIT license
  • Testing as a standard
  • Turnkey access to Travis CI

As new versions of Xcode are released and as Swift evolves, Pod Template must be updated to take advantage of new features. You will get all the latest updates every time you run pod lib create command. For more information and to help shape the future of modular development in Swift & Objective-C see the project page at https://github.com/CocoaPods/pod-template

screen shot 2016-10-20 at 7 11 52 pm

@fulldecent
Copy link
Collaborator Author

@orta Thank you! Here is a blog post.

@orta
Copy link
Member

orta commented Oct 30, 2016

Yep, looks like that PNG gets corrupted, probably is getting find and replaced on it's internals.

Looks like all this swift stuff needs updating for Xcode 8, sigh

@orta
Copy link
Member

orta commented Oct 30, 2016

Hrm, png still corrupting but at least project removal seems to work fine now and Swift seems to work fine on v3

@orta
Copy link
Member

orta commented Oct 31, 2016

Looks like the Xcode project for Objective-C libraries doesn't open, and is somehow correupted.
It gives a lot of warnings during usage too:

2016-10-31 17:15:59.275 ruby[84236:17582453] CFPropertyListCreateFromXMLData(): Old-style plist parser: missing semicolon in dictionary on line 139. Parsing will be abandoned. Break on _CFPropertyListMissingSemicolon to debug.
2016-10-31 17:15:59.275 ruby[84236:17582453] CFPropertyListCreateFromXMLData(): Old-style plist parser: missing semicolon in dictionary on line 139. Parsing will be abandoned. Break on _CFPropertyListMissingSemicolon to debug.
...

@fulldecent
Copy link
Collaborator Author

https://github.com/fulldecent/swift3-module-template is now compatible with CocoaPods. It can be run directly with

pod lib create --verbose --template-url='https://github.com/fulldecent/swift3-module-template.git' NewPod

For new Swift 3 projects, this is superior. It is very clean, has no dependencies and is reproducibly documented.

Please help review. If there is interest, I will make a PR here.

@orta
Copy link
Member

orta commented Dec 27, 2016

Just a reminder for anyone interested in this PR, this is still blocked from a merge on Objective-C support, and work on the guides to reflect new changes.

@jugutier
Copy link
Collaborator

jugutier commented Feb 8, 2017

@fulldecent Is this up to date with your repository? I'll look at the merge conflict with the ObjC branch since I worked on it last.

@jugutier
Copy link
Collaborator

jugutier commented Feb 8, 2017

On the left is the result of:

pod lib create --template-url='file:///path/to/pod-template' MyPod

for Objective-C, Demo=Yes,Test=Quick,ViewBased=No

Right is the same but with swift.

Few things I noticed:

  1. Obj-C is broken which is not news.
  2. The App target/project now goes after the development pod target and is also called 'iOS Example'. Any reasons to change it from the way it was before? (My point is why introduce breaking changes into a project structure that has been used and that looks more to the structure of the user of any given pod)
  3. MyPod.xcodeproj is also referenced within 'iOS Example' this project reference isn't currently done on master. Any reasons for this?
  4. baseline/.travis.yml has a flag for -enableCodeCoverage YES which I think is to run Swift 2.3 tests on Swift 3 compiler? if that's the case and it's hardcoded it might not work for Obj-C. Coments pls 🔢

screen shot 2017-02-07 at 11 13 36 pm

@fulldecent
Copy link
Collaborator Author

@jugutier This PR is live and still valid. If we can get it working with ObjC then we should probably merge it because the new configuration engine is nice. This PR still suffers from the main problem of pod-template, which is that it needs to be painfully updated for each Xcode release. Therefore I have not been involved in this PR.

The swift3-module-template has a dead-simple configurator, no external dependencies and a recipe. This means generating the template is repeatable. That solves the problem of updating for each Xcode release.

I have just now created https://github.com/fulldecent/objective-c-module-template as a starting point to do the same thing for Objective-C projects. If someone can help with this new part then we will have a complete replacement for pod-template.

@jugutier
Copy link
Collaborator

jugutier commented Feb 9, 2017

@fulldecent I am already doing it here: https://github.com/jugutier/pod-template/tree/develop

my plan is to rebase master from this branch to get the latest that happened there (mostly my changes for the obj-c template) but for that I'd like to understand points 2, 3 and 4 above. Could you see if you have some input?

Thanks!

@fulldecent
Copy link
Collaborator Author

Hello all, I have been working on this PR for almost a year. Thank you for your patience, it's worth the wait!

After lots of testing, dogfooding and feedback, please see #210

I put all my heart into that PR and it supersedes this #187 so I'm closing this one. Specifically, the new one now supports Swift AND Objective-C. It was such a simple fix... just make a mixed project. But now it works and so it is a realistic contender to replace the old PR.

Would you please bring your comments from this thread and consider your same issues on the new PR. As always, I'm very eager for your feedback.

@fulldecent fulldecent closed this Jun 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants