Permalink
Browse files

multi-target compilation is working

  • Loading branch information...
1 parent 76b0b39 commit a1c48170361856860e4965cb51363c0106bcc137 @mattacular committed Jul 4, 2013
Showing with 6,595 additions and 0 deletions.
  1. +22 −0 .jshintrc
  2. +46 −0 Gruntfile.js
  3. +3 −0 package.json
  4. +76 −0 tasks/compass.js
  5. BIN tests/compassTest/.sass-cache/47bc3e79e5cf428e640b160a6ff691ab3903ebe8/_css3.scssc
  6. BIN tests/compassTest/.sass-cache/47bc3e79e5cf428e640b160a6ff691ab3903ebe8/_layout.scssc
  7. BIN tests/compassTest/.sass-cache/47bc3e79e5cf428e640b160a6ff691ab3903ebe8/_reset.scssc
  8. BIN tests/compassTest/.sass-cache/47bc3e79e5cf428e640b160a6ff691ab3903ebe8/_support.scssc
  9. BIN tests/compassTest/.sass-cache/5a9213a7499eac53953b1dc09cb7cfa58d51c527/_hacks.scssc
  10. BIN tests/compassTest/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_appearance.scssc
  11. BIN tests/compassTest/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_background-clip.scssc
  12. BIN tests/compassTest/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_background-origin.scssc
  13. BIN tests/compassTest/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_background-size.scssc
  14. BIN tests/compassTest/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_border-radius.scssc
  15. BIN tests/compassTest/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_box-shadow.scssc
  16. BIN tests/compassTest/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_box-sizing.scssc
  17. BIN tests/compassTest/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_box.scssc
  18. BIN tests/compassTest/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_columns.scssc
  19. BIN tests/compassTest/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_filter.scssc
  20. BIN tests/compassTest/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_font-face.scssc
  21. BIN tests/compassTest/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_hyphenation.scssc
  22. BIN tests/compassTest/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_images.scssc
  23. BIN tests/compassTest/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_inline-block.scssc
  24. BIN tests/compassTest/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_opacity.scssc
  25. BIN tests/compassTest/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_regions.scssc
  26. BIN tests/compassTest/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_shared.scssc
  27. BIN tests/compassTest/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_text-shadow.scssc
  28. +1,278 −0 tests/compassTest/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_transform.scssc
  29. +613 −0 tests/compassTest/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_transition.scssc
  30. BIN tests/compassTest/.sass-cache/8fb43f757b1fd98d88d0d2b0103d19da8f42b4c6/_grid-background.scssc
  31. BIN tests/compassTest/.sass-cache/8fb43f757b1fd98d88d0d2b0103d19da8f42b4c6/_sticky-footer.scssc
  32. BIN tests/compassTest/.sass-cache/8fb43f757b1fd98d88d0d2b0103d19da8f42b4c6/_stretching.scssc
  33. BIN tests/compassTest/.sass-cache/928717f716b7357483cd89c938a244e1fd7e2fc7/_utilities.scssc
  34. BIN tests/compassTest/.sass-cache/aae399c4ad7b1f286cbdbabec42828683797e61b/apply.scssc
  35. BIN tests/compassTest/.sass-cache/aae399c4ad7b1f286cbdbabec42828683797e61b/ie.scssc
  36. BIN tests/compassTest/.sass-cache/aae399c4ad7b1f286cbdbabec42828683797e61b/print.scssc
  37. BIN tests/compassTest/.sass-cache/aae399c4ad7b1f286cbdbabec42828683797e61b/screen.scssc
  38. BIN tests/compassTest/.sass-cache/aae399c4ad7b1f286cbdbabec42828683797e61b/test.scssc
  39. +24 −0 tests/compassTest/config.rb
  40. +70 −0 tests/compassTest/css/apply.css
  41. +7 −0 tests/compassTest/sass/_test.scss
  42. +7 −0 tests/compassTest/sass/apply.scss
  43. +11 −0 tests/compassTest/stylesheets/_printer.scss
  44. +7 −0 tests/compassTest/stylesheets/apply.scss
  45. BIN tests/modules/tester/.sass-cache/032c9b6874bbfd7d9ac866038be932e36aae5215/test.scssc
  46. BIN tests/modules/tester/.sass-cache/47bc3e79e5cf428e640b160a6ff691ab3903ebe8/_css3.scssc
  47. BIN tests/modules/tester/.sass-cache/47bc3e79e5cf428e640b160a6ff691ab3903ebe8/_layout.scssc
  48. BIN tests/modules/tester/.sass-cache/47bc3e79e5cf428e640b160a6ff691ab3903ebe8/_reset.scssc
  49. BIN tests/modules/tester/.sass-cache/47bc3e79e5cf428e640b160a6ff691ab3903ebe8/_support.scssc
  50. BIN tests/modules/tester/.sass-cache/5a9213a7499eac53953b1dc09cb7cfa58d51c527/_hacks.scssc
  51. BIN tests/modules/tester/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_appearance.scssc
  52. BIN tests/modules/tester/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_background-clip.scssc
  53. BIN tests/modules/tester/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_background-origin.scssc
  54. BIN tests/modules/tester/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_background-size.scssc
  55. BIN tests/modules/tester/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_border-radius.scssc
  56. BIN tests/modules/tester/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_box-shadow.scssc
  57. BIN tests/modules/tester/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_box-sizing.scssc
  58. BIN tests/modules/tester/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_box.scssc
  59. BIN tests/modules/tester/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_columns.scssc
  60. BIN tests/modules/tester/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_filter.scssc
  61. BIN tests/modules/tester/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_font-face.scssc
  62. BIN tests/modules/tester/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_hyphenation.scssc
  63. BIN tests/modules/tester/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_images.scssc
  64. BIN tests/modules/tester/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_inline-block.scssc
  65. BIN tests/modules/tester/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_opacity.scssc
  66. BIN tests/modules/tester/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_regions.scssc
  67. BIN tests/modules/tester/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_shared.scssc
  68. BIN tests/modules/tester/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_text-shadow.scssc
  69. +1,278 −0 tests/modules/tester/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_transform.scssc
  70. +613 −0 tests/modules/tester/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_transition.scssc
  71. BIN tests/modules/tester/.sass-cache/8fb43f757b1fd98d88d0d2b0103d19da8f42b4c6/_grid-background.scssc
  72. BIN tests/modules/tester/.sass-cache/8fb43f757b1fd98d88d0d2b0103d19da8f42b4c6/_sticky-footer.scssc
  73. BIN tests/modules/tester/.sass-cache/8fb43f757b1fd98d88d0d2b0103d19da8f42b4c6/_stretching.scssc
  74. BIN tests/modules/tester/.sass-cache/928717f716b7357483cd89c938a244e1fd7e2fc7/_utilities.scssc
  75. BIN tests/modules/tester/.sass-cache/a9c90033c6219e6457455aac4109786a9c28467c/test.scssc
  76. BIN tests/modules/tester/.sass-cache/c49fa1ccd2341701dd11c42d5949bfa122baf5e1/_printer.scssc
  77. BIN tests/modules/tester/.sass-cache/c49fa1ccd2341701dd11c42d5949bfa122baf5e1/apply.scssc
  78. BIN tests/modules/tester/.sass-cache/faaa86d613bd167e90dececc1f21b6f873c762c6/_printer.scssc
  79. BIN tests/modules/tester/.sass-cache/faaa86d613bd167e90dececc1f21b6f873c762c6/apply.scssc
  80. +25 −0 tests/modules/tester/config.rb
  81. +146 −0 tests/modules/tester/css/test.css
  82. +4 −0 tests/modules/tester/sass/test.scss
  83. BIN tests/modules/tester2/.sass-cache/1846c3122ef29365776bd37af8760ae111686f9e/test.scssc
  84. BIN tests/modules/tester2/.sass-cache/1846c3122ef29365776bd37af8760ae111686f9e/test2.scssc
  85. BIN tests/modules/tester2/.sass-cache/1846c3122ef29365776bd37af8760ae111686f9e/test3.scssc
  86. BIN tests/modules/tester2/.sass-cache/47bc3e79e5cf428e640b160a6ff691ab3903ebe8/_css3.scssc
  87. BIN tests/modules/tester2/.sass-cache/47bc3e79e5cf428e640b160a6ff691ab3903ebe8/_layout.scssc
  88. BIN tests/modules/tester2/.sass-cache/47bc3e79e5cf428e640b160a6ff691ab3903ebe8/_reset.scssc
  89. BIN tests/modules/tester2/.sass-cache/47bc3e79e5cf428e640b160a6ff691ab3903ebe8/_support.scssc
  90. BIN tests/modules/tester2/.sass-cache/5901cc660984864222db01bff2ee188c79c2a02f/test.scssc
  91. BIN tests/modules/tester2/.sass-cache/5901cc660984864222db01bff2ee188c79c2a02f/test2.scssc
  92. BIN tests/modules/tester2/.sass-cache/5901cc660984864222db01bff2ee188c79c2a02f/test3.scssc
  93. BIN tests/modules/tester2/.sass-cache/5a9213a7499eac53953b1dc09cb7cfa58d51c527/_hacks.scssc
  94. BIN tests/modules/tester2/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_appearance.scssc
  95. BIN tests/modules/tester2/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_background-clip.scssc
  96. BIN tests/modules/tester2/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_background-origin.scssc
  97. BIN tests/modules/tester2/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_background-size.scssc
  98. BIN tests/modules/tester2/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_border-radius.scssc
  99. BIN tests/modules/tester2/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_box-shadow.scssc
  100. BIN tests/modules/tester2/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_box-sizing.scssc
  101. BIN tests/modules/tester2/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_box.scssc
  102. BIN tests/modules/tester2/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_columns.scssc
  103. BIN tests/modules/tester2/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_filter.scssc
  104. BIN tests/modules/tester2/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_font-face.scssc
  105. BIN tests/modules/tester2/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_hyphenation.scssc
  106. BIN tests/modules/tester2/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_images.scssc
  107. BIN tests/modules/tester2/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_inline-block.scssc
  108. BIN tests/modules/tester2/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_opacity.scssc
  109. BIN tests/modules/tester2/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_regions.scssc
  110. BIN tests/modules/tester2/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_shared.scssc
  111. BIN tests/modules/tester2/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_text-shadow.scssc
  112. +1,278 −0 tests/modules/tester2/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_transform.scssc
  113. +613 −0 tests/modules/tester2/.sass-cache/75640fff35f57825ee18f946c95ef10ad0cf8fc0/_transition.scssc
  114. BIN tests/modules/tester2/.sass-cache/8fb43f757b1fd98d88d0d2b0103d19da8f42b4c6/_grid-background.scssc
  115. BIN tests/modules/tester2/.sass-cache/8fb43f757b1fd98d88d0d2b0103d19da8f42b4c6/_sticky-footer.scssc
  116. BIN tests/modules/tester2/.sass-cache/8fb43f757b1fd98d88d0d2b0103d19da8f42b4c6/_stretching.scssc
  117. BIN tests/modules/tester2/.sass-cache/928717f716b7357483cd89c938a244e1fd7e2fc7/_utilities.scssc
  118. BIN tests/modules/tester2/.sass-cache/c49fa1ccd2341701dd11c42d5949bfa122baf5e1/_printer.scssc
  119. BIN tests/modules/tester2/.sass-cache/c49fa1ccd2341701dd11c42d5949bfa122baf5e1/apply.scssc
  120. +24 −0 tests/modules/tester2/config.rb
  121. +146 −0 tests/modules/tester2/css/test.css
  122. +146 −0 tests/modules/tester2/css/test2.css
  123. +146 −0 tests/modules/tester2/css/test3.css
  124. +4 −0 tests/modules/tester2/sass/test.scss
  125. +4 −0 tests/modules/tester2/sass/test2.scss
  126. +4 −0 tests/modules/tester2/sass/test3.scss
View
@@ -0,0 +1,22 @@
+{
+ "passfail": false,
+ "maxerr": 100,
+ "predef": [],
+ "browser": false,
+ "node": true,
+ "devel": true,
+ "es5": true,
+ "asi": false,
+ "curly": true,
+ "eqeqeq": true,
+ "eqnull": true,
+ "evil": false,
+ "immed": true,
+ "latedef": false,
+ "newcap": true,
+ "noempty": true,
+ "onevar": true,
+ "trailing": false,
+ "smarttabs": true,
+ "indent": 4
+}
View
@@ -0,0 +1,46 @@
+/*
+ * grunt-compass-compiler
+ * https://github.com/mattacular/grunt-compass-compiler
+ *
+ * Copyright (c) 2013 mstills
+ * Licensed under the MIT license.
+ */
+module.exports = function (grunt) {
+ 'use strict';
+
+ grunt.initConfig({
+ // scripts to be linted
+ jshint: {
+ all: [
+ 'Gruntfile.js',
+ 'tasks/compass.js'
+ ]
+ },
+ compass: {
+ 'glob': {
+ 'files': {
+ src: ['tests/modules/**/*']
+ }
+ },
+ 'specific': {
+ 'files': {
+ src: ['tests/modules/rester', 'tests/modules/tester']
+ }
+ }
+ },
+ clean: {
+ 'css': {
+ src: ['tests/modules/**/*.css']
+ }
+ }
+ });
+
+ grunt.loadTasks('tasks');
+
+ grunt.loadNpmTasks('grunt-contrib-jshint');
+ grunt.loadNpmTasks('grunt-contrib-clean');
+ grunt.loadNpmTasks('grunt-contrib-nodeunit');
+
+ // lint and test before declaring a revision stable
+ grunt.registerTask('default', ['jshint', 'clean:css', 'compass:glob']);
+};
View
@@ -24,6 +24,9 @@
"engines": {
"node": "*"
},
+ "dependencies": {
+ "async": "~0.2.9"
+ },
"devDependencies": {
"grunt-contrib-jshint": "~0.2.0",
"grunt-contrib-nodeunit": "~0.1.2",
View
@@ -0,0 +1,76 @@
+/*
+ * grunt-compass-compiler
+ * https://github.com/mattacular/grunt-compass-compiler
+ *
+ * Copyright (c) 2013 mstills
+ * Licensed under the MIT license.
+ */
+module.exports = function (grunt) {
+ 'use strict';
+
+ var _ = grunt.util._,
+ fs = require('fs'),
+ f = require('util').format,
+ cp = require('child_process'),
+ queue = require('async').queue,
+ log = grunt.log;
+
+ // the 'compass' task
+ grunt.registerMultiTask('compass', 'Compile multiple Compass projects.', function () {
+ var options = this.options({
+ }),
+ compilerOptions = {},
+ files, targets = [],
+ done = this.async(), childProcess;
+
+ // gather a list of targets with a 'config.rb' from all the file matches found by Grunt's globbing engine
+ this.files.forEach(function (f) {
+ for (var i = 0; i < f.src.length; i += 1) {
+ // filter out folders that don't have a config.rb (ignoring common sub-folders to speed things up)
+ if (!f.src[i].match(/sass|css|js|img|inc[(?:lude)]|template[s]?/) && grunt.file.isDir(f.src[i])) {
+ files = fs.readdirSync(f.src[i]);
+
+ if (_.indexOf(files, 'config.rb') !== -1) {
+ // contains config.rb, add it to the list of compile targets
+ targets.push(f.src[i]);
+ }
+ }
+ }
+ });
+
+ grunt.log.writeln('Compass projects found: ', f(targets));
+ grunt.log.writeln();
+ grunt.log.writeln('Compiling...\n');
+
+ // use an async queue with concurrency of 1 to simulate a procedural queue to execute each Compass compile command
+ var targetQueue = queue(function (task, callback) {
+ //childProcess = cp.exec('compass compile --output-style compressed --force', {
+ childProcess = cp.exec('compass compile', { cwd: task.directory });
+ childProcess.stdout.on('data', function (d) { log.write(d); });
+
+ // listen for process exit code
+ childProcess.on('exit', function (code) {
+ if (code !== 0) {
+ log.error('Something bad happened. Make sure \'compass\' and \'sass\' are in your path!');
+ return done(false);
+ }
+ log.writeln('\t`-->'.cyan + ' Done compiling Compass project @ ' + task.directory.cyan);
+ callback(); // task is finished
+ });
+ }, 1);
+
+ // queue each target
+ _.each(targets, function (item, idx) {
+ targetQueue.push({
+ 'directory': item
+ });
+ });
+
+ // drain callback is run once all tasks in the queue have completed
+ targetQueue.drain = function () {
+ done(); // signal back to Grunt that this task has completed
+ };
+
+ });
+
+};
Oops, something went wrong.

0 comments on commit a1c4817

Please sign in to comment.