Skip to content

Commit

Permalink
Merge pull request #6 from importre/develop
Browse files Browse the repository at this point in the history
Add grunt tasks (jshint, watch and debug) and test code
  • Loading branch information
importre committed Jun 9, 2014
2 parents 9d32ecb + ab54604 commit 49e405d
Show file tree
Hide file tree
Showing 17 changed files with 1,578 additions and 1,215 deletions.
2 changes: 1 addition & 1 deletion .bowerrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"directory": "src/bower_components"
"directory": "src/bower_components"
}
48 changes: 48 additions & 0 deletions .jshintrc
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
}
}
7 changes: 7 additions & 0 deletions .travis.yml
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"
227 changes: 156 additions & 71 deletions Gruntfile.js
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'
]);
};
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
ChromeADB
=========

[![Build Status](https://travis-ci.org/importre/chromeadb.svg?branch=master)](https://travis-ci.org/importre/chromeadb)

**ChromeADB** is a Chrome ADB (Android Debug Bridge) client.

When launched, you can see all devices connected to your machine if the ADB connection is successful.
Expand Down Expand Up @@ -56,7 +58,7 @@ No description needed anymore :)
Chrome Store
------------

[![chrome_store](https://developers.google.com/chrome/web-store/images/branding/ChromeWebStore_Badge_v2_340x96.png)][2]
[![chrome_store](https://developer.chrome.com/webstore/images/ChromeWebStore_Badge_v2_496x150.png)][2]



Expand Down
35 changes: 19 additions & 16 deletions bower.json
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"
}
}
17 changes: 17 additions & 0 deletions karma.conf.js
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'
]
});
};
Loading

0 comments on commit 49e405d

Please sign in to comment.