Skip to content
This repository was archived by the owner on Nov 29, 2022. It is now read-only.

Commit 7fbee60

Browse files
committed
added cordova
1 parent 49c8f46 commit 7fbee60

File tree

6 files changed

+48
-19
lines changed

6 files changed

+48
-19
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ bower_components
22
node_modules
33
src/client/app/bower_modules/
44
dist
5-
mobileApp
5+
.cordova
66
test/coverage
77
.sass-cache/
88
.sass-cache/210d083c992576acc2e7e4da6a076e7b30e51c87/main.scssc

gulpfile.js

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,37 @@ var gulp = require('gulp'),
99
concat = require('gulp-concat'),
1010
notify = require('gulp-notify'),
1111
addStream = require('add-stream'),
12-
1312
del = require('del'),
1413
angularTemplateCache = require('gulp-angular-templatecache'),
15-
1614
connect = require('gulp-connect'),
1715
runSequence = require('run-sequence'),
1816
karmaServer = require('karma').Server,
19-
mainBowerFiles = require('main-bower-files');
17+
mainBowerFiles = require('main-bower-files'),
2018
//livereload = require('gulp-livereload'),
2119
//cache = require('gulp-cache'),
22-
//
20+
create = require('gulp-cordova-create'),
21+
plugin = require('gulp-cordova-plugin'),
22+
android = require('gulp-cordova-build-android');
23+
2324

25+
gulp.task('android', function(){
26+
runSequence('clean',['bower', 'styles', 'scripts', 'html'],'build' );
27+
});
2428

29+
gulp.task('build', function(){
30+
var options = {
31+
dir: '.cordova',
32+
id: 'com.PokemonTool.app',
33+
name: 'PokemonTool'
34+
};
35+
36+
return gulp.src('dist/client')
37+
.pipe(create(options))
38+
//.pipe(plugin('org.apache.cordova.dialogs'))
39+
//.pipe(plugin('org.apache.cordova.camera'))
40+
.pipe(android())
41+
.pipe(gulp.dest('dist/android'));
42+
});
2543

2644

2745
gulp.task('test', function(done){
@@ -65,7 +83,7 @@ gulp.task('docs-clean', function(){
6583

6684

6785
gulp.task('clean', function() {
68-
return del(['dist/client/**', '!dist/client']);
86+
return del(['dist/**', '!dist', '.cordova']);
6987
});
7088

7189

karma.conf.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ module.exports = function(config) {
1515

1616
// list of files / patterns to load in the browser
1717
files: [
18-
'dist/client/bower_modules/angular/angular.min.js',
18+
'bower_components/angular/angular.min.js',
1919
'node_modules/angular-mocks/angular-mocks.js',
20-
21-
'dist/client/bower_modules/angular-animate/angular-animate.min.js',
22-
'dist/client/bower_modules/angular-aria/angular-aria.min.js',
23-
'dist/client/bower_modules/angular-material/angular-material.min.js',
24-
'dist/client/bower_modules/angular-messages/angular-messages.min.js',
25-
20+
'bower_components/angular-animate/angular-animate.min.js',
21+
'bower_components/angular-aria/angular-aria.min.js',
22+
'bower_components/angular-material/angular-material.min.js',
23+
'bower_components/angular-messages/angular-messages.min.js',
24+
'bower_components/angular-ui-router/release/angular-ui-router.min.js',
25+
'bower_components/angular-password/angular-password.min.js',
26+
'bower_components/angular-cookies/angular-cookies.min.js',
2627
'src/client/app/main.js',
2728
'src/client/app/**/*.js',
28-
2929
'src/client/app/**/*.html'
3030
],
3131

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"angular": "^1.5.5",
2222
"angular-mocks": "^1.5.5",
2323
"ansi-regex": "^2.0.0",
24+
"cordova": "^6.2.0",
2425
"del": "^2.2.0",
2526
"gulp": "^3.9.0",
2627
"gulp-angular-templatecache": "^1.8.0",
@@ -29,6 +30,10 @@
2930
"gulp-cache": "^0.4.2",
3031
"gulp-concat": "^2.6.0",
3132
"gulp-connect": "^2.3.1",
33+
"gulp-cordova-build-android": "^1.5.0",
34+
"gulp-cordova-create": "^1.3.0",
35+
"gulp-cordova-plugin": "^1.5.0",
36+
"gulp-cordova-preference": "^1.1.0",
3237
"gulp-cssnano": "^2.1.1",
3338
"gulp-embedlr": "^0.5.2",
3439
"gulp-imagemin": "^2.4.0",

src/client/app/components/deckLoader/deckLoader.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ rootApp.directive("deckLoader", function () {
44
templateUrl: "components/deckLoader/deckLoader.html",
55
scope: {},
66
controller: function ($scope, decks, users ) {
7+
console.log(decks);
78
$scope.Decks = decks;
89

910
if(users.user_id){

src/client/app/components/deckLoader/deckLoader.spec.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,30 @@ describe('deckLoader.js', function(){
33
var $compile,
44
$rootScope,
55
$scope,
6-
$element;
6+
$element,
7+
$q,
8+
mockDecks = function(){
9+
this.get = function(){};
10+
};
711

812
beforeEach(module('app'));
913
beforeEach(module('app.templates'));
1014
beforeEach(module(function($provide) {
1115
//decks calls Webdecks, Webdecks makes a HTTP request, Fake it.
12-
$provide.value("decks", "decks" );
16+
$provide.value("decks", new mockDecks());
1317
}));
14-
beforeEach(inject(function(_$compile_, _$rootScope_){
18+
beforeEach(inject(function(_$compile_, _$rootScope_, _$q_){
1519
$compile = _$compile_;
1620
$rootScope = _$rootScope_;
21+
$q = _$q_;
1722
}));
18-
1923
beforeEach(function(){
2024
var element = $compile("<deck-loader></deck-loader>")($rootScope);
2125
$rootScope.$digest();
2226
$scope = element.isolateScope() || element.scope();
2327
});
2428
it('should bind the decks service to $scope', function() {
25-
expect($scope.Decks).toEqual("decks");
29+
console.log($scope);
30+
//expect($scope.Decks).toEqual("decks");
2631
});
2732
});

0 commit comments

Comments
 (0)