Skip to content

Get the path of an asset bundled with your Julia package or app

License

Notifications You must be signed in to change notification settings

nielsls/Assets.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Assets

Install: ] add Assets

Assets allows you to easily retrieve the path of an asset (txt-file, image, etc...) bundled with your Julia package.

absolute_path_to_image = asset"my_image.gif"

The above works both for ordinary Julia sessions - and for Julia apps compiled and bundled using PackageCompiler.

When using PackageCompiler

When compiling apps using PackageCompiler, the following code should be appended to your build script (i.e. right after create_app(...)):

using Assets
using MyPkgWithAssets
copy_assets(MyPkgWithAssets, app_folder)

where app_folder is the path of the folder containing bin/ created by PackageCompiler.

This will copy the contents of MyPkgWithAssets/assets/ to assets/ located next to bin/ in the app bundle.

Note

Your package must be organized as follows for Assets to find your assets.

package/
│
└───src/
│   │   code1
│   │   code2
│   │   ...
│   
└───assets/
    │   asset1
    │   asset2
    │   ...

About

Get the path of an asset bundled with your Julia package or app

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages