• This repository has been archived on 19/Jan/2020
  • Stars
    star
    388
  • Rank 110,734 (Top 3 %)
  • Language
    Python
  • Created over 10 years ago
  • Updated about 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Featureful iOS Boilerplate

icon Amaro Build Status

Crush & Lovely's iOS boilerplate.

Changelog

Say what now?

We want to hit the ground running. Xcode and the iOS ecosystem don't make that easy. Enter Amaro. After running one simple command, you get a ready-to-build universal iOS application, full of delights.

Gimme gimme

Change to your projects directory, run this line in your terminal, and follow the prompts:

ruby -e "$(curl -fsSL https://raw.github.com/crushlovely/Amaro/master/tiramisu)"

Of course, if you're wary of running random scripts (legit!), please read tiramisu. At a high level, the script creates a local git repository with Amaro as a remote named "bootstrap", tweaks filenames and contents as per your input, and grabs third-party code from Cocoapods.

(Tiramisu is Italian for "pick me up". Bootstrap... pick me up... get it?!? 💃)

Details and Requirements

The bootstrap assumes:

  • You are using Xcode 7 or later.
  • You have version 0.34.1 or later of the CocoaPods gem installed.
  • You are on OS 10.9 or later
  • You are targetting iOS 8.0, at minimum (and thus will be compiling against at least the iOS 8.0 SDK).
    • As of October 2015, 91% of iOS devices are on iOS 8 or later.

Want to use Swift? Go to town! The small amount of code that is included in generated projects is in Objective-C, but you can blow it all away and replace it with Swift on a whim.

What's Included?

Amaro aims to set you up with all you need to write a beautiful, maintainable, well-tested app. All the default pods are optional; feel free to pick and choose as needed for your project (though you will probably want most of them).

Foundation

  • A well-chosen class prefix is enforced (or may be omitted entirely... the times, they are a-changin')
  • A local git repository for the application is created (and committed to a few times through the initialization process).
  • A sane .gitignore file is included.
  • A Certificates directory is included with a readme file about what to include so that other developers can test and release the app.
  • Sensible defaults for build options, warnings, and the like.
    • Build configurations are split into xcconfig files for modularity and consistency. We're using jspahrsummers/xcconfigs as our base.
    • There are separate staging, production, and distribution schemes, and corresponding preprocessor macros. No more fiddling with variables here and there to switch your target environment.
  • Automatic ways to easily distinguish between builds of the app:
    • Ad-hoc and development builds have their bundle id suffixed with ".adhoc" or ".dev" so that they can co-exist on devices with other builds.
    • Ad-hoc and development builds' icons are badged with an 🅢 for staging environments and a 🅟 for production environments. The bundle names (but not the display names) are also changed to easily distinguish them in places where it may otherwise be difficult.
  • The build number of the app is incremented on every ad-hoc and distribution build. This ensures that external distribution services can reliably distinguish builds, even if the version number itself doesn't change.
  • CocoaPods are integrated from the get-go.
  • A barebones settings bundle is included with an "Acknowledgements" section that includes licenses for all your pods. It's automatically updated after each pod install.
  • Identifiers from storyboards and asset catalogs are pulled out into constants, much like objc-codegenutils.

Logging, Error Reporting, Testing

  • CocoaLumberjack is configured for logging. A custom formatter is used by default to include the class and method name in log messages.
  • Specta and Expecta are included to allow for the creation of Rspec-like tests. Xcode integration for testing is fully configured; add your tests to the Specs target and hit Cmd+U.

Utility Belt

  • AFNetworking
  • libextobjc's scope and keypath checking modules.
  • Asterism, a fast, simple and flexible library for manipulating collections.
  • Sidecar, Crush's homegrown library. Features commonly needed functionality, such as creating UIColors from hex, playing short sound effects, and performing blocks on the main thread.

More...

Additionally, the Podfile notes a few other libraries that you may find useful:

  • FormatterKit, for all your string-formatting needs.
  • PromiseKit, a promises/futures library similar to Promises/A+, and related wrappers for core libraries.
  • Mantle, a project from the GitHub folks to make simpler, safer model classes.
  • SSKeychain, a friendly wrapper around the Keychain API.
  • DateTools, if you find yourself needing to do a lot of datetime math.

Maintaining the Spirit

Amaro will get you started on the right foot, but it's up to you not to mess it up! Here are some tips to stay in line with the spirit of the project.

Read up on the included and optional libraries. Most of them are very good at solving common problems, and you should become familiar with them. Ideally you should spend your time solving problems, not solving problems around solving problems.

Here are some specific tips:

  • Making a change to a build setting? Make it once in your project's .xcconfig file, so that it will propagate to all configurations.
  • Adding an external library? If there's a podspec for it, bring it in via Cocoapods. If there's not, consider writing one and submitting it upstream. Use git submodules as a last resort; version and dependency management with them is a pain in the ass.
    • There should almost never be a reason to check in third-party projects wholesale. If you need to modify someone else's code, fork the repo and include the fork in your Podfile with a direct :git reference.
  • Use CocoaLumberjack's DDLog variants instead of NSLog. It's faster, provides more information, is more configurable, and understands log levels. All of that with the same familiar syntax. Retrain your fingers.
  • Need to define different settings in staging and production? Check out the ProjectName-Environment.h file in Other Sources. It defines macros to test the type of build that is currently taking place.

License

The real content and value of Amaro is as a template; once you've created a new project with the initialization script, Amaro leaves barely a trace. So, in most cases, the only licenses you need to worry about are those of the third-party software you've included. But anyway, should you want to deal with Amaro itself, it's MIT licensed:

Copyright (c) 2014 Crush & Lovely, LLC

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Third-Party License Rundown

As mentioned above, the bootstrap automatically generates a settings section containing license information for all your Cocoapods. If that's unacceptable for your purposes, here's the license information on the major components:

Similar Projects

Once upon a time there was a similar project, but it seems to have been abandoned. More recently, the lovely folks at thoughtbot released liftoff. Amaro takes a different tack than liftoff: more opinions, less scriptability. Check it out for an alternative take on the problem.

Know of anything else in the realm? Drop us a line! We'd love to hear about it and see how others are tackling things.

Acknowledgements

The lovely icon was created by Ray Bruwelheide. It is licensed under the Creative Commons Attribution 3.0 license.

More Repositories

1

skyline

Basic Skyline Starter HTML and SCSS
CSS
390
star
2

Sidecar

(Yet another) utility belt for iOS applications
Objective-C
38
star
3

ansible-ec2-provision

Ansible role for provisioning EC2 instances
20
star
4

Aperitif

Prompt users to install new versions of your Installr app beta... in style!
Objective-C
16
star
5

max_mind

Ruby library for interacting with the MaxMind GeoIP Web Services
Ruby
11
star
6

capistrano-service

Cleanly manage your Linux services with Capistrano 3.x
Ruby
9
star
7

ansible-deploy-user

Shell
8
star
8

model-presenter

A lightweight model wrapper to prepare your data for the view layer.
JavaScript
7
star
9

dotenv-node

DotEnv loads environment variables from .env into your ENV.
JavaScript
6
star
10

ansible-papertrail

4
star
11

ansible-s3

3
star
12

backbone-presenter

A model-presenter adapter for Backbone models.
JavaScript
3
star
13

application-templates

Ruby
3
star
14

ansible-cloudfront

3
star
15

acts-as-list-extensions

A few convenience methods wrapped in a gem.
Ruby
2
star
16

toolbelt

Ruby
2
star
17

ansible-nodejs

2
star
18

ansible-loggly

Python
2
star
19

mongoid_favoriteable

Ruby
2
star
20

ec2_ami

Ansible role for provisioning EC2 images
2
star
21

ansible-sidekiq-upstart

2
star
22

ansible-dotenv

2
star
23

has-visibility

A tiny gem for setting a visibility property of an ActiveRecord object
Ruby
2
star
24

ruby-library

Miscellaneous ruby scripts
Ruby
1
star
25

crushserver

Miscellaneous Capistrano tasks
Ruby
1
star
26

prince

Ruby
1
star
27

envbang-node

Ensure you have all the right environment variables set in your app.
JavaScript
1
star
28

cacheflow

A JavaScript library to work with the window.applicationCache event API
JavaScript
1
star
29

ansible-logrotate

1
star
30

ansible-newrelic

1
star
31

ansible-ec2-group

Ansible role for provisioning EC2 security groups
1
star
32

ansible-forever-app

1
star
33

ansible-ruby

1
star
34

crush-design-components-system

Figma Tokens Plugin starter kit
CSS
1
star
35

exceptionally_beautiful

A Rails engine for handling error pages.
Ruby
1
star
36

mobiscroll-rails

Use Mobiscroll with the Rails 3 asset pipeline.
Ruby
1
star
37

crushlovely.js

JavaScript
1
star
38

boomerang-embed

Embed Boomerang text content via JSON.
JavaScript
1
star
39

capistrano-upstart-service

Easily define Capistrano 3.x tasks for your Upstart services.
Ruby
1
star
40

ansible-imagemagick

Ansible Role to Install ImageMagick and its dependencies
1
star