Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Appveyor windows build #187

Merged
merged 8 commits into from
Nov 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
videojs-record changelog
========================

2.0.3 - unreleased
------------------

- Fix Windows build (#186)


2.0.2 - 2017/11/15
------------------

Expand Down
20 changes: 20 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
environment:
matrix:
- nodejs_version: '8'
- nodejs_version: '6'
install:
- ps: Install-Product node $env:nodejs_version
- set CI=true
- npm install --global npm@latest
- set PATH=%APPDATA%\npm;%PATH%
- npm install
matrix:
fast_finish: true
build: off
shallow_clone: true
test_script:
- node --version
- npm --version
- npm test
cache:
- '%APPDATA%\npm-cache'
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"build:css:sass": "node-sass --include-path src/css src/css/videojs.record.scss dist/css/videojs.record.css",
"build:css:comb": "csscomb dist/css/videojs.record.css",
"build:css:compress": "cleancss -o dist/css/videojs.record.min.css dist/css/videojs.record.css",
"build:css:banner": "node scripts/add-banner.js dist/css/videojs.record*.css",
"build:css:banner": "node scripts/add-banner.js 'dist/css/videojs.record*.css'",
"build:js": "npm-run-all build:js:babel build:js:browserify build:js:version build:js:collapse build:js:uglify build:js:banner build:js:plugins build:js:language",
"build:js:babel": "babel src/js --out-dir es5",
"build:js:version": "node scripts/update-version.js",
Expand Down
19 changes: 10 additions & 9 deletions scripts/add-banner.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
*/

var fs = require('fs');
var path = require('path');
var glob = require('glob')
var moment = require('moment');
var banner = require('add-banner');

Expand All @@ -15,34 +17,33 @@ var infile, fpath, result;
var pjson = JSON.parse(fs.readFileSync('package.json', 'utf8'));

// check command-line arguments
if (process.argv.length < 3) {
if (process.argv.length != 3) {
console.error("Error: no input file(s) specified");
process.exit();
}

// process multiple files
process.argv.forEach(function (fpath, index, array) {
if (index > 1) {
glob(process.argv[2], function (er, files) {
files.forEach(function(fpath) {

infile = fs.readFileSync(fpath, 'utf8');
if (fpath.endsWith(CSS)) {
// CSS
result = banner(infile, {
banner: 'scripts/banner.css',
banner: path.resolve('scripts', 'banner.css'),
pkg: pjson
});
fs.writeFile(fpath, result);

} else if (fpath.endsWith(JS)) {
// javascript
result = banner(infile, {
banner: 'scripts/banner.ejs',
banner: path.resolve('scripts', 'banner.ejs'),
pkg: pjson,
moment: moment
});
fs.writeFile(fpath, result);
}
console.info('Added banner to ' + fpath);
}
});
});


12 changes: 6 additions & 6 deletions scripts/build-plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ var collapse = require('bundle-collapser/plugin');
var color = require('colour');
var mkdirp = require('mkdirp');

var pluginsDestDir = 'dist/plugins/';
var bannerPath = 'scripts/banner.ejs';
var pluginsDestDir = path.join('dist', 'plugins');
var bannerPath = path.join('scripts', 'banner.ejs');
var fileName, dirName, pluginName, minifiedName, pluginDestPath,
pluginDestPathMinified, browserify_opts, pjson, bundler;

Expand All @@ -34,12 +34,12 @@ mkdirp(pluginsDestDir, function(err) {
console.log(color.green('OK') + ': Build ' + files.length + ' plugins');

files.forEach(function(pluginPath) {
fileName = pluginPath.substr(pluginPath.lastIndexOf('/') + 1);
dirName = pluginPath.split(fileName)[0];
fileName = path.basename(pluginPath);
dirName = path.dirname(pluginPath);
pluginName = fileName.replace('-plugin.js', '');
minifiedName = fileName.replace('-plugin.js', '.min.js');
pluginDestPath = pluginsDestDir + 'videojs.record.' + pluginName + '.js';
pluginDestPathMinified = pluginsDestDir + 'videojs.record.' + minifiedName;
pluginDestPath = path.join(pluginsDestDir, 'videojs.record.' + pluginName + '.js');
pluginDestPathMinified = path.join(pluginsDestDir, 'videojs.record.' + minifiedName);
browserify_opts = {
standalone: pluginName,
plugin: [
Expand Down
6 changes: 5 additions & 1 deletion scripts/update-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@
*/

var fs = require('fs');
var path = require('path');
var color = require('colour');
var replace = require('replace');
var pjson = JSON.parse(fs.readFileSync('package.json', 'utf8'));
var version = pjson.version;

replace({
regex: "Record.VERSION = 'dev';",
replacement: "Record.VERSION = '" + version + "';",
paths: ['./dist/videojs.record.js'],
paths: [path.resolve('dist', 'videojs.record.js')],
silent: true
});

console.log(color.green('OK') + ': Version updated to ' + version);