Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more segregation of copy & watch task #1000

Merged
merged 4 commits into from
Mar 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions grunt/config/clean.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module.exports = {
'<%= sourcedir %>theme/theme.js',
'<%= sourcedir %>less',
'<%= sourcedir %>templates',
'<%= sourcedir %>plugins.js',
'<%= outputdir %>adapt/js/adapt.min.js.map'
]
},
Expand Down
14 changes: 11 additions & 3 deletions grunt/config/copy.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,19 @@ module.exports = function (grunt, options) {
}
]
},
main: {
scriptLoader: {
files: [
{
expand: true,
src: ['<%= sourcedir %>core/js/scriptLoader.js'],
dest: '<%= outputdir %>adapt/js/',
filter: 'isFile',
flatten: true
},
}
]
},
libraries: {
files: [
{
expand: true,
src: [
Expand All @@ -157,7 +161,11 @@ module.exports = function (grunt, options) {
dest: '<%= outputdir %>libraries/',
filter: 'isFile',
flatten: true
},
}
]
},
required: {
files: [
{
expand: true,
src: ['*/required/**/*'],
Expand Down
28 changes: 27 additions & 1 deletion grunt/config/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,14 @@ module.exports = {
'!<%= sourcedir %>extensions/extensions.js',
'!<%= sourcedir %>menu/menu.js',
'!<%= sourcedir %>theme/theme.js',
'!<%= sourcedir %>templates/templates.js'
'!<%= sourcedir %>templates/templates.js',
'!<%= sourcedir %>core/js/scriptLoader.js',
'!<%= sourcedir %>core/js/libraries/require.js',
'!<%= sourcedir %>core/js/libraries/modernizr.js',
'!<%= sourcedir %>core/js/libraries/json2.js',
'!<%= sourcedir %>core/js/libraries/consoles.js',
'!<%= sourcedir %>core/js/libraries/jquery.js',
'!<%= sourcedir %>core/js/libraries/jquery.v2.js'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to use a glob here? (i.e. like libraries/*) -- why do we only copy some?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to make sure that after making change to these specific files should not trigger a javascript:dev task because we are just intended to copy them directly into the build folder.

I haven't used glob here because there are few other libraries available (e.g. backbone.js, etc..) which needs to be watched for there changes as they becomes a part of adapt.min.js.

],
tasks: ['javascript:dev']
},
Expand Down Expand Up @@ -62,5 +69,24 @@ module.exports = {
themeFonts: {
files: ['<%= sourcedir %>theme/<%= theme %>/**/fonts/**'],
tasks: ['copy:themeFonts']
},
scriptLoader: {
files: ['<%= sourcedir %>core/js/scriptLoader.js'],
tasks: ['copy:scriptLoader']
},
libraries: {
files: [
'<%= sourcedir %>core/js/libraries/require.js',
'<%= sourcedir %>core/js/libraries/modernizr.js',
'<%= sourcedir %>core/js/libraries/json2.js',
'<%= sourcedir %>core/js/libraries/consoles.js',
'<%= sourcedir %>core/js/libraries/jquery.js',
'<%= sourcedir %>core/js/libraries/jquery.v2.js'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

glob? (see above)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only these files could go to the build\libraries directory.

],
tasks: ['copy:libraries']
},
required: {
files: ['<%= sourcedir %>extensions/*/required/**/*'],
tasks: 'copy:required'
}
}