Skip to content

Commit

Permalink
Chrome 拡張と Opera 拡張を同じブランチで管理しやすいようにビルドタスクなどを作る
Browse files Browse the repository at this point in the history
src ディレクトリの中に、共通のファイルを入れる main ディレクトリと、
それぞれのブラウザ用のファイルを入れるディレクトリを置いておき、
Rake タスクでファイルコピーして obj ディレクトリの中にそれぞれの
ブラウザ用に必要なファイルをまとめて配置する、という仕組みにする。
  • Loading branch information
nobuoka committed Jul 3, 2013
1 parent 5137521 commit 72be43d
Show file tree
Hide file tree
Showing 107 changed files with 37 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "src/tests/submodule-qunit"]
path = src/tests/submodule-qunit
[submodule "src/main/tests/submodule-qunit"]
path = src/main/tests/submodule-qunit
url = git://github.com/jquery/qunit.git
38 changes: 35 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,42 @@ namespace :manifest do
end
end

desc "リリース用の zip ファイルを生成する"
task :package do
# 指定のディレクトリ (複数) の中にあるファイル全てを
# 別のディレクトリの中にコピーするためのタスクを定義する。
def setup_filecopy_task(taskname, obj_dir_path_str, src_dir_path_strs)
obj_dir = Pathname.new(obj_dir_path_str)
obj_file_path_strs = []
src_dir_path_strs.each do |src_dir_path_str|
src_dir_pathname = Pathname.new(src_dir_path_str)
Pathname.glob(src_dir_pathname.to_s + '/**/*') do |pathname|
src_str = pathname.to_s
dist = obj_dir + pathname.relative_path_from(src_dir_pathname)
dist_str = dist.to_s
if pathname.directory?
directory dist_str
else
file dist_str => [ dist.dirname.to_s, src_str ] do |t|
cp src_str, t.name
end
end
obj_file_path_strs << dist
end
end

directory obj_dir_path_str
task taskname => [ obj_dir.to_s ] + obj_file_path_strs
end

setup_filecopy_task(:filecopy_chrome, 'obj/chrome', [ 'src/main', 'src/chrome' ])

task :filecopy => [ :filecopy_chrome ]

desc "Chrome 拡張リリース用の zip ファイルを生成する"
task :package_chrome => [ :filecopy_chrome ] do
# TODO src_path を使うように
# TODO output_path を使うように
# TODO project_name を使うように
sh 'find src | grep -v \'^src/tests\\(/\\|$\\)\' | xargs zip bookmark-googlechrome-extension.zip'
sh 'find obj/chrome | grep -v \'^obj/chrome/tests\\(/\\|$\\)\' | xargs zip bookmark-googlechrome-extension.zip'
end

task :package => [ :package_chrome ]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 72be43d

Please sign in to comment.