Skip to content

requires

Nat! edited this page Mar 1, 2023 · 3 revisions

requires will try to locate a NSBundle at print time. If the bundle identifier matches, then the bundle will get loaded. The idea is to be able to load available functionality to a standalone script.

Example

{% if __FOUNDATION__ == "Mulle" %}
{% requires "com.mulle-kybernetik.foundation" %}
{% else %}
{% requires "com.apple.Foundation" %}
{% endif %}

Output:


requires searches in the following places:

  • first in all already loaded bundles and frameworks
  • in the mainBundle builtInPlugInsPath
  • it then will search through all Library directories Frameworks and PlugIns directories.
  • Turn on the MULLESCION_DUMP_BUNDLE_SEARCHPATH environment variable to see the paths searched.

requires should not be used in multi-line statements.

Clone this wiki locally