Bundlex v0.2.3 Bundlex.Project behaviour View Source
Behaviour that should be implemented by each project using Bundlex in the
bundlex.exs
file.
Link to this section Summary
Types
Type describing project configuration
Type describing configuration of a native
Struct representing bundlex project
Functions
Returns the project struct of given application
Determines if module
is a bundlex project module
Link to this section Types
config_t()
View Source
config_t() ::
Bunch.KVList.t(
:nifs | :cnodes | :libs,
Bunch.KVList.t(native_name_t(), native_config_t())
)
config_t() :: Bunch.KVList.t( :nifs | :cnodes | :libs, Bunch.KVList.t(native_name_t(), native_config_t()) )
Type describing project configuration.
It's a keyword list, where nifs, cnodes and libs can be specified. Libs are
native packages that are compiled as static libraries and linked to natives
that have them specified in deps
field of their configuration.
native_config_t()
View Source
native_config_t() :: [
sources: [String.t()],
includes: [String.t()],
lib_dirs: [String.t()],
libs: [String.t()],
pkg_configs: [String.t()],
deps: [{Application.app(), native_name_t() | [native_name_t()]}],
src_base: String.t(),
compiler_flags: [String.t()],
linker_flags: [String.t()]
]
native_config_t() :: [ sources: [String.t()], includes: [String.t()], lib_dirs: [String.t()], libs: [String.t()], pkg_configs: [String.t()], deps: [{Application.app(), native_name_t() | [native_name_t()]}], src_base: String.t(), compiler_flags: [String.t()], linker_flags: [String.t()] ]
Type describing configuration of a native.
It's a keyword list containing the following keys:
sources
- C files to be compiled (at least one must be provided),includes
- Paths to look for header files (empty list by default).libs_dirs
- Paths to look for libraries (empty list by default).libs
- Names of libraries to link (empty list by default).pkg_configs
- Names of libraries for which the appropriate flags will be obtained using pkg-config (empty list by default).deps
- Dependencies in the form of{app, lib_name}
, whereapp
is the application name of the dependency, andlib_name
is the name of lib specified in bundlex project of this dependency.src_base
- Native files should reside inproject_root/c_src/<src_base>
(application name by default).compiler_flags
- Custom flags for compiler.linker_flags
- Custom flags for linker.
native_name_t()
View Source
native_name_t() :: atom()
native_name_t() :: atom()
Struct representing bundlex project.
Contains the following fileds:
:config
- project configuration:src_path
- path to the native sources:module
- bundlex project module:app
- application that exports project
Link to this section Functions
get(application \\ MixHelper.get_app!()) View Source
Returns the project struct of given application.
If the module has not been loaded yet, it is loaded from
project_dir/bundlex.exs
file.
project_module?(module) View Source
Determines if module
is a bundlex project module.
Link to this section Callbacks
project()
View Source
project() :: config_t()
project() :: config_t()
Callback returning project configuration.