Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
fdf213f9
Commit
fdf213f9
authored
Jun 05, 2013
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Compile all of the coffee and sass in the project, not just the files in */static
parent
16fc7b37
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
17 deletions
+19
-17
rakefiles/assets.rake
+19
-17
No files found.
rakefiles/assets.rake
View file @
fdf213f9
...
...
@@ -13,6 +13,7 @@ def xmodule_cmd(watch=false, debug=false)
"--patterns='*.js;*.coffee;*.sass;*.scss;*.css' "
+
"--recursive "
+
"--command='
#{
xmodule_cmd
}
' "
+
"--wait "
+
"common/lib/xmodule"
else
xmodule_cmd
...
...
@@ -27,15 +28,16 @@ def coffee_cmd(watch=false, debug=false)
#
# Ref: https://github.com/joyent/node/issues/2479
#
# Rather than watching all of the directories in one command
# watch each static files subdirectory separately
cmds
=
[]
[
'lms/static/coffee'
,
'cms/static/coffee'
,
'common/static/coffee'
,
'common/static/xmodule'
].
each
do
|
coffee_folder
|
cmds
<<
"node_modules/.bin/coffee --watch --compile
#{
coffee_folder
}
"
end
cmds
# So, instead, we use watchmedo, which works around the problem
"watchmedo shell-command "
+
"--command 'node_modules/.bin/coffee -c ${watch_src_path}' "
+
"--recursive "
+
"--patterns '*.coffee' "
+
"--ignore-directories "
+
"--wait "
+
"."
else
'node_modules/.bin/coffee --compile
*/static
'
'node_modules/.bin/coffee --compile
.
'
end
end
...
...
@@ -75,8 +77,8 @@ namespace :assets do
$stdin
.
gets
end
{
:xmodule
=>
:install_python_prereqs
,
:coffee
=>
:install_node_prereqs
,
{
:xmodule
=>
[
:install_python_prereqs
]
,
:coffee
=>
[
:install_node_prereqs
]
,
:sass
=>
[
:install_ruby_prereqs
,
:preprocess
]}.
each_pair
do
|
asset_type
,
prereq_tasks
|
desc
"Compile all
#{
asset_type
}
assets"
task
asset_type
=>
prereq_tasks
do
...
...
@@ -105,7 +107,8 @@ namespace :assets do
$stdin
.
gets
end
task
:_watch
=>
prereq_tasks
do
# Fully compile before watching for changes
task
:_watch
=>
(
prereq_tasks
+
[
"assets:
#{
asset_type
}
:debug"
])
do
cmd
=
send
(
asset_type
.
to_s
+
"_cmd"
,
watch
=
true
,
debug
=
true
)
if
cmd
.
kind_of?
(
Array
)
cmd
.
each
{
|
c
|
background_process
(
c
)}
...
...
@@ -118,19 +121,18 @@ namespace :assets do
multitask
:sass
=>
'assets:xmodule'
namespace
:sass
do
# In watch mode, sass doesn't immediately compile out of date files,
# so force a recompile first
# Also force xmodule files to be generated before we start watching anything
task
:_watch
=>
[
'assets:sass:debug'
,
'assets:xmodule'
]
multitask
:debug
=>
'assets:xmodule:debug'
end
multitask
:coffee
=>
'assets:xmodule'
namespace
:coffee
do
# Force xmodule files to be generated before we start watching anything
task
:_watch
=>
'assets:xmodule'
multitask
:debug
=>
'assets:xmodule:debug'
end
namespace
:xmodule
do
# Only start the xmodule watcher after the coffee and sass watchers have already started
task
:_watch
=>
[
'assets:coffee:_watch'
,
'assets:sass:_watch'
]
end
end
# This task does the real heavy lifting to gather all of the static
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment