forked from adobe/brackets
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add grunt tasks for jshint and jasmine. Refactor and move package.jso…
…n, replace existing with config.json. Add Travis-CI support.
- Loading branch information
1 parent
8e43cd8
commit 67a97c2
Showing
8 changed files
with
255 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
{ | ||
"bitwise" : true, | ||
"curly" : true, | ||
"eqeqeq" : true, | ||
"forin" : true, | ||
"immed" : true, | ||
"latedef" : true, | ||
"newcap" : true, | ||
"noarg" : true, | ||
"noempty" : true, | ||
"nonew" : true, | ||
"plusplus" : true, | ||
"regexp" : true, | ||
"undef" : true, | ||
"strict" : true, | ||
"trailing" : false, | ||
|
||
"asi" : false, | ||
"boss" : false, | ||
"debug" : false, | ||
"eqnull" : false, | ||
"es5" : false, | ||
"esnext" : false, | ||
"evil" : false, | ||
"expr" : false, | ||
"funcscope" : false, | ||
"globalstrict" : false, | ||
"iterator" : false, | ||
"lastsemic" : false, | ||
"laxbreak" : false, | ||
"laxcomma" : false, | ||
"loopfunc" : false, | ||
"multistr" : false, | ||
"onecase" : false, | ||
"proto" : false, | ||
"regexdash" : false, | ||
"scripturl" : false, | ||
"smarttabs" : false, | ||
"shadow" : false, | ||
"sub" : false, | ||
"supernew" : false, | ||
"validthis" : false, | ||
|
||
"browser" : true, | ||
"couch" : false, | ||
"devel" : false, | ||
"dojo" : false, | ||
"jquery" : false, | ||
"mootools" : false, | ||
"node" : false, | ||
"nonstandard" : false, | ||
"prototypejs" : false, | ||
"rhino" : false, | ||
"wsh" : false, | ||
|
||
"nomen" : false, | ||
"onevar" : false, | ||
"passfail" : false, | ||
"white" : false, | ||
|
||
"maxerr" : 100, | ||
"predef" : [ | ||
], | ||
"indent" : 4, | ||
"globals" : [ | ||
"require", | ||
"define", | ||
"brackets", | ||
"$", | ||
"PathUtils", | ||
"window", | ||
"navigator", | ||
"Mustache" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
language: node_js | ||
node_js: | ||
- 0.8 | ||
before_script: | ||
- npm install -g grunt-cli |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
module.exports = function(grunt) { | ||
'use strict'; | ||
|
||
// Project configuration. | ||
grunt.initConfig({ | ||
meta : { | ||
src : [ | ||
'src/**/*.js', | ||
'!src/thirdparty/**', | ||
'!src/widgets/bootstrap-*.js', | ||
'!src/extensions/**/unittest-files/**/*.js', | ||
'!src/**/*-min.js', | ||
'!src/**/*.min.js' | ||
], | ||
test : [ | ||
'test/**/*.js', | ||
'!test/perf/*-files/**/*.js', | ||
'!test/spec/*-files/**/*.js', | ||
'!test/smokes/**', | ||
'!test/temp/**', | ||
'!test/thirdparty/**' | ||
], | ||
/* specs that can run in phantom.js */ | ||
specs : [ | ||
'test/spec/CommandManager-test.js', | ||
'test/spec/PreferencesManager-test.js', | ||
'test/spec/ViewUtils-test.js' | ||
] | ||
}, | ||
watch: { | ||
test : { | ||
files: ['Gruntfile.js','<%= meta.src %>','<%= meta.test %>'], | ||
tasks: 'test' | ||
} | ||
}, | ||
/* 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 %>', | ||
vendor : [ | ||
'src/thirdparty/jquery-1.7.js', | ||
'src/thirdparty/CodeMirror2/lib/codemirror.js', | ||
'src/thirdparty/CodeMirror2/lib/util/dialog.js', | ||
'src/thirdparty/CodeMirror2/lib/util/searchcursor.js', | ||
'src/thirdparty/mustache/mustache.js' | ||
], | ||
template : require('grunt-template-jasmine-requirejs'), | ||
templateOptions: { | ||
requireConfig : { | ||
baseUrl: 'src', | ||
paths: { | ||
'test' : '../test', | ||
'perf' : '../test/perf', | ||
'spec' : '../test/spec', | ||
'text' : 'thirdparty/text', | ||
'i18n' : 'thirdparty/i18n' | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
jshint: { | ||
all: [ | ||
'Gruntfile.js', | ||
'<%= meta.src %>', | ||
'<%= meta.test %>' | ||
], | ||
/* use strict options to mimic JSLINT until we migrate to JSHINT in Brackets */ | ||
options: { | ||
jshintrc: '.jshintrc' | ||
} | ||
} | ||
}); | ||
|
||
// load dependencies | ||
grunt.loadNpmTasks('grunt-contrib-jasmine'); | ||
grunt.loadNpmTasks('grunt-contrib-jshint'); | ||
grunt.loadNpmTasks('grunt-contrib-watch'); | ||
|
||
// task: install | ||
grunt.registerTask('install', ['write-config']); | ||
|
||
// task: write-config | ||
// merge package.json and src/brackets.config.json into src/config.json | ||
grunt.registerTask('write-config', function () { | ||
var packageJSON = grunt.file.readJSON("package.json"), | ||
appConfigJSON = grunt.file.readJSON("src/brackets.config.json"); | ||
|
||
Object.keys(packageJSON).forEach(function (key) { | ||
if (appConfigJSON[key] === undefined) { | ||
appConfigJSON[key] = packageJSON[key]; | ||
} | ||
}); | ||
|
||
grunt.file.write("src/config.json", JSON.stringify(appConfigJSON)); | ||
}); | ||
|
||
// task: test | ||
grunt.registerTask('test', ['jshint', 'jasmine']); | ||
|
||
// Default task. | ||
grunt.registerTask('default', ['test']); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"name" : "Brackets", | ||
"version" : "0.20.0-0", | ||
"homepage" : "http://brackets.io", | ||
"issues" : | ||
{ | ||
"url" : "http://github.com/jasonsanjose/brackets/issues" | ||
}, | ||
"repository" : | ||
{ | ||
"type" : "git", | ||
"url" : "https://github.com/jasonsanjose/brackets.git", | ||
"branch" : "", | ||
"SHA" : "" | ||
}, | ||
"devDependencies" : | ||
{ | ||
"grunt" : ">=0.4.0rc5", | ||
"grunt-contrib-jshint" : "git://github.com/gruntjs/grunt-contrib-jshint.git#master", | ||
"grunt-contrib-watch" : ">=0.2.0rc5", | ||
"grunt-contrib-jasmine" : "git://github.com/gruntjs/grunt-contrib-jasmine.git#master", | ||
"grunt-template-jasmine-requirejs" : ">=0.1.0", | ||
"socket.io" : ">=0.9.13" | ||
}, | ||
"scripts" : | ||
{ | ||
"install" : "grunt install", | ||
"test" : "grunt test" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"name" : "Brackets", | ||
"homepage" : "http://brackets.io", | ||
"issues" : | ||
{ | ||
"url" : "http://github.com/adobe/brackets/issues" | ||
}, | ||
"repository" : | ||
{ | ||
"type" : "git", | ||
"url" : "https://github.com/adobe/brackets.git", | ||
"branch" : "", | ||
"SHA" : "" | ||
}, | ||
"config" : | ||
{ | ||
"app_title" : "Brackets", | ||
"app_name_about" : "Brackets", | ||
"about_icon" : "styles/images/brackets_icon.svg", | ||
"show_debug_menu" : true, | ||
"enable_jslint" : true, | ||
"update_info_url" : "http://dev.brackets.io/updates/stable/", | ||
"how_to_use_url" : "https://github.com/adobe/brackets/wiki/How-to-Use-Brackets", | ||
"forum_url" : "https://groups.google.com/forum/?fromgroups#!forum/brackets-dev", | ||
"release_notes_url" : "https://github.com/adobe/brackets/wiki/Release-Notes", | ||
"report_issue_url" : "https://github.com/adobe/brackets/wiki/How-to-Report-an-Issue", | ||
"twitter_url" : "https://twitter.com/brackets", | ||
"troubleshoot_url" : "https://github.com/adobe/brackets/wiki/Troubleshooting#wiki-livedev", | ||
"twitter_name" : "@brackets" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"name":"Brackets","homepage":"http://brackets.io","issues":{"url":"http://github.com/adobe/brackets/issues"},"repository":{"type":"git","url":"https://github.com/adobe/brackets.git","branch":"","SHA":""},"config":{"app_title":"Brackets","app_name_about":"Brackets","about_icon":"styles/images/brackets_icon.svg","show_debug_menu":true,"enable_jslint":true,"update_info_url":"http://dev.brackets.io/updates/stable/","how_to_use_url":"https://github.com/adobe/brackets/wiki/How-to-Use-Brackets","forum_url":"https://groups.google.com/forum/?fromgroups#!forum/brackets-dev","release_notes_url":"https://github.com/adobe/brackets/wiki/Release-Notes","report_issue_url":"https://github.com/adobe/brackets/wiki/How-to-Report-an-Issue","twitter_url":"https://twitter.com/brackets","troubleshoot_url":"https://github.com/adobe/brackets/wiki/Troubleshooting#wiki-livedev","twitter_name":"@brackets"},"version":"0.20.0-0","devDependencies":{"grunt":">=0.4.0rc5","grunt-contrib-jshint":"git://github.com/gruntjs/grunt-contrib-jshint.git#master","grunt-contrib-watch":">=0.2.0rc5","grunt-contrib-jasmine":"git://github.com/gruntjs/grunt-contrib-jasmine.git#master","grunt-template-jasmine-requirejs":">=0.1.0","socket.io":">=0.9.13"},"scripts":{"install":"grunt install","test":"grunt test"}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters