Class: Everywhere::Builders::Ios

Inherits:
Object
  • Object
show all
Defined in:
lib/everywhere/builders/ios.rb

Overview

Assembles a Hotwire Native iOS app around an already-deployed (remote mode) app. No Tebako on iOS — the "build" is: copy the gem's frozen Xcode template, stamp it (xcconfig + everywhere.json + AppIcon; never the pbxproj), and hand it to xcodebuild.

MVP scope is the Simulator (ad-hoc signed, no certs). Device signing, archive/.ipa export and store distribution hang off this same seam later — see platform/docs/build-engine.md §5.

Constant Summary collapse

SCHEME =

Fixed by the template contract: the target/product is always "App" (App.app), so build paths never depend on per-app values.

"App"

Instance Method Summary collapse

Constructor Details

#initialize(config:, root:, target:, template_dir: nil) ⇒ Ios

Returns a new instance of Ios.



26
27
28
29
30
31
# File 'lib/everywhere/builders/ios.rb', line 26

def initialize(config:, root:, target:, template_dir: nil)
  @config = config
  @root = root
  @target = target
  @template_dir = template_dir
end

Instance Method Details

#build!(dist_dir:, dev: false) ⇒ Object

Build the Simulator .app and copy it into dist_dir. dev builds Debug and relaxes the remote-mode requirement (the dev URL arrives at launch via SIMCTL_CHILD_EVERYWHERE_DEV_URL, not baked into the bundle). Returns the path of the built .app.



37
38
39
40
41
42
43
44
45
# File 'lib/everywhere/builders/ios.rb', line 37

def build!(dist_dir:, dev: false)
  preflight!(dev: dev)
  template = @template_dir ? File.expand_path(@template_dir) : Paths.ios_dir!
  work = stage(template)
  stamp!(work)
  configuration = dev ? "Debug" : "Release"
  xcodebuild!(work, configuration, dist_dir)
  collect(configuration, dist_dir)
end