For an framework to be compatible with various devices it has to be compiled for them specifically, This script does those tasks in single shot.
- Select Target
| #!/bin/bash | |
| # Get the current branch name | |
| current_branch=`git rev-parse --abbrev-ref HEAD` | |
| # Search Jira ID in a pattern such a "feature/ABCD-123-my-feature" | |
| id=$(echo $current_branch | sed -nE 's,[a-z]+/([A-Z]+-[0-9]+)-.+,\1,p') | |
| # only prepare commit message if pattern matched and jiraId was found | |
| if [[ ! -z $id ]]; then |
| name: XXXX | |
| attributes: | |
| LastUpgradeCheck: 1140 | |
| ORGANIZATIONNAME: "kankak, Inc." | |
| options: | |
| bundleIdPrefix: com.xxxx.xxxxxxxx | |
| deploymentTarget: | |
| iOS: 13.1.3 | |
| configs: | |
| Develop Debug: debug |
| extension FileManager { | |
| /* | |
| Prints out the locations of the simulator and the shared group folder. | |
| This is useful for debugging file issues. | |
| Example usage: FileManager.default.printFileLocations() | |
| */ | |
| func printFileLocations() { | |
| let paths = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true) | |
| let simulatorFolder = paths.last! |
| // | |
| // Debug.swift | |
| // | |
| // Created by Craig Hockenberry on 3/15/17. | |
| // Updated by Craig Hockenberry on 2/20/24. | |
| // Usage: | |
| // | |
| // SplineReticulationManager.swift: | |
| // |
| If you've got something like this: | |
| file was built for arm64 which is not the architecture being linked (x86_64): | |
| Than this gist is for you. | |
| Let's say you have already developed the framework itself and just want to build the binary | |
| and distribute it through the Cocoapods. | |
| 1. Make sure your framework "Deployment Target" is equal to all the dependencies from your podspec file. |
| /* | |
| erica sadun, ericasadun.com | |
| Core Geometry | |
| */ | |
| import Foundation | |
| import QuartzCore |
| #!/bin/bash | |
| # taken from blog post: http://www.mokacoding.com/blog/automatic-xcode-versioning-with-git/ | |
| # Automatically sets version of target based on most recent tag in git | |
| # Automatically sets build number to number of commits | |
| # | |
| # Add script to build phase in xcode at the top of the chain named "set build number" | |
| # put this script in the root of the xcode project in a directory called scripts (good idea to version control this too) | |
| # call the script as $SRCROOT/scripts/set_build_number.sh in xcode |
| target 'MyTarget' do | |
| use_frameworks! | |
| # Post installation script that enables the Swift 4.2 compiler's | |
| # legacy 4.1 mode for 4.2-incompatible pods | |
| post_install do |installer| | |
| incompatiblePods = ['PodA', 'PodB'] | |
| installer.pods_project.targets.each do |target| | |
| if incompatiblePods.include? target.name |
| import PlaygroundSupport | |
| import Foundation | |
| class Worker { | |
| private let queue = DispatchQueue.global(qos: .background) | |
| private let serialQueue = DispatchQueue(label: "com.acme.serial") | |
| public private(set) var count = 0 | |
| func incrementCount() { |