Skip to content
Snippets Groups Projects
Commit d99ad53a authored by Calen Pennington's avatar Calen Pennington
Browse files

Add system and env arguments to asset tasks

The preprocess task requires system and env arguments in order to
correctly load up the django environment to preprocess sass files to
inject themes.

In order for that task to recieve the arguments, all tasks that depend
on it also have to accept that same set of arguments.

This will all go away once the next evolution of themes arrives, which
will remove the preprocessing needed to inject theme names.
parent d9268acd
No related merge requests found
......@@ -55,8 +55,9 @@ def sass_cmd(watch=false, debug=false)
"#{watch ? '--watch' : '--update'} -E utf-8 #{sass_watch_paths.join(' ')}"
end
# This task takes arguments purely to pass them via dependencies to the preprocess task
desc "Compile all assets"
multitask :assets => 'assets:all'
task :assets, [:system, :env] => 'assets:all'
namespace :assets do
......@@ -80,8 +81,9 @@ namespace :assets do
{:xmodule => [:install_python_prereqs],
:coffee => [:install_node_prereqs, :'assets:coffee:clobber'],
:sass => [:install_ruby_prereqs, :preprocess]}.each_pair do |asset_type, prereq_tasks|
# This task takes arguments purely to pass them via dependencies to the preprocess task
desc "Compile all #{asset_type} assets"
task asset_type => prereq_tasks do
task asset_type, [:system, :env] => prereq_tasks do |t, args|
cmd = send(asset_type.to_s + "_cmd", watch=false, debug=false)
if cmd.kind_of?(Array)
cmd.each {|c| sh(c)}
......@@ -90,7 +92,8 @@ namespace :assets do
end
end
multitask :all => asset_type
# This task takes arguments purely to pass them via dependencies to the preprocess task
multitask :all, [:system, :env] => asset_type
multitask :debug => "assets:#{asset_type}:debug"
multitask :_watch => "assets:#{asset_type}:_watch"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment