Merge pull request #1089 from atom/cz-win32-icon

Set version strings and icon for the exe on Windows
This commit is contained in:
Cheng Zhao
2013-11-06 17:07:46 -08:00
6 changed files with 43 additions and 9 deletions

View File

@@ -188,8 +188,4 @@ module.exports = (grunt) ->
grunt.registerTask('ci', ['update-atom-shell', 'build', 'set-development-version', 'lint', 'test'])
grunt.registerTask('deploy', ['partial-clean', 'update-atom-shell', 'build', 'codesign'])
grunt.registerTask('docs', ['markdown:guides', 'build-docs'])
defaultTasks = ['update-atom-shell', 'build']
defaultTasks.push('set-development-version') if process.platform is 'darwin'
defaultTasks.push('install')
grunt.registerTask('default', defaultTasks)
grunt.registerTask('default', ['update-atom-shell', 'build', 'set-development-version', 'install'])

View File

@@ -59,7 +59,8 @@
"grunt-shell": "~0.3.1",
"jasmine-node": "git://github.com/kevinsawicki/jasmine-node.git#short-stacks",
"request": "~2.27.0",
"unzip": "~0.1.9"
"unzip": "~0.1.9",
"rcedit": "~0.1.1"
},
"packageDependencies" : {
"atom-light-ui": "0.6.0",

BIN
resources/win/atom.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 345 KiB

View File

@@ -60,4 +60,5 @@ module.exports = (grunt) ->
dependencies = ['compile']
dependencies.push('copy-info-plist') if process.platform is 'darwin'
dependencies.push('set-exe-icon') if process.platform is 'win32'
grunt.task.run(dependencies...)

View File

@@ -1,8 +1,32 @@
path = require 'path'
module.exports = (grunt) ->
{spawn} = require('./task-helpers')(grunt)
grunt.registerTask 'set-development-version', 'Sets version to current SHA-1', ->
done = @async()
cmd = 'script/set-version'
args = [grunt.config.get('atom.buildDir')]
spawn {cmd, args}, (error, result, code) -> done(error)
if process.platform is 'darwin'
cmd = 'script/set-version'
args = [grunt.config.get('atom.buildDir')]
spawn {cmd, args}, (error, result, code) -> done(error)
else if process.platform is 'win32'
shellAppDir = grunt.config.get('atom.shellAppDir')
shellExePath = path.join(shellAppDir, 'atom.exe')
cmd = 'git'
args = ['rev-parse', '--short', 'HEAD']
spawn {cmd, args}, (error, result, code) ->
if error?
done(error)
else
version = result.stdout.trim()
strings =
CompanyName: 'GitHub, Inc.'
FileDescription: 'The hackable, collaborative editor of tomorrow!'
LegalCopyright: 'Copyright (C) 2013 GitHub, Inc. All rights reserved'
ProductName: 'Atom'
ProductVersion: version
rcedit = require('rcedit')
rcedit(shellExePath, {'version-string': strings}, done)

View File

@@ -0,0 +1,12 @@
path = require 'path'
module.exports = (grunt) ->
grunt.registerTask 'set-exe-icon', 'Set icon of the exe', ->
done = @async()
shellAppDir = grunt.config.get('atom.shellAppDir')
shellExePath = path.join(shellAppDir, 'atom.exe')
iconPath = path.resolve(__dirname, '..', 'resources', 'win', 'atom.ico')
rcedit = require('rcedit')
rcedit(shellExePath, {'icon': iconPath}, done)