Add 3rd Party Files
App can also contain external third-party libraries, data files, scripts or a program built on another system.
To add other files to applications, you add other sections to your application's .adef file.
Here's a sample of how to add an audio file and a third-party library:
bundles:{file:{[r] audio/alert.wav /usr/share/sounds/[r] third-party/foo/lib/foo.so.1 /lib}}
The file:
subsection of the bundles:
section will copy the file ./audio/alert.wav from the build host's file system (relative to the current working directory in which mkapp
is run), and bundle it into the application such that it appears under /usr/share/sounds (from the application's point-of-view when it runs on the target).
The letter inside the square brackets (e.g., [r]) contain the permissions flags for the file on the target:
- 'r' = readable
- 'w' = writeable
- 'x' = executable
If you want to have a script or other executable run when the application starts, add that file to
- the "file:" subsection of a "bundles:" section (with the executable flag [x] set), and
- the list of executables in the processes section, "run:" subsection.
bundles:{file:{[x] otherProject/bin/bar /usr/bin/bar}}processes:{run:{(/usr/bin/bar)}}
This grabs a copy of ./otherProject/bin/bar (relative to the directory where mkapp
is run), puts it in the application sandbox's /usr/bin/bar directory, and starts one instance of it when the application starts.
Copyright (C) Sierra Wireless Inc.