2013-02-20 03:14:14 +01:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
|
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
* copy of this software and associated documentation files (the "Software"),
|
|
|
|
* to deal in the Software without restriction, including without limitation
|
|
|
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
* and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
* Software is furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included in
|
|
|
|
* all copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
|
|
* DEALINGS IN THE SOFTWARE.
|
|
|
|
*
|
|
|
|
*/
|
2013-02-26 01:18:51 +01:00
|
|
|
/*global module, require*/
|
2013-01-24 19:48:31 +01:00
|
|
|
module.exports = function (grunt) {
|
2013-01-24 19:45:28 +01:00
|
|
|
'use strict';
|
|
|
|
|
2013-03-20 06:44:15 +01:00
|
|
|
var common = require("./tasks/lib/common")(grunt);
|
2013-05-16 19:48:29 +02:00
|
|
|
|
2013-01-24 19:45:28 +01:00
|
|
|
// Project configuration.
|
|
|
|
grunt.initConfig({
|
2013-03-20 06:44:15 +01:00
|
|
|
pkg : grunt.file.readJSON("package.json"),
|
2013-01-24 19:45:28 +01:00
|
|
|
meta : {
|
|
|
|
src : [
|
|
|
|
'src/**/*.js',
|
|
|
|
'!src/thirdparty/**',
|
|
|
|
'!src/widgets/bootstrap-*.js',
|
|
|
|
'!src/extensions/**/unittest-files/**/*.js',
|
2013-02-15 20:52:18 +01:00
|
|
|
'!src/extensions/**/thirdparty/**/*.js',
|
2013-02-01 18:19:47 +01:00
|
|
|
'!src/extensions/dev/**',
|
|
|
|
'!src/extensions/disabled/**',
|
2013-03-12 20:26:21 +01:00
|
|
|
'!**/node_modules/**/*.js',
|
2013-01-24 19:45:28 +01:00
|
|
|
'!src/**/*-min.js',
|
|
|
|
'!src/**/*.min.js'
|
|
|
|
],
|
|
|
|
test : [
|
|
|
|
'test/**/*.js',
|
|
|
|
'!test/perf/*-files/**/*.js',
|
|
|
|
'!test/spec/*-files/**/*.js',
|
|
|
|
'!test/smokes/**',
|
|
|
|
'!test/temp/**',
|
2013-03-22 00:15:30 +01:00
|
|
|
'!test/thirdparty/**',
|
|
|
|
'!test/**/node_modules/**/*.js'
|
2013-01-24 19:45:28 +01:00
|
|
|
],
|
2013-03-20 06:44:15 +01:00
|
|
|
grunt: [
|
|
|
|
'Gruntfile.js',
|
|
|
|
'tasks/**/*.js'
|
|
|
|
],
|
2013-01-24 19:45:28 +01:00
|
|
|
/* specs that can run in phantom.js */
|
|
|
|
specs : [
|
|
|
|
'test/spec/CommandManager-test.js',
|
2013-03-19 22:47:18 +01:00
|
|
|
//'test/spec/LanguageManager-test.js',
|
|
|
|
//'test/spec/PreferencesManager-test.js',
|
2013-01-24 19:45:28 +01:00
|
|
|
'test/spec/ViewUtils-test.js'
|
|
|
|
]
|
|
|
|
},
|
|
|
|
watch: {
|
2013-03-28 19:25:50 +01:00
|
|
|
all : {
|
|
|
|
files: ['**/*', '!**/node_modules/**'],
|
|
|
|
tasks: ['jshint']
|
|
|
|
},
|
|
|
|
grunt : {
|
|
|
|
files: ['<%= meta.grunt %>', 'tasks/**/*'],
|
|
|
|
tasks: ['jshint:grunt']
|
|
|
|
},
|
|
|
|
src : {
|
|
|
|
files: ['<%= meta.src %>', 'src/**/*'],
|
|
|
|
tasks: ['jshint:src']
|
|
|
|
},
|
2013-01-24 19:45:28 +01:00
|
|
|
test : {
|
2013-03-28 19:25:50 +01:00
|
|
|
files: ['<%= meta.test %>', 'test/**/*'],
|
|
|
|
tasks: ['jshint:test']
|
2013-01-24 19:45:28 +01:00
|
|
|
}
|
|
|
|
},
|
|
|
|
/* FIXME (jasonsanjose): how to handle extension tests */
|
|
|
|
jasmine : {
|
|
|
|
src : 'undefined.js', /* trick the default runner to run without importing src files */
|
|
|
|
options : {
|
|
|
|
junit : {
|
|
|
|
path: 'test/results',
|
|
|
|
consolidate: true
|
|
|
|
},
|
|
|
|
specs : '<%= meta.specs %>',
|
2013-01-26 05:00:47 +01:00
|
|
|
/* Keep in sync with test/SpecRunner.html dependencies */
|
2013-01-24 19:45:28 +01:00
|
|
|
vendor : [
|
2013-06-19 19:52:30 +02:00
|
|
|
'src/thirdparty/jquery-2.0.1.min.js',
|
2013-01-24 19:45:28 +01:00
|
|
|
'src/thirdparty/CodeMirror2/lib/codemirror.js',
|
|
|
|
'src/thirdparty/CodeMirror2/lib/util/dialog.js',
|
|
|
|
'src/thirdparty/CodeMirror2/lib/util/searchcursor.js',
|
2013-03-15 23:23:28 +01:00
|
|
|
'src/thirdparty/CodeMirror2/addon/edit/closetag.js',
|
|
|
|
'src/thirdparty/CodeMirror2/addon/selection/active-line.js',
|
2013-02-26 01:18:51 +01:00
|
|
|
'src/thirdparty/mustache/mustache.js',
|
2013-03-19 18:25:54 +01:00
|
|
|
'src/thirdparty/path-utils/path-utils.min',
|
2013-09-15 21:51:47 +02:00
|
|
|
'src/thirdparty/less-1.4.2.min.js'
|
2013-01-24 19:45:28 +01:00
|
|
|
],
|
2013-02-26 01:44:19 +01:00
|
|
|
helpers : [
|
|
|
|
'test/spec/PhantomHelper.js'
|
2013-01-24 19:45:28 +01:00
|
|
|
],
|
|
|
|
template : require('grunt-template-jasmine-requirejs'),
|
|
|
|
templateOptions: {
|
|
|
|
requireConfig : {
|
|
|
|
baseUrl: 'src',
|
|
|
|
paths: {
|
|
|
|
'test' : '../test',
|
|
|
|
'perf' : '../test/perf',
|
|
|
|
'spec' : '../test/spec',
|
2013-05-10 04:24:19 +02:00
|
|
|
'text' : 'thirdparty/text/text',
|
|
|
|
'i18n' : 'thirdparty/i18n/i18n'
|
2013-01-24 19:45:28 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2013-05-16 19:48:29 +02:00
|
|
|
'jasmine-node': {
|
|
|
|
run: {
|
|
|
|
spec: 'src/extensibility/node/spec/'
|
|
|
|
}
|
|
|
|
},
|
2013-01-24 19:45:28 +01:00
|
|
|
jshint: {
|
|
|
|
all: [
|
2013-03-28 19:25:50 +01:00
|
|
|
'<%= meta.grunt %>',
|
2013-01-24 19:45:28 +01:00
|
|
|
'<%= meta.src %>',
|
|
|
|
'<%= meta.test %>'
|
|
|
|
],
|
2013-03-28 19:25:50 +01:00
|
|
|
grunt: '<%= meta.grunt %>',
|
|
|
|
src: '<%= meta.src %>',
|
|
|
|
test: '<%= meta.test %>',
|
2013-01-24 19:45:28 +01:00
|
|
|
/* use strict options to mimic JSLINT until we migrate to JSHINT in Brackets */
|
|
|
|
options: {
|
|
|
|
jshintrc: '.jshintrc'
|
|
|
|
}
|
2013-03-20 06:44:15 +01:00
|
|
|
},
|
|
|
|
shell: {
|
|
|
|
repo: grunt.option("shell-repo") || "../brackets-shell",
|
|
|
|
mac: "<%= shell.repo %>/installer/mac/staging/<%= pkg.name %>.app",
|
|
|
|
win: "<%= shell.repo %>/installer/win/staging/<%= pkg.name %>.exe"
|
2013-01-24 19:45:28 +01:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
// load dependencies
|
2013-02-20 03:14:14 +01:00
|
|
|
grunt.loadTasks('tasks');
|
2013-01-24 19:45:28 +01:00
|
|
|
grunt.loadNpmTasks('grunt-contrib-jasmine');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-jshint');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-watch');
|
2013-05-16 19:48:29 +02:00
|
|
|
grunt.loadNpmTasks('grunt-contrib-jasmine-node');
|
|
|
|
|
2013-01-24 19:45:28 +01:00
|
|
|
// task: install
|
|
|
|
grunt.registerTask('install', ['write-config']);
|
|
|
|
|
|
|
|
// task: test
|
2013-06-25 20:37:58 +02:00
|
|
|
grunt.registerTask('test', ['jshint:all', 'jasmine']);
|
|
|
|
//grunt.registerTask('test', ['jshint:all', 'jasmine', jasmine-node']);
|
2013-01-24 19:45:28 +01:00
|
|
|
|
2013-02-21 20:54:56 +01:00
|
|
|
// task: set-sprint
|
|
|
|
// Update sprint number in package.json and rewrite src/config.json
|
2013-02-22 01:09:28 +01:00
|
|
|
grunt.registerTask('set-sprint', ['update-sprint-number', 'write-config']);
|
2013-02-21 20:54:56 +01:00
|
|
|
|
2013-01-24 19:45:28 +01:00
|
|
|
// Default task.
|
|
|
|
grunt.registerTask('default', ['test']);
|
2013-02-01 18:19:47 +01:00
|
|
|
};
|