fix(build): remove dmg task from build

This commit is contained in:
Evan Morikawa 2016-10-28 11:08:09 -04:00
parent 8e97850b1a
commit 3c37e31894
5 changed files with 1 additions and 67 deletions

1
.gitignore vendored
View file

@ -16,7 +16,6 @@ debug.log
docs/output
docs/includes
spec/fixtures/evil-files/
yoursway-create-dmg
/_site
/.sass-cache
.integration-test-config

View file

@ -389,9 +389,6 @@ module.exports = (grunt) ->
ciTasks.push('dump-symbols') if process.platform isnt 'win32'
ciTasks.push('set-version', 'lint', 'generate-asar')
if process.platform is "darwin"
ciTasks.push('test', 'codesign', 'mkdmg')
else if process.platform is "linux"
ciTasks.push('mkdeb')
ciTasks.push('mkrpm')
@ -406,6 +403,5 @@ module.exports = (grunt) ->
grunt.registerTask('ci', ciTasks)
defaultTasks = ['download-electron', 'build', 'set-version', 'generate-asar']
defaultTasks.push 'mkdmg' if process.platform is 'darwin'
defaultTasks.push 'install' unless process.platform is 'linux'
grunt.registerTask('default', defaultTasks)

View file

@ -1,59 +0,0 @@
fs = require 'fs'
path = require 'path'
_ = require 'underscore'
Promise = require("bluebird")
module.exports = (grunt) ->
{spawn, rm} = require('./task-helpers')(grunt)
appName = -> grunt.config.get('nylasGruntConfig.appName')
dmgName = -> "#{appName().split('.')[0]}.dmg"
buildDir = -> grunt.config.get('nylasGruntConfig.buildDir')
dmgPath = -> path.join(buildDir(), dmgName())
appDir = -> path.join(buildDir(), grunt.config.get('nylasGruntConfig.appName'))
getDmgExecutable = ->
new Promise (resolve, reject) ->
dmgMakerRepo = "yoursway-create-dmg"
dmgExecutable = path.join(dmgMakerRepo, "create-dmg")
if fs.existsSync(dmgExecutable) then resolve(dmgExecutable)
else
console.log("---> Downloading yoursway-create-dmg")
spawn
cmd: "git"
args: ["clone", "https://github.com/andreyvit/#{dmgMakerRepo}"]
, (error, results, exitCode) ->
if exitCode is 0 then resolve(dmgExecutable) else reject(error)
removeOldDmg = (dmgExecutable) ->
if fs.existsSync(dmgPath()) then rm dmgPath()
executeDmgMaker = (dmgExecutable) ->
new Promise (resolve, reject) ->
console.log("---> Bulding Nylas DMG")
spawn
cmd: dmgExecutable
args: [
"--volname", "Nylas Installer",
"--volicon", path.join("build", "resources", "nylas.png"),
"--window-pos", "200", "120",
"--window-size", "800", "400",
"--icon-size", "100",
"--icon", appName(), "200", "190",
"--hide-extension", appName(),
"--app-drop-link", "600", "185",
dmgPath()
appDir(),
]
, (error, results, exitCode) ->
if exitCode is 0 then resolve() else reject(error)
grunt.registerTask 'mkdmg', 'Create Mac DMG', ->
done = @async()
removeOldDmg()
getDmgExecutable()
.then(executeDmgMaker)
.then(done)
.catch (error) ->
console.error(error)
done()

View file

@ -13,7 +13,6 @@ module.exports = (grunt) ->
{cp, shouldPublishBuild, spawn, rm} = require('./task-helpers')(grunt)
appName = -> grunt.config.get('nylasGruntConfig.appName')
dmgName = -> "#{appName().split('.')[0]}.dmg"
zipName = -> "#{appName().split('.')[0]}.zip"
winReleasesName = -> "RELEASES"
winSetupName = -> "Nylas N1Setup.exe"
@ -150,7 +149,6 @@ module.exports = (grunt) ->
.then ->
uploadPromises = []
if process.platform is 'darwin'
uploadPromises.push uploadToS3(dmgName(), "#{fullVersion}/#{process.platform}/#{process.arch}/N1.dmg")
uploadPromises.push uploadZipToS3(appName(), "#{fullVersion}/#{process.platform}/#{process.arch}/N1.zip")
else if process.platform is 'win32'

@ -1 +1 @@
Subproject commit 7c2183bcb23c0a89bb5ec43e96b8a933f8b8b36f
Subproject commit 8264db5540fca5460a356728e56d0a19e8f45d9e