This repository has been archived by the owner on Sep 2, 2019. It is now read-only.
forked from hirsch88/ui5-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
110 lines (95 loc) · 3.25 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
'use strict';
module.exports = function( grunt ){
/**
* Load required Grunt tasks. These are installed based on the versions listed
* in `package.json` when you do `npm install` in this directory.
*/
require( 'load-grunt-tasks' )( grunt );
/**
* Time how long tasks take. Can help when optimizing build times
*/
require( 'time-grunt' )( grunt );
/**
* Configurable paths for the application
*/
var userConfig = require( './Grunt.config.js' );
/**
* This is the configuration object Grunt uses to give each plugin its
* instructions.
* Define the configuration for all the tasks
*/
var taskConfig = {
/**
* We read in our `package.json` file so we can access the package name and version. It's already there, so
* we don't repeat ourselves here.
*/
pkg: grunt.file.readJSON( 'package.json' ),
bower: grunt.file.readJSON( 'bower.json' ),
/**
* `jshint` defines the rules of our linter as well as which files we should check. This file, all javascript
* sources, and all our unit tests are linted based on the policies listed in `options`. But we can also
* specify exclusionary patterns by prefixing them with an exclamation point (!); this is useful when code comes
* from a third party but is nonetheless inside `src/`.
* Make sure code styles are up to par and there are no obvious mistakes
*/
jshint: {
options: {
jshintrc: '.jshintrc',
reporter: require( 'jshint-stylish' )
},
all: {
src: [
'Gruntfile.js',
'<%= devDir %>/<%= appFiles.js =>'
]
}
},
/**
* The 'clean' tasks cleans the mention directories
*/
clean: {
lib: {
src: [ '<%= devDir %>/<%= libDir %>/**/*' ]
}
},
/**
* The `copy` task just copies files from A to B. We use it here to copy our project assets
* (images, fonts, etc.) and javascripts into `buildDir`, and then to copy the assets to `deployDir`.
*/
copy: {
openui5: {
files: [
{
src: [ '**' ],
cwd: '<%= bowerDir %>/<%= ui5Dir %>/resources',
dest: '<%= devDir %>/<%= libDir %>/<%= ui5Dir %>/resources',
expand: true
}
]
},
bowerToLib: {
files: [
{
src: '<%= bowerFiles.js %>',
cwd: '<%= bowerDir %>',
dest: '<%= devDir %>/<%= libDir %>/',
expand: true
}
]
}
}
};
grunt.initConfig( grunt.util._.extend( taskConfig, userConfig ) );
/**
* Build tasks for building the dev environment
*/
grunt.registerTask( 'default', [
'build'
] );
grunt.registerTask( 'build', [
'jshint:all',
'clean:lib',
'copy:bowerToLib',
'copy:openui5'
] );
};