Skip to content

Commit f3db1e2

Browse files
committed
Merge pull request #275 from phase2/feature/fix_packaging_grunt_v1
Fix packaging with Grunt v1 and G-D-T v0.11
2 parents 76ccfb5 + 2918a30 commit f3db1e2

File tree

5 files changed

+64
-4
lines changed

5 files changed

+64
-4
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,6 @@ script:
5757
- grunt test
5858
- sleep 1; while (ps aux | grep '[b]ehat' > /dev/null); do sleep 1; done
5959
- for pid in `ps aux | grep drush | grep runserver | awk '{print $2}'`; do echo "Stopping drush pid $pid"; kill -SIGINT $pid; done;
60+
- grunt package --quiet
6061
- mocha --timeout 10000 node_modules/grunt-drupal-tasks/test/build.js
6162
- mocha node_modules/grunt-drupal-tasks/test/library.js

tasks/copy.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ module.exports = function(grunt) {
2626
cwd: '<%= config.srcPaths.drupal %>/static',
2727
src: ['**', '.**'],
2828
dest: '<%= config.buildPaths.html %>',
29-
dot: true
29+
dot: true,
30+
follow: true
3031
}
3132
]
3233
});
@@ -41,7 +42,8 @@ module.exports = function(grunt) {
4142
cwd: '<%= config.buildPaths.temp %>',
4243
src: ['**', '.**'],
4344
dest: '<%= config.buildPaths.html %>',
44-
dot: true
45+
dot: true,
46+
follow: true
4547
}
4648
]
4749
});

tasks/package.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,15 @@ module.exports = function(grunt) {
2727
cwd: '<%= config.buildPaths.html %>',
2828
src: srcFiles,
2929
dest: destPath + (grunt.config.get('config.packages.dest.docroot') || ''),
30-
dot: true
30+
dot: true,
31+
follow: true
3132
},
3233
{
3334
expand: true,
3435
src: projFiles,
3536
dest: destPath + (grunt.config.get('config.packages.dest.devResources') || ''),
36-
dot: true
37+
dot: true,
38+
follow: true
3739
}
3840
],
3941
options: {

test/build.js

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,60 @@ describe('grunt', function() {
8484
});
8585
});
8686

87+
// Ensure a custom library file is available under build.
88+
var librariesBuildDest = (drupalCore == '8') ? 'build/html/libraries/example_lib/example.md' : 'build/html/sites/all/libraries/example_lib/example.md';
89+
it('custom library file should exist in build', function(done) {
90+
fs.exists(librariesBuildDest, function (exists) {
91+
assert.ok(exists);
92+
done();
93+
});
94+
});
95+
96+
// Ensure a custom module file is available under build.
97+
var modulesBuildDest = (drupalCore == '8') ? 'build/html/modules/custom/test.php' : 'build/html/sites/all/modules/custom/test.php';
98+
it('custom module file should exist in build', function(done) {
99+
fs.exists(modulesBuildDest, function (exists) {
100+
assert.ok(exists);
101+
done();
102+
});
103+
});
104+
105+
// Ensure a custom theme file is available under build.
106+
var themesBuildDest = (drupalCore == '8') ? 'build/html/themes/custom/example_theme/config.rb' : 'build/html/sites/all/themes/custom/example_theme/config.rb';
107+
it('custom theme file should exist in build', function(done) {
108+
fs.exists(themesBuildDest, function (exists) {
109+
assert.ok(exists);
110+
done();
111+
});
112+
});
113+
114+
// Ensure a custom library file is available under package.
115+
var librariesPackageDest = (drupalCore == '8') ? 'build/packages/package/libraries/example_lib/example.md' : 'build/packages/package/sites/all/libraries/example_lib/example.md';
116+
it('custom library file should exist in package', function(done) {
117+
fs.exists(librariesPackageDest, function (exists) {
118+
assert.ok(exists);
119+
done();
120+
});
121+
});
122+
123+
// Ensure a custom module file is available under package.
124+
var modulesPackageDest = (drupalCore == '8') ? 'build/packages/package/modules/custom/test.php' : 'build/packages/package/sites/all/modules/custom/test.php';
125+
it('custom module file should exist in package', function(done) {
126+
fs.exists(modulesPackageDest, function (exists) {
127+
assert.ok(exists);
128+
done();
129+
});
130+
});
131+
132+
// Ensure a custom theme file is available under package.
133+
var themesPackageDest = (drupalCore == '8') ? 'build/packages/package/themes/custom/example_theme/config.rb' : 'build/packages/package/sites/all/themes/custom/example_theme/config.rb';
134+
it('custom theme file should exist in package', function(done) {
135+
fs.exists(themesPackageDest, function (exists) {
136+
assert.ok(exists);
137+
done();
138+
});
139+
});
140+
87141
// Ensure the build/html/sites/all/themes/custom/example_theme/stylesheets/screen.css
88142
// file exists, which should be created by compass.
89143
var sassDest = (drupalCore == '8') ? 'build/html/themes/custom/example_theme/stylesheets/screen.css' : 'build/html/sites/all/themes/custom/example_theme/stylesheets/screen.css';

test/test.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ run_tests () {
1313
grunt test
1414
sleep 1; while (ps aux | grep '[b]ehat' > /dev/null); do sleep 1; done
1515
for pid in `ps aux | grep drush | grep runserver | awk '{print $2}'`; do echo "Stopping drush pid $pid"; kill -SIGINT $pid; done;
16+
grunt package --quiet
1617
# end-to-end tests
1718
mocha --timeout 10000 node_modules/grunt-drupal-tasks/test/build.js
1819
# unit tests

0 commit comments

Comments
 (0)