Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit be6bd38

Browse files
committed
Merge pull request #2654 from adobe/jasonsanjose/travis
Add GruntJS and NPM to support Travis-CI
2 parents 2433046 + 964fb61 commit be6bd38

10 files changed

Lines changed: 268 additions & 18 deletions

File tree

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
Thumbs.db
22
node_modules
3+
npm-debug.log
34
src/brackets.css
45
src/brackets.min.css
56

@@ -14,4 +15,5 @@ src/extensions/disabled
1415
.DS_Store
1516

1617
# unit test working directory
17-
test/temp
18+
test/temp
19+
test/results

.jshintrc

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
{
2+
"bitwise" : true,
3+
"curly" : true,
4+
"eqeqeq" : true,
5+
"forin" : true,
6+
"immed" : true,
7+
"latedef" : true,
8+
"newcap" : true,
9+
"noarg" : true,
10+
"noempty" : true,
11+
"nonew" : true,
12+
"plusplus" : true,
13+
"regexp" : true,
14+
"undef" : true,
15+
"strict" : true,
16+
"trailing" : false,
17+
18+
"asi" : false,
19+
"boss" : false,
20+
"debug" : false,
21+
"eqnull" : false,
22+
"es5" : false,
23+
"esnext" : false,
24+
"evil" : false,
25+
"expr" : false,
26+
"funcscope" : false,
27+
"globalstrict" : false,
28+
"iterator" : false,
29+
"lastsemic" : false,
30+
"laxbreak" : false,
31+
"laxcomma" : false,
32+
"loopfunc" : false,
33+
"multistr" : false,
34+
"onecase" : false,
35+
"proto" : false,
36+
"regexdash" : false,
37+
"scripturl" : false,
38+
"smarttabs" : false,
39+
"shadow" : false,
40+
"sub" : false,
41+
"supernew" : false,
42+
"validthis" : false,
43+
44+
"browser" : true,
45+
"couch" : false,
46+
"devel" : false,
47+
"dojo" : false,
48+
"jquery" : false,
49+
"mootools" : false,
50+
"node" : false,
51+
"nonstandard" : false,
52+
"prototypejs" : false,
53+
"rhino" : false,
54+
"wsh" : false,
55+
56+
"nomen" : false,
57+
"onevar" : false,
58+
"passfail" : false,
59+
"white" : false,
60+
61+
"maxerr" : 100,
62+
"predef" : [
63+
],
64+
"indent" : 4,
65+
"globals" : [
66+
"require",
67+
"define",
68+
"brackets",
69+
"$",
70+
"PathUtils",
71+
"window",
72+
"navigator",
73+
"Mustache"
74+
]
75+
}

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
language: node_js
2+
node_js:
3+
- 0.8
4+
before_script:
5+
- npm install -g grunt-cli

Gruntfile.js

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
/*global module, require*/
2+
module.exports = function (grunt) {
3+
'use strict';
4+
5+
// Project configuration.
6+
grunt.initConfig({
7+
meta : {
8+
src : [
9+
'src/**/*.js',
10+
'!src/thirdparty/**',
11+
'!src/widgets/bootstrap-*.js',
12+
'!src/extensions/**/unittest-files/**/*.js',
13+
'!src/**/*-min.js',
14+
'!src/**/*.min.js'
15+
],
16+
test : [
17+
'test/**/*.js',
18+
'!test/perf/*-files/**/*.js',
19+
'!test/spec/*-files/**/*.js',
20+
'!test/smokes/**',
21+
'!test/temp/**',
22+
'!test/thirdparty/**'
23+
],
24+
/* specs that can run in phantom.js */
25+
specs : [
26+
'test/spec/CommandManager-test.js',
27+
'test/spec/PreferencesManager-test.js',
28+
'test/spec/ViewUtils-test.js'
29+
]
30+
},
31+
watch: {
32+
test : {
33+
files: ['Gruntfile.js', '<%= meta.src %>', '<%= meta.test %>'],
34+
tasks: 'test'
35+
}
36+
},
37+
/* FIXME (jasonsanjose): how to handle extension tests */
38+
jasmine : {
39+
src : 'undefined.js', /* trick the default runner to run without importing src files */
40+
options : {
41+
junit : {
42+
path: 'test/results',
43+
consolidate: true
44+
},
45+
specs : '<%= meta.specs %>',
46+
/* Keep in sync with test/SpecRunner.html dependencies */
47+
vendor : [
48+
'src/thirdparty/jquery-1.7.js',
49+
'src/thirdparty/CodeMirror2/lib/codemirror.js',
50+
'src/thirdparty/CodeMirror2/lib/util/dialog.js',
51+
'src/thirdparty/CodeMirror2/lib/util/searchcursor.js',
52+
'src/thirdparty/mustache/mustache.js'
53+
],
54+
template : require('grunt-template-jasmine-requirejs'),
55+
templateOptions: {
56+
requireConfig : {
57+
baseUrl: 'src',
58+
paths: {
59+
'test' : '../test',
60+
'perf' : '../test/perf',
61+
'spec' : '../test/spec',
62+
'text' : 'thirdparty/text',
63+
'i18n' : 'thirdparty/i18n'
64+
}
65+
}
66+
}
67+
}
68+
},
69+
jshint: {
70+
all: [
71+
'Gruntfile.js',
72+
'<%= meta.src %>',
73+
'<%= meta.test %>'
74+
],
75+
/* use strict options to mimic JSLINT until we migrate to JSHINT in Brackets */
76+
options: {
77+
jshintrc: '.jshintrc'
78+
}
79+
}
80+
});
81+
82+
// load dependencies
83+
grunt.loadNpmTasks('grunt-contrib-jasmine');
84+
grunt.loadNpmTasks('grunt-contrib-jshint');
85+
grunt.loadNpmTasks('grunt-contrib-watch');
86+
87+
// task: install
88+
grunt.registerTask('install', ['write-config']);
89+
90+
// task: write-config
91+
// merge package.json and src/brackets.config.json into src/config.json
92+
grunt.registerTask('write-config', function () {
93+
var packageJSON = grunt.file.readJSON("package.json"),
94+
appConfigJSON = grunt.file.readJSON("src/brackets.config.json");
95+
96+
Object.keys(packageJSON).forEach(function (key) {
97+
if (appConfigJSON[key] === undefined) {
98+
appConfigJSON[key] = packageJSON[key];
99+
}
100+
});
101+
102+
grunt.file.write("src/config.json", JSON.stringify(appConfigJSON, null, " "));
103+
});
104+
105+
// task: test
106+
grunt.registerTask('test', ['jshint', 'jasmine']);
107+
108+
// Default task.
109+
grunt.registerTask('default', ['test']);
110+
};

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Welcome to Brackets!
1+
Welcome to Brackets! [![Build Status](https://travis-ci.org/adobe/brackets.png)](https://travis-ci.org/adobe/brackets)
22
-------------------
33

44
Installers for the latest build can be [downloaded here](http://download.brackets.io/).

package.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"name" : "Brackets",
3+
"version" : "0.20.0-0",
4+
"homepage" : "http://brackets.io",
5+
"issues" :
6+
{
7+
"url" : "http://github.com/adobe/brackets/issues"
8+
},
9+
"repository" :
10+
{
11+
"type" : "git",
12+
"url" : "https://github.com/adobe/brackets.git",
13+
"branch" : "",
14+
"SHA" : ""
15+
},
16+
"devDependencies" :
17+
{
18+
"grunt" : ">=0.4.0rc5",
19+
"grunt-cli" : ">=0.1.6",
20+
"grunt-contrib-jshint" : ">=0.1.1rc6",
21+
"grunt-contrib-watch" : ">=0.2.0rc5",
22+
"grunt-contrib-jasmine" : ">=0.3.0rc7",
23+
"grunt-template-jasmine-requirejs" : ">=0.1.0"
24+
},
25+
"scripts" :
26+
{
27+
"postinstall" : "grunt install",
28+
"test" : "grunt test"
29+
}
30+
}
Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,4 @@
11
{
2-
"name" : "Brackets",
3-
"version" : "0.20.0-0",
4-
"homepage" : "http://brackets.io",
5-
"issues" :
6-
{
7-
"url" : "http://github.com/adobe/brackets/issues"
8-
},
9-
"repository" :
10-
{
11-
"type" : "git",
12-
"url" : "https://github.com/adobe/brackets.git",
13-
"branch" : "",
14-
"SHA" : ""
15-
},
162
"config" :
173
{
184
"app_title" : "Brackets",

src/config.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"config": {
3+
"app_title": "Brackets",
4+
"app_name_about": "Brackets",
5+
"about_icon": "styles/images/brackets_icon.svg",
6+
"show_debug_menu": true,
7+
"enable_jslint": true,
8+
"update_info_url": "http://dev.brackets.io/updates/stable/",
9+
"how_to_use_url": "https://github.com/adobe/brackets/wiki/How-to-Use-Brackets",
10+
"forum_url": "https://groups.google.com/forum/?fromgroups#!forum/brackets-dev",
11+
"release_notes_url": "https://github.com/adobe/brackets/wiki/Release-Notes",
12+
"report_issue_url": "https://github.com/adobe/brackets/wiki/How-to-Report-an-Issue",
13+
"twitter_url": "https://twitter.com/brackets",
14+
"troubleshoot_url": "https://github.com/adobe/brackets/wiki/Troubleshooting#wiki-livedev",
15+
"twitter_name": "@brackets"
16+
},
17+
"name": "Brackets",
18+
"version": "0.20.0-0",
19+
"homepage": "http://brackets.io",
20+
"issues": {
21+
"url": "http://github.com/adobe/brackets/issues"
22+
},
23+
"repository": {
24+
"type": "git",
25+
"url": "https://github.com/adobe/brackets.git",
26+
"branch": "",
27+
"SHA": ""
28+
},
29+
"devDependencies": {
30+
"grunt": ">=0.4.0rc5",
31+
"grunt-cli": ">=0.1.6",
32+
"grunt-contrib-jshint": ">=0.1.1rc6",
33+
"grunt-contrib-watch": ">=0.2.0rc5",
34+
"grunt-contrib-jasmine": ">=0.3.0rc7",
35+
"grunt-template-jasmine-requirejs": ">=0.1.0"
36+
},
37+
"scripts": {
38+
"postinstall": "grunt install",
39+
"test": "grunt test"
40+
}
41+
}

src/utils/Global.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
define(function (require, exports, module) {
3535
"use strict";
3636

37-
var packageJSON = require("text!package.json");
37+
var configJSON = require("text!config.json");
3838

3939
// Define core brackets namespace if it isn't already defined
4040
//
@@ -52,7 +52,7 @@ define(function (require, exports, module) {
5252

5353
// Parse src/config.json
5454
try {
55-
global.brackets.metadata = JSON.parse(packageJSON);
55+
global.brackets.metadata = JSON.parse(configJSON);
5656
global.brackets.config = global.brackets.metadata.config;
5757
} catch (err) {
5858
console.log(err);

test/SpecRunner.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
<script src="thirdparty/jasmine-core/jasmine.js"></script>
3535

3636
<!-- Pre-load third party scripts that cannot be async loaded. -->
37+
<!-- Keep in sync with Gruntfile.js jasmine vendor dependencies -->
3738
<script src="../src/thirdparty/jquery-1.7.min.js"></script>
3839
<script src="../src/thirdparty/CodeMirror2/lib/codemirror.js"></script>
3940
<script src="../src/thirdparty/CodeMirror2/lib/util/dialog.js"></script>

0 commit comments

Comments
 (0)