Skip to content

Commit

Permalink
cleanup buildscript
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanmark committed Nov 9, 2016
1 parent 95679f0 commit 4f60f83
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 142 deletions.
File renamed without changes.
93 changes: 93 additions & 0 deletions build.js
@@ -0,0 +1,93 @@
/*
* @file Simple script to automate the deployment of the app.
*/
var fs = require("fs");
var NwBuilder = require('nw-builder');

var buildDir = './build';

/**
* checks if build dir exists and if it doesn't creates it.
*/
if ( !fs.existsSync(buildDir) ) { fs.mkdirSync(buildDir); }

/**
* Setup deploy code preferences
*/
var nw = new NwBuilder({
//chosing files to include, excludes everything else.
files: [
'./frontEnd/**', './interactive_transcription_generator/**',
'./node_modules/**', './config.js', './package.json'
],
//for now only osx64 as need to recompile ffmpeg for other versions.
platforms: ['osx64', 'win64'], // ['osx32', 'osx64', 'win32', 'win64', 'linux32', 'linux64']
// https://github.com/nwjs/nw-builder#optionsmacicns
macIcns: "./nw.icns",
version: '0.12.3', // of nwjs to use
buildDir: buildDir
});

/**
* Building/deploying the app in build folder.
*/
console.log("About to package the app");

nw.build().then(function () {
console.log('Finished packaging the app');
/**
* packaging app in dmg for os x, and placing it on the Desktop.
* `npm install appdmg -g` might require to be installed globally for it to work
* appdmg appdmg.json ~/Desktop/autoEdit2.dmg
* seems like this could be the issue https://github.com/LinusU/node-appdmg/issues/63
*/
///////////////////////////////////////////////////////
//// or spawn process
//// appdmg appdmg.json ~/Desktop/autoEdit2.dmg
// var spawn = require('child_process').spawn;
// var appdmg = spawn('appdmg', ['./appdmg.json', '~/Desktop/autoEdit2.dmg']);

// appdmg.stdout.on('data', function(data) {
// console.log("stdout: " +data);
// });

// appdmg.stderr.on('data', function(data) {
// console.log("stderr:" +data);
// });

// appdmg.on('close', function(code) {
// console.log("child process exited with code" +code);
// });
///////////////////////////////////////////////////////
// var appdmg = require('appdmg');
// var ee = appdmg({ source: './appdmg.json', target: '~/Desktop/autoEdit2.dmg' });

// ee.on('progress', function (info) {
// console.log("progress")
// // console.log(info.current, into.total, info.type)
// // info.current is the current step
// // info.total is the total number of steps
// // info.type is on of 'step-begin', 'step-end'

// // 'step-begin'
// // info.title is the title of the current step

// // 'step-end'
// // info.status is one of 'ok', 'skip', 'fail'
// });

// ee.on('finish', function () {
// // There now is a `test.dmg` file
// console.log("check desktop for .dmg file")
// });

// ee.on('error', function (err) {
// // An error occurred
// console.log("error")
// console.log(err)
// });


}).catch(function (error) {
console.error(error);
});
132 changes: 0 additions & 132 deletions deploy.js

This file was deleted.

23 changes: 13 additions & 10 deletions package.json
Expand Up @@ -21,38 +21,41 @@
"max_width": 1300,
"min_height": 500
},
"platformOverrides": {
"win": { "window": { "toolbar": false } },
"osx": { "window": { "toolbar": false } },
"linux": { "window": { "toolbar": false } }
},
"scripts": {
"test": "jasmine",
"start": "nw",
"build": "node deploy.js",
"make_dmg": "appdmg appdmg.json ~/Desktop/autoEdit2_installer.dmg",
"page": "jekyll serve --source ./docs --destination ./docs/_site --watch",
"docco": "docco -o ./docs/docco_docs --title 'autoEdit 2 Documentation' ./*.js ./frontEnd/*.js ./frontEnd/date_now/*.js ./frontEnd/edl_composer/*.js ./frontEnd/srt/*.js ./frontEnd/js/*.js ./frontEnd/js/models/*.js ./frontEnd/js/views/*.js ./frontEnd/js/collections/*.js ./interactive_transcription_generator/*.js ./interactive_transcription_generator/**/*.js",
"jsdoc": "./node_modules/.bin/jsdoc *.js -c ./docs/jdocs_conf/conf.json"
"docs": "docco -o ./docs/docco_docs --title 'autoEdit 2 Documentation' ./*.js ./frontEnd/*.js ./frontEnd/date_now/*.js ./frontEnd/edl_composer/*.js ./frontEnd/srt/*.js ./frontEnd/js/*.js ./frontEnd/js/models/*.js ./frontEnd/js/views/*.js ./frontEnd/js/collections/*.js ./interactive_transcription_generator/*.js ./interactive_transcription_generator/**/*.js",
"jsdoc": "jsdoc *.js -c ./docs/jdocs_conf/conf.json"
},
"author": "Pietro Passarelli <pietro.passarelli@gmail.com> (http://pietropassarelli.com)",
"license": "ISC",
"dependencies": {
"app-module-path": "^1.1.0",
"appdmg": "^0.4.5",
"backbone": "^1.3.3",
"bingspeech-api-client": "^2.0.1",
"fluent-ffmpeg": "^2.1.0",
"fs-extra": "^0.30.0",
"install": "^0.8.1",
"jquery": "2.1.0",
"jsdoc": "^3.4.1",
"linvodb3": "^3.24.0",
"lodash": "^4.15.0",
"medea": "^1.0.3",
"medeadown": "^1.1.8",
"npm": "^3.10.6",
"nw": "^0.12.3",
"nw-builder": "^2.2.6",
"path": "^0.12.7",
"request": "^2.75.0",
"underscore": "^1.8.3",
"watson-developer-cloud": "^2.4.1"
},
"devDependencies": {}
}
"devDependencies": {
"jsdoc": "^3.4.1",
"appdmg": "^0.4.5",
"nw-builder": "^2.2.6"
}
}

0 comments on commit 4f60f83

Please sign in to comment.