Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adding utils

  • Loading branch information...
commit 58fad52f88ca68b0cdfef898fd45d0a7badb4b70 1 parent af9884e
@kristoferjoseph kristoferjoseph authored
View
6 Gruntfile.js
@@ -23,7 +23,7 @@ module.exports = function(grunt) {
// Before generating any new files, remove any previously-created files.
clean: {
tests: ['tmp'],
- zip: ['tmp/src/*.zip', 'tmp/src/controls/*.zip', 'tmp/src/skins/*.zip']
+ zip: ['tmp/src/*.zip', 'tmp/src/controls/*.zip', 'tmp/src/utils/*.zip', 'tmp/src/skins/*.zip']
},
// Configuration to be run (and then tested).
@@ -45,6 +45,10 @@ module.exports = function(grunt) {
src: "tmp/src/*.zip",
dest: "tmp/src/"
},
+ utils: {
+ src: "tmp/src/utils/*.zip",
+ dest: "tmp/src/utils"
+ },
skins: {
src: "tmp/src/skins/*.zip",
dest: "tmp/src/skins"
View
6 package.json
@@ -16,6 +16,9 @@
"skins": {
"topcoat/button": "0.1.0"
},
+ "utils": {
+ "topcoat/utils": ""
+ },
"theme": {
"topcoat/theme": "0.1.0"
}
@@ -41,7 +44,8 @@
"test": "grunt test"
},
"dependencies": {
- "request": "~2.16.6"
+ "request": "~2.16.6",
+ "progress": "~0.1.0"
},
"devDependencies": {
"grunt-contrib-jshint": "0.1.1rc6",
View
21 tasks/topcoat.js
@@ -12,7 +12,7 @@ var fs = require('fs'),
module.exports = function(grunt) {
- grunt.registerMultiTask('topcoat', 'Downloads specified repos for use in the TopDoat build process.', function() {
+ grunt.registerMultiTask('topcoat', 'Downloads specified repos for use in the TopCoat build process.', function() {
var _ = grunt.util._,
async = grunt.util.async,
done = this.async(),
@@ -22,6 +22,7 @@ module.exports = function(grunt) {
deps = options.repos,
controls = deps.controls || {},
skins = deps.skins || {},
+ utils = deps.utils || {},
theme = deps.theme || {};
// Splits the supplied user/repo name so we can use just the repo name
@@ -149,11 +150,6 @@ module.exports = function(grunt) {
},
function(callback) {
- grunt.task.run('unzip:controls');
- callback();
- },
-
- function(callback) {
// Download theme into srcPath/theme
if (!_.isEmpty(theme)) {
downloadResources(theme, srcPath, callback);
@@ -164,8 +160,15 @@ module.exports = function(grunt) {
},
function(callback) {
- grunt.task.run('unzip:theme');
- callback();
+ // Download utils into srcPath/utils
+ if (!_.isEmpty(utils)) {
+ var utilsPath = srcPath + "utils/";
+ file.mkdir(utilsPath);
+ downloadResources(utils, utilsPath, callback);
+ } else {
+ callback();
+ grunt.log.writeln("No utils specified");
+ }
},
function(callback) {
@@ -181,7 +184,7 @@ module.exports = function(grunt) {
},
function(callback) {
- grunt.task.run('unzip:skins');
+ grunt.task.run('unzip');
callback();
},
View
5 test/topcoat_test.js
@@ -37,6 +37,11 @@ exports.topcoat = {
test.ok(exists);
});
+ var utils = grunt.file.expand('tmp/src/utils/topcoat-utils-*')[0];
+ fs.exists(utils, function(exists) {
+ test.ok(exists);
+ });
+
fs.exists("tmp/src/theme-0.1.0", function(exists) {
test.ok(exists);
});
Please sign in to comment.
Something went wrong with that request. Please try again.