Core methods
The following methods are used internally but may be used externally, too. None are exported.
Maker.TARGETS
Maker.dependencies
Maker.execute
Maker.fixcache
Maker.isstale
Maker.register
Maker.resolve
Maker.resolvedependency
Maker.tasks!
Maker.timestamp
#Maker.dependencies
— Function.
dependencies(t::AbstractTarget)
Return the dependencies of a target.
#
Maker.execute
— Function.
execute(t::AbstractTarget)
Run the action for target t
.
#
Maker.fixcache
— Function.
fixcache()
Update the .maker-cache.jld
file with the present version information for the cache version number and the Julia version. This may be needed if the file format changes or the Julia version upgrades. Note that this may not solve all issues.
#
Maker.isstale
— Function.
isstale(t::AbstractTarget)
Return true
if target t
is stale and should be updated.
#
Maker.register
— Function.
register(t::AbstractTarget)
Register target t
. make
only looks for registered targets.
#
Maker.resolve
— Function.
resolve(s::AbstractString)
Return the target registered under name s
.
#
Maker.resolvedependency
— Function.
resolvedependency(s::AbstractString)
Return the target registered under name s
. If no target is registered and a file of name s
exists, return a new FileTarget
for that file.
#
Maker.tasks!
— Function.
tasks!(name, target)
Add the target
task with name name
to the global database of targets.
#
Maker.timestamp
— Function.
timestamp(t::AbstractTarget)
Return the DateTime timestamp for a target.
#
Maker.TARGETS
— Constant.
Maker.TARGETS
The global Targets
dictionary for registered AbstractTargets.
Internals
Maker
uses the global Dict Maker.TARGETS
to store active tasks. Some state is also stored in a JLD file ".maker-cache.jld" in the active directory. This stores hashes for functions and variables along with timestamps. This allows Maker
to be used between sessions.
Note that tasks are defined globally, so they may be defined in modules or in the Main
module. make
works fine in a module for tasks defined in that module. You cannot run all actions in Main
that are defined in another module (particularly for variable tasks).
The hashing for functions and variables is not likely to stay the same between Julia versions. It's also different for 32- and 64-bit versions. It's still up in the air how to deal with this. Also, hashing for v0.4 anonymous functions has file information removed.
Timestamps are stored for all tasks, even file tasks. On some filesystems, mtime
only has an accuracy of one second, and this can cause inaccuracies with variable timestamps.
Note that parallel operation may be tricky. One may have to be careful using @everywhere
and friends with Maker
. Each process might try to update dependencies at the same time, leading to race conditions. Another topic to think about is how to take advantage of parallel operations (or threads when they come to Julia).