Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Can I use a FileList as a dependency to a rake task?

$
0
0
I'm using rake to help compile Coffeescript for a Chrome extension I'm writing.

My Rakefile looks like this:

COFFEE = FileList['src/*.coffee']
JS = COFFEE.ext 'js'

directory 'extension'

rule '.js' => ['.coffee', 'extension'] do |t|
  `coffee -c -o extension #{t.source}`
end

desc "Build the extension in the 'extension' directory"
task :build => ['extension', JS] do
  cp File.join('src', 'manifest.json'), 'extension'
end



When I only have one .coffee file in my src directory, there's no problem. But as soon as I have more than one .coffee files it errors:

$ rake build
> rake aborted!
> Don't know how to build task 'src/app.js src/background.js'
>
> Tasks: TOP => build
> (See full trace by running task with --trace)



Is it possible to specify a FileList as a dependency? How else would I tell rake that I want all my Coffeescript files compiled durring the build task?

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>