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
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
21 deletions
+23
-21
rakefiles/assets.rake
+23
-21
No files found.
rakefiles/assets.rake
View file @
fdf213f9
...
@@ -10,10 +10,11 @@ def xmodule_cmd(watch=false, debug=false)
...
@@ -10,10 +10,11 @@ def xmodule_cmd(watch=false, debug=false)
xmodule_cmd
=
'xmodule_assets common/static/xmodule'
xmodule_cmd
=
'xmodule_assets common/static/xmodule'
if
watch
if
watch
"watchmedo shell-command "
+
"watchmedo shell-command "
+
"--patterns='*.js;*.coffee;*.sass;*.scss;*.css' "
+
"--patterns='*.js;*.coffee;*.sass;*.scss;*.css' "
+
"--recursive "
+
"--recursive "
+
"--command='
#{
xmodule_cmd
}
' "
+
"--command='
#{
xmodule_cmd
}
' "
+
"common/lib/xmodule"
"--wait "
+
"common/lib/xmodule"
else
else
xmodule_cmd
xmodule_cmd
end
end
...
@@ -27,15 +28,16 @@ def coffee_cmd(watch=false, debug=false)
...
@@ -27,15 +28,16 @@ def coffee_cmd(watch=false, debug=false)
#
#
# Ref: https://github.com/joyent/node/issues/2479
# Ref: https://github.com/joyent/node/issues/2479
#
#
# Rather than watching all of the directories in one command
# So, instead, we use watchmedo, which works around the problem
# watch each static files subdirectory separately
"watchmedo shell-command "
+
cmds
=
[]
"--command 'node_modules/.bin/coffee -c ${watch_src_path}' "
+
[
'lms/static/coffee'
,
'cms/static/coffee'
,
'common/static/coffee'
,
'common/static/xmodule'
].
each
do
|
coffee_folder
|
"--recursive "
+
cmds
<<
"node_modules/.bin/coffee --watch --compile
#{
coffee_folder
}
"
"--patterns '*.coffee' "
+
end
"--ignore-directories "
+
cmds
"--wait "
+
"."
else
else
'node_modules/.bin/coffee --compile
*/static
'
'node_modules/.bin/coffee --compile
.
'
end
end
end
end
...
@@ -75,8 +77,8 @@ namespace :assets do
...
@@ -75,8 +77,8 @@ namespace :assets do
$stdin
.
gets
$stdin
.
gets
end
end
{
:xmodule
=>
:install_python_prereqs
,
{
:xmodule
=>
[
:install_python_prereqs
]
,
:coffee
=>
:install_node_prereqs
,
:coffee
=>
[
:install_node_prereqs
]
,
:sass
=>
[
:install_ruby_prereqs
,
:preprocess
]}.
each_pair
do
|
asset_type
,
prereq_tasks
|
:sass
=>
[
:install_ruby_prereqs
,
:preprocess
]}.
each_pair
do
|
asset_type
,
prereq_tasks
|
desc
"Compile all
#{
asset_type
}
assets"
desc
"Compile all
#{
asset_type
}
assets"
task
asset_type
=>
prereq_tasks
do
task
asset_type
=>
prereq_tasks
do
...
@@ -105,7 +107,8 @@ namespace :assets do
...
@@ -105,7 +107,8 @@ namespace :assets do
$stdin
.
gets
$stdin
.
gets
end
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
)
cmd
=
send
(
asset_type
.
to_s
+
"_cmd"
,
watch
=
true
,
debug
=
true
)
if
cmd
.
kind_of?
(
Array
)
if
cmd
.
kind_of?
(
Array
)
cmd
.
each
{
|
c
|
background_process
(
c
)}
cmd
.
each
{
|
c
|
background_process
(
c
)}
...
@@ -118,19 +121,18 @@ namespace :assets do
...
@@ -118,19 +121,18 @@ namespace :assets do
multitask
:sass
=>
'assets:xmodule'
multitask
:sass
=>
'assets:xmodule'
namespace
:sass
do
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'
multitask
:debug
=>
'assets:xmodule:debug'
end
end
multitask
:coffee
=>
'assets:xmodule'
multitask
:coffee
=>
'assets:xmodule'
namespace
:coffee
do
namespace
:coffee
do
# Force xmodule files to be generated before we start watching anything
task
:_watch
=>
'assets:xmodule'
multitask
:debug
=>
'assets:xmodule:debug'
multitask
:debug
=>
'assets:xmodule:debug'
end
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
end
# This task does the real heavy lifting to gather all of the static
# 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