-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from importre/develop
Add grunt tasks (jshint, watch and debug) and test code
- Loading branch information
Showing
17 changed files
with
1,578 additions
and
1,215 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"directory": "src/bower_components" | ||
"directory": "src/bower_components" | ||
} |
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,48 @@ | ||
{ | ||
"node": true, | ||
"browser": true, | ||
"esnext": true, | ||
"bitwise": true, | ||
"camelcase": true, | ||
"curly": true, | ||
"eqeqeq": true, | ||
"immed": true, | ||
"indent": 2, | ||
"latedef": true, | ||
"newcap": true, | ||
"noarg": true, | ||
"quotmark": "single", | ||
"regexp": true, | ||
"undef": true, | ||
"unused": true, | ||
"strict": true, | ||
"trailing": true, | ||
"smarttabs": true, | ||
"globals": { | ||
"$": true, | ||
"$routeProvider": true, | ||
"$locationProvider": true, | ||
"parseInt": true, | ||
"parseProcessList": true, | ||
"parseDeviceInfoList": true, | ||
"parsePackageList": true, | ||
"makeCommand": true, | ||
"parseMemInfo": true, | ||
"parsePackageMemInfo": true, | ||
"parseDiskSpace": true, | ||
"parseResolution": true, | ||
"arrayBufferToString": true, | ||
"arrayBufferToBinaryString": true, | ||
"stringToArrayBuffer": true, | ||
"newZeroArray": true, | ||
"getChartId": true, | ||
"integerToArrayBuffer": true, | ||
"angular": true, | ||
"it": true, | ||
"expect": true, | ||
"describe": true, | ||
"beforeEach": true, | ||
"afterEach": true, | ||
"chrome": true | ||
} | ||
} |
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,7 @@ | ||
language: node_js | ||
node_js: | ||
- "0.10" | ||
before_install: | ||
- "npm install -g grunt-cli" | ||
- "npm install -g bower" | ||
- "bower install" |
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 |
---|---|---|
@@ -1,81 +1,166 @@ | ||
'use strict'; | ||
|
||
module.exports = function (grunt) { | ||
require('load-grunt-tasks')(grunt); | ||
require('load-grunt-tasks')(grunt); | ||
require('time-grunt')(grunt); | ||
|
||
grunt.initConfig({ | ||
pkg: grunt.file.readJSON('package.json'), | ||
compress: { | ||
dist: { | ||
options: { | ||
archive: 'package/<%= pkg.name %>_<%= pkg.version %>.zip' | ||
}, | ||
files: [ | ||
{ | ||
expand: true, | ||
cwd: 'dist/src/', | ||
src: ['**'], | ||
dest: '' | ||
} | ||
] | ||
} | ||
grunt.initConfig({ | ||
pkg: grunt.file.readJSON('package.json'), | ||
compress: { | ||
dist: { | ||
options: { | ||
archive: 'package/<%= pkg.name %>_<%= pkg.version %>.zip' | ||
}, | ||
files: [ | ||
{ | ||
expand: true, | ||
cwd: 'dist/src/', | ||
src: ['**'], | ||
dest: '' | ||
} | ||
] | ||
} | ||
}, | ||
|
||
clean: { | ||
dist: { | ||
files: [ | ||
{ | ||
dot: true, | ||
src: ['dist/*', 'package/*.zip'] | ||
} | ||
] | ||
} | ||
watch: { | ||
js: { | ||
files: ['Gruntfile.js', 'src/scripts/{,*/}*.js'], | ||
tasks: ['jshint'], | ||
options: { | ||
livereload: true | ||
} | ||
}, | ||
views: { | ||
files: ['src/index.html', 'src/views/{,*/}*.html'], | ||
options: { | ||
livereload: true | ||
} | ||
}, | ||
styles: { | ||
files: ['src/styles/{,*/}*.css'], | ||
tasks: [], | ||
options: { | ||
livereload: true | ||
} | ||
}, | ||
livereload: { | ||
options: { | ||
livereload: '<%= connect.options.livereload %>' | ||
}, | ||
files: [ | ||
'src/views/**/*.html', | ||
'src/assets/{,*/}*.{png,jpg,jpeg,gif,webp,svg}', | ||
'src/manifest.json' | ||
] | ||
} | ||
}, | ||
|
||
jshint: { | ||
options: { | ||
jshintrc: '.jshintrc' | ||
}, | ||
all: [ | ||
'Gruntfile.js', | ||
'karma.conf.js', | ||
'src/scripts/**/*.js', | ||
'test/**/*.js' | ||
] | ||
}, | ||
|
||
copy: { | ||
dist: { | ||
files: [ | ||
{ | ||
cwd: '.', | ||
dot: false, | ||
dest: 'dist/', | ||
src: [ | ||
"src/manifest.json", | ||
"src/scripts/*", | ||
"src/styles/*", | ||
"src/assets/*", | ||
"src/views/*", | ||
"src/bower_components/bootstrap/dist/css/bootstrap.min.css", | ||
"src/bower_components/bootstrap/dist/js/bootstrap.min.js", | ||
"src/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.eot", | ||
"src/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.svg", | ||
"src/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf", | ||
"src/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.woff", | ||
"src/bower_components/bootstrap/dist/js/bootstrap.min.css", | ||
"src/bower_components/jquery/jquery.min.js", | ||
"src/bower_components/angular/angular.min.js", | ||
"src/bower_components/angular-route/angular-route.min.js", | ||
"src/bower_components/angular-sanitize/angular-sanitize.min.js", | ||
"src/bower_components/jqplot/jquery.jqplot.min.css", | ||
"src/bower_components/jqplot/jquery.jqplot.min.js", | ||
"src/bower_components/jqplot/plugins/jqplot.canvasTextRenderer.min.js", | ||
"src/bower_components/jqplot/plugins/jqplot.canvasAxisLabelRenderer.min.js" | ||
] | ||
} | ||
] | ||
} | ||
connect: { | ||
options: { | ||
port: 9000, | ||
livereload: 35729, | ||
hostname: 'localhost', | ||
open: true | ||
}, | ||
chrome: { | ||
options: { | ||
base: ['src'] | ||
} | ||
}); | ||
} | ||
}, | ||
|
||
clean: { | ||
dist: { | ||
files: [ | ||
{ | ||
dot: true, | ||
src: ['dist/*', 'package/*.zip'] | ||
} | ||
] | ||
} | ||
}, | ||
|
||
karma: { | ||
unit: { | ||
configFile: 'karma.conf.js', | ||
singleRun: true, | ||
browsers: ['PhantomJS'] | ||
} | ||
}, | ||
|
||
copy: { | ||
dist: { | ||
files: [ | ||
{ | ||
cwd: '.', | ||
dot: false, | ||
dest: 'dist/', | ||
src: [ | ||
'src/manifest.json', | ||
'src/index.html', | ||
'src/scripts/*', | ||
'src/styles/*', | ||
'src/assets/*', | ||
'src/views/*', | ||
'src/bower_components/bootstrap/dist/css/bootstrap.min.css', | ||
'src/bower_components/bootstrap/dist/js/bootstrap.min.js', | ||
'src/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.eot', | ||
'src/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.svg', | ||
'src/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf', | ||
'src/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.woff', | ||
'src/bower_components/bootstrap/dist/js/bootstrap.min.css', | ||
'src/bower_components/jquery/dist/jquery.min.js', | ||
'src/bower_components/angular/angular.min.js', | ||
'src/bower_components/angular-route/angular-route.min.js', | ||
'src/bower_components/angular-sanitize/angular-sanitize.min.js', | ||
'src/bower_components/jqplot/jquery.jqplot.min.css', | ||
'src/bower_components/jqplot/jquery.jqplot.min.js', | ||
'src/bower_components/jqplot/plugins/jqplot.canvasTextRenderer.min.js', | ||
'src/bower_components/jqplot/plugins/jqplot.canvasAxisLabelRenderer.min.js' | ||
] | ||
} | ||
] | ||
} | ||
} | ||
}); | ||
|
||
grunt.registerTask('default', [ | ||
'build' | ||
]); | ||
|
||
grunt.registerTask('build', [ | ||
'build:dist' | ||
]); | ||
|
||
grunt.registerTask('debug', function (platform) { | ||
var watch = grunt.config('watch'); | ||
platform = platform || 'chrome'; | ||
|
||
grunt.registerTask('default', [ | ||
'build' | ||
]); | ||
// Configure updated watch task | ||
grunt.config('watch', watch); | ||
grunt.task.run(['connect:' + platform, 'watch']); | ||
}); | ||
|
||
grunt.registerTask('build', [ | ||
'build:dist' | ||
]); | ||
grunt.registerTask('build:dist', [ | ||
'clean:dist', | ||
'copy:dist', | ||
'compress:dist' | ||
]); | ||
|
||
grunt.registerTask('build:dist', [ | ||
'clean:dist', | ||
'copy:dist', | ||
'compress:dist' | ||
]); | ||
} | ||
grunt.registerTask('test', [ | ||
'jshint', | ||
'karma' | ||
]); | ||
}; |
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 |
---|---|---|
@@ -1,17 +1,20 @@ | ||
{ | ||
"authors": [ | ||
"importre" | ||
], | ||
"dependencies": { | ||
"angular": "1.2.10", | ||
"angular-route": "1.2.10", | ||
"angular-sanitize": "1.2.10", | ||
"bootstrap": "~3.0.2", | ||
"jqplot": "*" | ||
}, | ||
"description": "Chrome ADB(Android Debug Bridge) Client", | ||
"homepage": "https://github.com/importre/chromeadb", | ||
"license": "BSD", | ||
"name": "ChromeADB", | ||
"version": "0.4.2" | ||
} | ||
"authors": [ | ||
"importre" | ||
], | ||
"dependencies": { | ||
"angular": "~1.2.16", | ||
"angular-route": "~1.2.16", | ||
"angular-sanitize": "~1.2.16", | ||
"bootstrap": "~3.0.2", | ||
"jqplot": "*" | ||
}, | ||
"description": "Chrome ADB(Android Debug Bridge) Client", | ||
"homepage": "https://github.com/importre/chromeadb", | ||
"license": "BSD", | ||
"name": "ChromeADB", | ||
"version": "0.4.2", | ||
"devDependencies": { | ||
"angular-mocks": "~1.2.17" | ||
} | ||
} |
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,17 @@ | ||
'use strict'; | ||
|
||
module.exports = function(config) { | ||
config.set({ | ||
frameworks: ['jasmine'], | ||
autoWatch : true, | ||
files : [ | ||
'src/bower_components/angular/angular.js', | ||
'src/bower_components/angular-mocks/angular-mocks.js', | ||
'src/scripts/**/*.js', | ||
'test/**/*.js' | ||
], | ||
exclude: [ | ||
'src/scripts/background.js' | ||
] | ||
}); | ||
}; |
Oops, something went wrong.