Merge pull request #4170 from atom/ks-use-grunt-installer-plugin

Use Grunt plugin to build Windows installer
This commit is contained in:
Kevin Sawicki
2014-11-13 09:07:06 -08:00
14 changed files with 9 additions and 78 deletions

View File

@@ -25,6 +25,7 @@ module.exports = (grunt) ->
grunt.loadNpmTasks('grunt-markdown')
grunt.loadNpmTasks('grunt-shell')
grunt.loadNpmTasks('grunt-download-atom-shell')
grunt.loadNpmTasks('grunt-atom-shell-installer')
grunt.loadNpmTasks('grunt-peg')
grunt.loadTasks('tasks')
@@ -220,6 +221,12 @@ module.exports = (grunt) ->
downloadDir: atomShellDownloadDir
rebuild: true # rebuild native modules after atom-shell is updated
'create-windows-installer':
appDirectory: shellAppDir
outputDirectory: path.join(buildDir, 'installer')
authors: 'The Atom Team & Community'
iconUrl: 'https://raw.githubusercontent.com/atom/atom/master/resources/atom.png'
shell:
'kill-atom':
command: killCommand

View File

@@ -12,6 +12,7 @@
"fs-plus": "2.x",
"github-releases": "~0.2.0",
"grunt": "~0.4.1",
"grunt-atom-shell-installer": "^0.6.0",
"grunt-cli": "~0.1.9",
"grunt-coffeelint": "git+https://github.com/atom/grunt-coffeelint.git#cfb99aa99811d52687969532bd5a98011ed95bfe",
"grunt-contrib-coffee": "~0.9.0",

View File

@@ -36,7 +36,7 @@ module.exports = (grunt) ->
spawn {cmd, args}, (error) ->
return callback(error) if error?
setupExePath = path.join(grunt.config.get('atom.shellAppDir'), '..', 'Releases', 'setup.exe')
setupExePath = path.resolve(grunt.config.get('atom.buildDir'), 'installer', 'AtomSetup.exe')
if fs.isFileSync(setupExePath)
args = [setupExePath]
spawn {cmd, args}, (error) -> callback(error)

View File

@@ -1,46 +0,0 @@
fs = require 'fs'
path = require 'path'
_ = require 'underscore-plus'
module.exports = (grunt) ->
{spawn, rm} = require('./task-helpers')(grunt)
grunt.registerTask 'create-installer', 'Create the Windows installer', ->
return unless process.platform is 'win32'
done = @async()
buildDir = grunt.config.get('atom.buildDir')
atomDir = path.join(buildDir, 'Atom')
releasesDir = path.join(buildDir, 'Releases')
atomGitHubToken = process.env.ATOM_ACCESS_TOKEN
packageInfo = grunt.file.readJSON(path.join(atomDir, 'resources', 'app', 'package.json'))
inputTemplate = grunt.file.read(path.join('build', 'windows', 'atom.nuspec.erb'))
# NB: Build server has some sort of stamp on the version number
packageInfo.version = packageInfo.version.replace(/-.*$/, '')
targetNuspecPath = path.join(buildDir, 'atom.nuspec')
grunt.file.write(targetNuspecPath, _.template(inputTemplate, packageInfo))
# We use the previous releases to build deltas for the current release,
# sync down the existing releases directory by rolling through GitHub releases
cmd = 'build/windows/SyncGitHubReleases.exe'
args = ['-r', releasesDir, '-u', 'https://github.com/atom/atom', '-t', atomGitHubToken]
spawn {cmd, args}, (error, result, code) ->
if error?
grunt.log.error "ATOM_ACCESS_TOKEN environment variable not set or invalid, can't download old releases; continuing anyways"
cmd = 'build/windows/nuget.exe'
args = ['pack', targetNuspecPath, '-BasePath', atomDir, '-OutputDirectory', buildDir]
spawn {cmd, args}, (error, result, code) ->
return done(error) if error?
pkgs = pkg for pkg in fs.readdirSync(buildDir) when path.extname(pkg) is '.nupkg'
cmd = 'build/windows/update.com'
args = ['--releasify', path.join(buildDir, pkgs), '-r', releasesDir, '-g', 'build/windows/install-spinner.gif']
spawn {cmd, args}, (error, result, code) -> done(error)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,31 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id><%= name %></id>
<version><%= version %></version>
<authors>The Atom Community</authors>
<owners>The Atom Community</owners>
<iconUrl>https://raw.githubusercontent.com/atom/atom/master/resources/win/atom.ico</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description><%= description %></description>
</metadata>
<files>
<file src="locales\**" target="lib\net45\locales" />
<file src="resources\**" target="lib\net45\resources" />
<file src="*.pak" target="lib\net45" />
<file src="atom.exe" target="lib\net45\atom.exe" />
<file src="atom.exe.gui" target="lib\net45\atom.exe.gui" />
<file src="chromiumcontent.dll" target="lib\net45\chromiumcontent.dll" />
<file src="d3dcompiler_43.dll" target="lib\net45\d3dcompiler_43.dll" />
<file src="ffmpegsumo.dll" target="lib\net45\ffmpegsumo.dll" />
<file src="icudtl.dat" target="lib\net45\icudtl.dat" />
<file src="libEGL.dll" target="lib\net45\libEGL.dll" />
<file src="libGLESv2.dll" target="lib\net45\libGLESv2.dll" />
<file src="LICENSE" target="lib\net45\LICENSE" />
<file src="msvcp120.dll" target="lib\net45\msvcp120.dll" />
<file src="msvcr120.dll" target="lib\net45\msvcr120.dll" />
<file src="vccorlib120.dll" target="lib\net45\vccorlib120.dll" />
<file src="version" target="lib\net45\version" />
<file src="xinput1_3.dll" target="lib\net45\xinput1_3.dll" />
</files>
</package>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB