Skip to content

Commit

Permalink
Remove useless tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
akovalyov committed Nov 16, 2015
1 parent e2033af commit 443d831
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 128 deletions.
6 changes: 1 addition & 5 deletions tasks/download.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,7 @@ downloaded =
, ->
downloaded[dist] = true

# Also rename the .app on darwin
if dist is 'darwin64'
fs.rename './build/darwin64/Electron.app', './build/darwin64/' + manifest.productName + '.app', done
else
done()
done()

# Download the Electron binaries for all platforms
gulp.task 'download', [
Expand Down
125 changes: 2 additions & 123 deletions tasks/pack.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -12,60 +12,6 @@ zip = require 'gulp-zip'
winInstaller = require 'electron-windows-installer'
manifest = require '../src/package.json'

# Sign the app and create a dmg for darwin64; only works on OS X because of appdmg and codesign
gulp.task 'pack:darwin64', ['build:darwin64', 'clean:dist:darwin64'], (done) ->
if process.platform isnt 'darwin'
console.warn 'Skipping darwin64 packing; This only works on darwin due to `appdmg` and the `codesign` command.'
return done()

try
appdmg = require 'appdmg'
catch ex
console.warn 'Skipping darwin64 packing; `appdmg` not installed.'
return done()

for envName in ['SIGN_DARWIN_KEYCHAIN_PASSWORD', 'SIGN_DARWIN_KEYCHAIN_NAME', 'SIGN_DARWIN_IDENTITY']
if not process.env[envName]
console.warn envName + ' env var not set.'
return done()

async.series [
# First, compress the source files into an asar archive
async.apply asar.createPackage,
'./build/darwin64/' + manifest.productName + '.app/Contents/Resources/app',
'./build/darwin64/' + manifest.productName + '.app/Contents/Resources/app.asar'

# Remove leftovers
async.apply del, './build/darwin64/' + manifest.productName + '.app/Contents/Resources/app'

# Unlock the keychain
async.apply cp.exec, [
'security'
'unlock-keychain'
'-p'
process.env.SIGN_DARWIN_KEYCHAIN_PASSWORD
process.env.SIGN_DARWIN_KEYCHAIN_NAME
].join(' ')

# Sign the app package
async.apply cp.exec, [
'codesign'
'--deep'
'--force'
'--verbose'
'--sign "' + process.env.SIGN_DARWIN_IDENTITY + '"'
'./build/darwin64/' + manifest.productName + '.app'
].join(' ')

# Create the dmg
(callback) ->
appdmg
source: './build/resources/darwin/dmg.json'
target: './dist/' + manifest.productName + '.dmg'
.on 'finish', callback
.on 'error', callback
], done

# Create deb and rpm packages for linux32 and linux64
[32, 64].forEach (arch) ->
['deb', 'rpm'].forEach (target) ->
Expand Down Expand Up @@ -118,77 +64,10 @@ gulp.task 'pack:darwin64', ['build:darwin64', 'clean:dist:darwin64'], (done) ->
async.apply cp.exec, 'fpm ' + args.join(' ')
], done

# Create the win32 installer; only works on Windows
gulp.task 'pack:win32:installer', ['build:win32', 'clean:dist:win32'], (done) ->
if process.platform isnt 'win32'
return console.warn 'Skipping win32 installer packing; This only works on Windows due to Squirrel.Windows.'

for envName in ['SIGN_WIN_CERTIFICATE_FILE', 'SIGN_WIN_CERTIFICATE_PASSWORD']
if not process.env[envName]
return console.warn envName + ' env var not set.'

async.series [
# First, compress the source files into an asar archive
# async.apply asar.createPackage, './build/win32/resources/app', './build/win32/resources/app.asar'

# Remove leftovers
# async.apply del, './build/win32/resources/app'

# Create the installer
(callback) ->
winInstaller
appDirectory: './build/win32'
outputDirectory: './dist'
loadingGif: './build/resources/win/install-spinner.gif'
certificateFile: process.env.SIGN_WIN_CERTIFICATE_FILE
certificatePassword: process.env.SIGN_WIN_CERTIFICATE_PASSWORD
setupIcon: './build/resources/win/setup.ico'
iconUrl: '/build/resources/win/app.ico'
remoteReleases: manifest.repository.url
.then callback, callback
], done

# Create the win32 portable zip
gulp.task 'pack:win32:portable', ['build:win32', 'clean:dist:win32'], (done) ->
if process.platform isnt 'win32'
console.warn 'Skipping win32 portable packing; This only works on Windows due to signtool.'
return done()

for envName in ['SIGN_WIN_CERTIFICATE_FILE', 'SIGN_WIN_CERTIFICATE_PASSWORD']
if not process.env[envName]
console.warn envName + ' env var not set.'
return done()

async.series [
# First, compress the source files into an asar archive
async.apply asar.createPackage, './build/win32/resources/app', './build/win32/resources/app.asar'

# Remove leftovers
async.apply del, './build/win32/resources/app'

# Sign the exe
(callback) ->
cp.exec [
if process.env.SIGNTOOL_PATH then '"' + process.env.SIGNTOOL_PATH + '"' else 'signtool'
'sign'
'/f ' + process.env.SIGN_WIN_CERTIFICATE_FILE
'/p ' + process.env.SIGN_WIN_CERTIFICATE_PASSWORD
path.win32.resolve './build/win32/' + manifest.productName + '.exe'
].join(' '), callback

# Archive the files
(callback) ->
gulp.src './build/win32/**/*'
.pipe zip manifest.name + '-win32-portable.zip'
.pipe gulp.dest './dist'
.on 'end', callback
], done

# Pack for all the platforms
gulp.task 'pack', [
'pack:darwin64'
'pack:linux32:deb'
'pack:linux64:deb'
'pack:win32:installer'
'pack:win32:portable'
'pack:linux32:rpm'
'pack:linux64:rpm'
]

0 comments on commit 443d831

Please sign in to comment.