Skip to content
This repository was archived by the owner on Feb 17, 2022. It is now read-only.

Latest commit

 

History

History
42 lines (29 loc) · 1.29 KB

Tips.md

File metadata and controls

42 lines (29 loc) · 1.29 KB

Tips and tricks

Here are some tips and tricks to work with Puma more efficiently

Environment variables

When Puma is run as a macOS command line library, you can access environment variables via ProcessInfo

UploadApp(path: Directory.downloads.appendingPathComponent("TestApp.ipa").path)
    .username(ProcessInfo().environment["username"]!)
    .password(ProcessInfo().environment["password"]!)

If you set environment variables in scheme in Xcode, you can choose to have 2 scheme, one shared main scheme and 1 unshared but with environment variables.

Directory

Puma encourages explicity, so you have to provide explicit paths. Instead of typing path like /Users/khoa/Downloads,you can use the Directory class which provides nifty properties for popular locations, they are file URL so you can append path component further.

Directory.home
Directory.downloads
Directory.applications

Configure tasks directly

Some tasks like Build, Test, UploadApp uses command line tools like xcodebuild or altool, and they provide convenient configuration methods

Build()
    .workspace("TestApp")
    .scheme("TestApp")

In case you want to customize, you can configure on the command line tool directly

Build()
    .arguments("--scheme", "TestApp")