Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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