-
Notifications
You must be signed in to change notification settings - Fork 2
/
Gruntfile.js
66 lines (60 loc) · 1.72 KB
/
Gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/* jshint node: true */
module.exports = function (grunt) {
'use strict';
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
all: [
'Gruntfile.js',
'js/app/**/*.js',
'js/test/**/*.js'
],
options: {
jshintrc: '.jshintrc'
},
},
jasmine: {
src: [
'js/app/Model/TextFieldSearchOption.js',
'js/app/Model/*.js',
'js/app/Model/Assemblers/*.js',
'js/app/Mappers/*.js',
'js/app/Managers/*.js',
'js/app/ViewModels/*.js',
'js/app/CustomBinders/*.js',
],
options: {
specs: 'js/test/**/*.js',
vendor: 'js/lib/**/*.js',
display: 'short',
summary: true
}
},
'ftp-deploy': {
build: {
auth: {
host: 'ftp.geeksong.com',
port: 21,
authKey: 'key1'
},
src: '.',
dest: 'public_html/Malifaux',
exclusions: ['.gitignore', '.jshintrc', '.travis.yml', 'config.xml', 'Gruntfile.js', 'notes.txt', 'package.json', 'README.md', '.ftppass', 'LICENSE',
'node_modules', 'drawable-hdpi', '.git', 'test']
}
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-ftp-deploy');
grunt.registerTask('test', ['jshint', 'jasmine']);
grunt.registerTask('default', ['test']);
grunt.registerTask('deploy', ['create-ftp-file', 'ftp-deploy']);
grunt.registerTask('create-ftp-file', 'Create an authentication file for FTP', function() {
var ftpUsername = grunt.option('ftpUsername'),
ftpPassword = grunt.option('ftpPassword');
var contents = '{"key1":{"username":"' + ftpUsername + '", "password":"' + ftpPassword + '"}}';
// Create a file to supply the authentication parameters to the deployment
grunt.file.write('.ftppass', contents);
});
};