                 .pipe zip "yakyak-#{platform}-#{arch}-#{json.version}.zip"
                 .pipe gulp.dest outdeploy
                 .pipe gulpCallback ()->
-                    fun()
+                    deferred.resolve()
+    deferred.promise

        'icon_256.png': 'icon@16.png'
        'icon_512.png': 'icon@32.png'

    Object.keys(nameMap).forEach (name) ->
        gulp.src path.join paths.icons, name
            .pipe rename nameMap[name]
            .pipe gulp.dest path.join outapp, 'icons'

# compile less
gulp.task 'less', ->

buildDeployTask = (platform, arch) ->
    # create a task per platform
    taskname = "deploy:#{platform}-#{arch}"
    tasknameNoDep = "#{taskname}:nodep"
    # set internal task with _ (does not have dependencies)
    gulp.task tasknameNoDep, ()->
        deploy platform, arch
    # set task with dependencies
    gulp.task taskname, gulp.series('default', tasknameNoDep)
    #
    tasknameNoDep

#
# task to deploy all
allNames = []
#
# create tasks for different platforms and architectures supported
platformOpts.map (plat) ->
    names = []
    archOpts.map (arch) ->
        # create a task per platform/architecture
        taskName = buildDeployTask(plat, arch)
        names.push taskName
        allNames.push taskName
    #
    # create arch-independet task
    gulp.task "deploy:#{plat}", gulp.series('default', gulp.parallel(names))
    #
gulp.task 'deploy', gulp.series('default', allNames)

#
#
deploy = (platform, arch) ->
    deferred = Q.defer()
    opts = deploy_options
    opts.platform = platform
    opts.arch = arch
    #
    # restriction darwin won't compile ia32
    if platform == 'darwin' && arch == 'ia32'
        deferred.resolve()
        deferred.promise
    #
    # necessary to add a callback to pipe (which is used to signal end of task)
    gulpCallback = (obj) ->
