Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F85921
prepare.rb
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
prepare.rb
View Options
#!/usr/bin/ruby
# create the following files
# * version.c
# * win.rc
# * Info.plist
load
'version.rb'
def
get_revision
()
rev
=
""
if
Dir
.
exist?
(
".git"
)
hash
=
`git rev-parse HEAD`
if
hash
=~
/^[0-9A-Za-z]+/
rev
=
hash
[
0
,
7
]
end
end
return
rev
end
File
.
open
(
"src/version.h"
,
"w"
)
{
|
f
|
f
.
puts
<<
_____
int copyright_year = #{$copyright_year};
char const product_version[] = "#{$version_a}.#{$version_b}.#{$version_c}";
char const source_revision[] = "#{get_revision()}";
_____
}
File
.
open
(
"win.rc"
,
"w"
)
{
|
f
|
f
.
puts
<<
_____
#include <windows.h>
100 ICON DISCARDABLE "src/resources/#{$product_name}.ico"
VS_VERSION_INFO VERSIONINFO
FILEVERSION #{$version_a},#{$version_b},#{$version_c},#{$version_d}
PRODUCTVERSION #{$version_a},#{$version_b},#{$version_c},#{$version_d}
FILEFLAGSMASK 0x3fL
FILEFLAGS 0x0L
FILEOS 0x4L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "041103a4"
BEGIN
VALUE "CompanyName", "S.Fuchita"
VALUE "FileDescription", "The Git GUI Client"
VALUE "FileVersion", "#{$version_a}, #{$version_b}, #{$version_c}, #{$version_d}"
VALUE "InternalName", "#{$product_name}.exe"
VALUE "LegalCopyright", "Copyright (C) #{$copyright_year} S.Fuchita (@soramimi_jp)"
VALUE "OriginalFilename","#{$product_name}.exe"
VALUE "ProductName", "#{$product_name}"
VALUE "ProductVersion", "#{$version_a}, #{$version_b}, #{$version_c}, #{$version_d}"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0411, 932
END
END
_____
}
File
.
open
(
"Info.plist"
,
"w"
)
{
|
f
|
f
.
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>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSHighResolutionCapable</key>
<string>True</string>
<key>CFBundleIconFile</key>
<string>#{$product_name}.icns</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleGetInfoString</key>
<string>#{$version_a}.#{$version_b}.#{$version_c}</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleExecutable</key>
<string>#{$product_name}</string>
<key>CFBundleIdentifier</key>
<string>jp.soramimi.#{$product_name}</string>
</dict>
</plist>
_____
}
File Metadata
Details
Attached
Mime Type
text/x-ruby
Expires
Thu, Sep 4, 1:24 PM (4 d, 1 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
42511
Default Alt Text
prepare.rb (2 KB)
Attached To
Mode
R77 Guitar
Attached
Detach File
Event Timeline
Log In to Comment