Skip to content

Instantly share code, notes, and snippets.

@andrewroycarter
Created January 28, 2016 20:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewroycarter/0ff680fa6dc5250bd1fc to your computer and use it in GitHub Desktop.
Save andrewroycarter/0ff680fa6dc5250bd1fc to your computer and use it in GitHub Desktop.
Example Makr Makefile
# Generated by Makr 1.4.2
# https://github.com/willowtreeapps/Makr
# Path for built products
ARTIFACTS_PATH = artifacts
# Path for built archives
ARCHIVES_PATH = $(ARTIFACTS_PATH)/archives
# Path for built IPAs
IPAS_PATH = $(ARTIFACTS_PATH)/ipas
# Provisioning profiles dir
PROFILES_DIR = $(CURDIR)/profiles
# Temporary build dir
TEMP_DIR = $(CURDIR)/tmp
# Build environment vars
CONFIGURATION_BUILD_DIR = $(TEMP_DIR)/configuration
BUILD_ENV_OPTIONS = SHARED_PRECOMPS_DIR="$(TEMP_DIR)/precomps"
# Archives
ARCHIVES = $(ARCHIVES_PATH)/adhoc.xcarchive
# IPAs
IPAS = $(IPAS_PATH)/adhoc
# Generates all IPAs
all: $(IPAS)
# Create profiles directory
$(PROFILES_DIR):
mkdir $@
# Install provisioning profiles
install-profiles: $(PROFILES_DIR)
rsync -av ./profiles/ ~/Library/MobileDevice/Provisioning\ Profiles/
# Create adhoc.xcarchive
$(ARCHIVES_PATH)/adhoc.xcarchive:
xcodebuild archive $(BUILD_ENV_OPTIONS) \
-scheme "app" \
-project "app.xcodeproj" \
-configuration "Release" \
-archivePath $@
rm -rf $(TEMP_DIR)
# Create adhoc/adhoc.ipa
$(IPAS_PATH)/adhoc: $(IPAS_PATH) $(ARCHIVES_PATH)/adhoc.xcarchive
xcodebuild -exportArchive \
-exportOptionsPlist "adhoc.plist" \
-archivePath "$(ARCHIVES_PATH)/adhoc.xcarchive" \
-exportPath "$@"
# Path to built IPAs
$(IPAS_PATH):
mkdir -p $(IPAS_PATH)
# Run all distribution tasks
distribute-all:
# Clean artifacts and temp directories
clean:
rm -rf $(ARTIFACTS_PATH)
rm -rf $(TEMP_DIR)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment