【发布时间】:2012-05-10 08:17:02
【问题描述】:
我有一个项目,其中包含许多供应商的 javascript,例如jQuery。我将这些脚本作为 git 子模块包含在内。但是,对于我的构建过程,我需要构建的脚本,而不是该脚本的整个存储库。所以我试图设置一个 rake 任务来构建每个脚本 - 最好使用脚本自己的 rakefile - 然后将构建的脚本复制到我的资产目录中。
file "app/vendor/scriptname.js" do
# Call the task that builds the script here
sh "cp app/vendor/script-submodule/dist/scriptname.js app/vendor/"
end
desc "Make vendor scripts available for build"
task :vendor => "app/vendor/scriptname.js" do
end
如果我在我的 Rakefile 中使用 import 'app/vendor/scriptname/Rakefile',我应该可以访问构建脚本的 rake 任务,对吗?我该怎么称呼它?还是我应该只使用sh "cd app/vendor/script-submodule/ && rake dist" 并称其为好?
【问题讨论】:
标签: rake git-submodules rake-task rakefile