mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Merge pull request #1089 from atom/cz-win32-icon
Set version strings and icon for the exe on Windows
This commit is contained in:
@@ -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'])
|
||||
|
||||
@@ -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
BIN
resources/win/atom.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 345 KiB |
@@ -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...)
|
||||
|
||||
@@ -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)
|
||||
|
||||
12
tasks/set-exe-icon-task.coffee
Normal file
12
tasks/set-exe-icon-task.coffee
Normal 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)
|
||||
Reference in New Issue
Block a user