Run javascript build on travis ci (#6)
* Add js build to travis * Cleanup JS * Reduce package.json for now * Reduce package.json for now * Remove ng-annotate as we don't minify code and it fails on travis cis node version * Ignore tests for now
This commit is contained in:
@@ -21,8 +21,12 @@ before_install:
|
|||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- cd apps/deck
|
- cd apps/deck
|
||||||
|
- make install-npm-deps-dev
|
||||||
|
|
||||||
script:
|
script:
|
||||||
|
- node --version
|
||||||
|
- npm --version
|
||||||
|
- make build-js
|
||||||
- make test
|
- make test
|
||||||
|
|
||||||
after_failure:
|
after_failure:
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ module.exports = function(grunt) {
|
|||||||
grunt.loadNpmTasks('grunt-contrib-watch');
|
grunt.loadNpmTasks('grunt-contrib-watch');
|
||||||
grunt.loadNpmTasks('grunt-contrib-jshint');
|
grunt.loadNpmTasks('grunt-contrib-jshint');
|
||||||
grunt.loadNpmTasks('grunt-wrap');
|
grunt.loadNpmTasks('grunt-wrap');
|
||||||
grunt.loadNpmTasks('grunt-ng-annotate');
|
|
||||||
grunt.loadNpmTasks('grunt-karma');
|
grunt.loadNpmTasks('grunt-karma');
|
||||||
grunt.loadNpmTasks('grunt-phpunit');
|
grunt.loadNpmTasks('grunt-phpunit');
|
||||||
|
|
||||||
@@ -115,18 +114,10 @@ module.exports = function(grunt) {
|
|||||||
reporters: ['progress']
|
reporters: ['progress']
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
ngAnnotate: {
|
|
||||||
app: {
|
|
||||||
src: ['<%= meta.productionJS %>app.js'],
|
|
||||||
dest: '<%= meta.productionJS %>app.js'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// make tasks available under simpler commands
|
// make tasks available under simpler commands
|
||||||
grunt.registerTask('build', ['jshint', 'concat', 'wrap', 'ngAnnotate']);
|
grunt.registerTask('build', ['jshint', 'concat', 'wrap']);
|
||||||
grunt.registerTask('js-unit', ['karma:continuous']);
|
grunt.registerTask('js-unit', ['karma:continuous']);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
100
js/gulpfile.js
100
js/gulpfile.js
@@ -1,100 +0,0 @@
|
|||||||
/*
|
|
||||||
* @copyright Copyright (c) 2016 Julius Härtl <jus@bitgrid.net>
|
|
||||||
*
|
|
||||||
* @author Julius Härtl <jus@bitgrid.net>
|
|
||||||
*
|
|
||||||
* @license GNU AGPL version 3 or any later version
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*jslint node: true */
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
const gulp = require('gulp'),
|
|
||||||
ngAnnotate = require('gulp-ng-annotate'),
|
|
||||||
uglify = require('gulp-uglify'),
|
|
||||||
jshint = require('gulp-jshint'),
|
|
||||||
KarmaServer = require('karma').Server,
|
|
||||||
phpunit = require('gulp-phpunit'),
|
|
||||||
concat = require('gulp-concat'),
|
|
||||||
sourcemaps = require('gulp-sourcemaps');
|
|
||||||
|
|
||||||
// Configuration
|
|
||||||
const buildTarget = 'app.min.js';
|
|
||||||
const phpunitConfig = __dirname + '/../phpunit.xml';
|
|
||||||
const karmaConfig = __dirname + '/karma.conf.js';
|
|
||||||
const destinationFolder = __dirname + '/build/';
|
|
||||||
const sources = [
|
|
||||||
'app/App.js', 'app/Config.js', 'app/Run.js',
|
|
||||||
'controller/**/*.js',
|
|
||||||
'filter/**/*.js',
|
|
||||||
'service/**/*.js',
|
|
||||||
'gui/**/*.js',
|
|
||||||
'plugin/**/*.js',
|
|
||||||
'utility/**/*.js',
|
|
||||||
'directive/**/*.js'
|
|
||||||
];
|
|
||||||
const testSources = ['tests/**/*.js'];
|
|
||||||
const phpSources = ['../**/*.php', '!../js/**', '!../vendor/**'];
|
|
||||||
const watchSources = sources.concat(testSources).concat(['*.js']);
|
|
||||||
const lintSources = watchSources;
|
|
||||||
|
|
||||||
// tasks
|
|
||||||
gulp.task('default', ['lint'], () => {
|
|
||||||
return gulp.src(sources)
|
|
||||||
.pipe(ngAnnotate())
|
|
||||||
.pipe(sourcemaps.init())
|
|
||||||
.pipe(concat(buildTarget))
|
|
||||||
.pipe(uglify())
|
|
||||||
.pipe(sourcemaps.write())
|
|
||||||
.pipe(gulp.dest(destinationFolder));
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('lint', () => {
|
|
||||||
return gulp.src(lintSources)
|
|
||||||
.pipe(jshint())
|
|
||||||
.pipe(jshint.reporter('default'))
|
|
||||||
.pipe(jshint.reporter('fail'));
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('watch', () => {
|
|
||||||
gulp.watch(watchSources, ['default']);
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('karma', (done) => {
|
|
||||||
new KarmaServer({
|
|
||||||
configFile: karmaConfig,
|
|
||||||
singleRun: true
|
|
||||||
}, done).start();
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('watch-karma', (done) => {
|
|
||||||
new KarmaServer({
|
|
||||||
configFile: karmaConfig,
|
|
||||||
autoWatch: true
|
|
||||||
}, done).start();
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('phpunit', () => {
|
|
||||||
return gulp.src(phpSources)
|
|
||||||
.pipe(phpunit('phpunit', {
|
|
||||||
configurationFile: phpunitConfig
|
|
||||||
}));
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('watch-phpunit', () => {
|
|
||||||
gulp.watch(phpSources, ['phpunit']);
|
|
||||||
});
|
|
||||||
@@ -1,36 +1,28 @@
|
|||||||
{
|
{
|
||||||
"name": "deck",
|
"name": "deck",
|
||||||
"description": "Deck owncloud app",
|
"version": "1.0.0",
|
||||||
"version": "0.1.0",
|
"main": "Gruntfile.js",
|
||||||
"private": true,
|
"directories": {
|
||||||
"homepage": "https://github.com/juliushaertl/deck",
|
"test": "tests"
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git@github.com:juliushaertl/deck.git"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"karma": "^1.1.1",
|
|
||||||
"bower": "*",
|
|
||||||
"grunt": "*"
|
|
||||||
},
|
},
|
||||||
|
"dependencies": {},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"grunt-cli": "*",
|
"bower": "^1.8.0",
|
||||||
"grunt-contrib-concat": "*",
|
"grunt": "^1.0.1",
|
||||||
"grunt-contrib-jshint": "*",
|
"grunt-contrib-concat": "^1.0.1",
|
||||||
"grunt-contrib-watch": "*",
|
"grunt-contrib-jshint": "^1.1.0",
|
||||||
"grunt-karma": "*",
|
"grunt-contrib-watch": "^1.0.0",
|
||||||
"grunt-ng-annotate": "^1.0.1",
|
"grunt-karma": "^2.0.0",
|
||||||
"grunt-phpunit": "*",
|
"grunt-phpunit": "^0.3.6",
|
||||||
"grunt-wrap": "*",
|
"grunt-wrap": "^0.3.0",
|
||||||
"jasmine-core": "*",
|
"jshint-stylish": "^2.2.1",
|
||||||
"jshint-stylish": "^2.1.0",
|
"karma": "^1.4.1"
|
||||||
"karma": "*",
|
|
||||||
"karma-chrome-launcher": "*",
|
|
||||||
"karma-coverage": "*",
|
|
||||||
"karma-firefox-launcher": "*",
|
|
||||||
"karma-jasmine": "*",
|
|
||||||
"karma-phantomjs-launcher": "*",
|
|
||||||
"phantomjs": "*"
|
|
||||||
},
|
},
|
||||||
"engine": "node >= 0.8"
|
"scripts": {
|
||||||
|
"test": "echo \"Warning: no test specified\" && exit 0"
|
||||||
|
},
|
||||||
|
"author": "",
|
||||||
|
"license": "AGPL-3.0",
|
||||||
|
"keywords": [],
|
||||||
|
"description": ""
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user