pulsar/script/build.js
2016-08-02 09:24:02 +02:00

42 lines
1.4 KiB
JavaScript
Executable File

#!/usr/bin/env node
'use strict'
// Needed so we can require src/module-cache.coffee during generateModuleCache
require('coffee-script/register')
const argv = require('yargs').argv
const cleanOutputDirectory = require('./lib/clean-output-directory')
const codeSign = require('./lib/code-sign')
const copyAssets = require('./lib/copy-assets')
const dumpSymbols = require('./lib/dump-symbols')
const generateMetadata = require('./lib/generate-metadata')
const generateModuleCache = require('./lib/generate-module-cache')
const packageApplication = require('./lib/package-application')
const prebuildLessCache = require('./lib/prebuild-less-cache')
const transpileBabelPaths = require('./lib/transpile-babel-paths')
const transpileCoffeeScriptPaths = require('./lib/transpile-coffee-script-paths')
const transpileCsonPaths = require('./lib/transpile-cson-paths')
const transpilePegJsPaths = require('./lib/transpile-peg-js-paths')
const writeFingerprint = require('./lib/fingerprint').writeFingerprint
cleanOutputDirectory()
copyAssets()
transpileBabelPaths()
transpileCoffeeScriptPaths()
transpileCsonPaths()
transpilePegJsPaths()
generateModuleCache()
prebuildLessCache()
generateMetadata()
writeFingerprint()
dumpSymbols()
.then(packageApplication)
.then(packagedAppPath => {
if (argv.codeSign) {
codeSign(packagedAppPath)
} else {
console.log('Skipping code-signing. Specify --code-sign option to perform code-signing...')
}
})