Skip to content
Brian Spencer edited this page Jun 5, 2017 · 10 revisions

Adding a library

To add a library to your application simply add the stack or script-only stack to the app/libraries folder. The next time you load your application in the LiveCode IDE all stacks in the app/libraries folder will be put in use with start using and all public handlers will be in the message path.

  • 📂 app
    • 📂 libraries
      • my_common_handlers.livecodescript

If you add a subfolder to the app/libraries folder then all stacks and script-only stacks in the subfolder will also be loaded as libraries when you open your application.

The libraries section in app.yml

The libraries section in your app.yml file specifies which stacks will be loaded as libraries. By default, app.yml is configured to load all stacks in the libraries folder and its subfolders as libraries:

# app.yml

libraries:
  - folder: ./libraries

If you wish, you can customize the libraries section to load library stacks from other folders or to override the default encryption setting for some of your libraries.

Examples

TODO: Give app.yml examples of:

  • Loading a shared libraries folder
  • Loading an individual shared library stack
  • Overriding encryption for a libraries folder or subfolder
  • Overriding encryption for an individual library stack
# app.yml
...
libraries:
  - filename: [relative path to stack file within libraries folder]
    encrypt: Optional parameter that can override the `encrypt stacks` setting for this stack.
  - folder: [relative path a folder with library stack files]
    encrypt: Optional parameter that can override the `encrypt stacks` setting for all stacks in the folder.
    ...
...
libraries:
  - filename: ../../shared/mylibrary.livecodescript
  - folder: ./libraries

Clone this wiki locally