-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
41 lines (33 loc) · 1.2 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# -*- coding: utf-8 -*-
$projectName = "easyMusic"
$targetName = "MusicFeeling"
$infoFile = "\`pwd\`/#{$targetName}/#{$projectName}-Info"
$revision = `defaults read #{$infoFile} CFBundleVersion`.rstrip
task :default do |t|
puts `defaults read #{$infoFile} CFBundleShortVersionString`
puts "info plist revision: %s" % $revision
puts "git log revision: %s" % `git log --pretty=oneline|wc -l`
end
# for OS X App
task :dmg => :xcode do |t|
tag = `git describe --tag`
filename = "#{name}_%s.dmg" % tag.rstrip
sh "ln -sf /Applications /tmp/#{name}"
sh "rm -rf ~/Downloads/%s" % filename
sh "hdiutil create ~/Downloads/%s -srcfolder /tmp/#{name}" % filename
sh "cp ~/Downloads/%s /tmp" % filename
end
task :tag do |t|
puts `defaults write #{$infoFile} CFBundleShortVersionString 0.8.1`
end
task :tr do |t|
`git diff --cached --name-only | grep .[hm]$ | xargs sed -Ee 's/ +$$//g' -i ""`
`git diff --cached --name-only | grep .[hm]$ | xargs sed -i .bak "s/^[ ]*$//g"`
`git add -u`
`find . -name "*.bak" | xargs rm -f`
end
task :trall do |t|
`find . -name "*.[hm]" | xargs sed -Ee 's/ +$$//g' -i ""`
`find . -name "*.[hm]" | xargs sed -i .bak "s/^[ ]*$//g"`
`find . -name *.bak | xargs rm -f`
end