-
Notifications
You must be signed in to change notification settings - Fork 2
/
generate_info_plist.rb
executable file
·54 lines (46 loc) · 1.48 KB
/
generate_info_plist.rb
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env ruby
most_recent_tag, tag_rev_count = `git tag`.
split("\n").
map {|tag| [tag, `git rev-list #{tag}`.count("\n")]}.
max {|a, b| a[1] <=> b[1]}
rev_list = `git rev-list HEAD`
head_rev_num = rev_list.count "\n"
short_version = most_recent_tag
long_version = most_recent_tag + ".#{head_rev_num - tag_rev_count}"
git_revision = `git rev-parse --short=4 HEAD`.chop
puts %+<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>net.pixelshed.ipfwpane</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>ipfw Firewall</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>#{short_version}</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>#{long_version}</string>
<key>FWGitRevision</key>
<string>#{git_revision}</string>
<key>NSMainNibFile</key>
<string>ipfwPanePref</string>
<key>NSPrefPaneIconFile</key>
<string>ipfwPanePref.png</string>
<key>NSPrefPaneIconLabel</key>
<string>ipfw Firewall</string>
<key>NSPrincipalClass</key>
<string>FWPrefPane</string>
</dict>
</plist>+