Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Berry <bryan@olenepal.org>2010-01-04 07:57:12 (GMT)
committer Bryan Berry <bryan@olenepal.org>2010-01-04 07:57:12 (GMT)
commit5d43df9f0d1af794b2a0315cb94f28d6e3eeeb0b (patch)
treec3b15798531b92bd85f08e014144953fce446ec0
parentf168768ce4fb9d6a449e35be3364b9d5a4c1f1e5 (diff)
reworked Jakefile
l---------.#Jakefile1
-rw-r--r--.gitignore1
-rw-r--r--Jakefile53
m---------build/lessons/karma_lesson10
4 files changed, 44 insertions, 11 deletions
diff --git a/.#Jakefile b/.#Jakefile
new file mode 120000
index 0000000..f774db9
--- /dev/null
+++ b/.#Jakefile
@@ -0,0 +1 @@
+hitman@xiaopo.1775:1262235051 \ No newline at end of file
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..d163863
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+build/ \ No newline at end of file
diff --git a/Jakefile b/Jakefile
index 21e37f7..95643fa 100644
--- a/Jakefile
+++ b/Jakefile
@@ -7,7 +7,9 @@ var FILE = require("file"),
var buildDir = './build',
bundleDir = FILE.join(buildDir, 'bundle'),
- lessonsDir = FILE.join(buildDir, 'lessons');
+ lessonsDir = FILE.join(buildDir, 'lessons'),
+ htmlDir = bundleDir;
+
var LESSONS = [ ['~/tmp/karma_lesson1', 'karma_lesson1'],
['~/tmp/karma_lesson2', 'karma_lesson2'],
@@ -48,7 +50,12 @@ JAKE.task('checkout', function(){
JAKE.filedir('lessons-dir', function(){
FILE.mkdirs(lessonsDir);
-});
+});
+
+
+JAKE.filedir('bundle-dir', function(){
+ FILE.mkdirs(FILE.join(bundleDir, 'lessons'));
+});
var prepareEachLessonDir = function(repo, tag){
var exitCode = '';
@@ -76,12 +83,26 @@ var prepareEachLessonDir = function(repo, tag){
}
};
+var copyLessons = function(){
+ includedLessons.forEach(function(lessonName){
+ var lessonDir = FILE.join(bundleDir, 'lessons');
+ var cmdCopyLessons = "cp -r " + lessonsDir + "/" +
+ lessonName + " " + lessonDir;
+ var cmdRmGitFiles = "find " + bundleDir + " -d -name '.git' " +
+ "-exec rm -rf {} \\; ";
+ OS.system(cmdCopyLessons);
+ OS.system(cmdRmGitFiles);
+
+ });
+};
+
-JAKE.task('build-stable', ['checkout', 'lessons-dir'], function()
+JAKE.task('build-stable', ['checkout', 'lessons-dir', 'bundle-dir'], function()
{
LESSONS.forEach(function(lessonRepo) {
prepareEachLessonDir(lessonRepo, "stable");
});
+ copyLessons();
});
JAKE.task('build', ['build-latest']);
@@ -91,6 +112,7 @@ JAKE.task('build-latest',['checkout', 'lessons-dir'], function()
LESSONS.forEach(function(lessonRepo) {
prepareEachLessonDir(lessonRepo, "master");
});
+ copyLessons();
});
@@ -102,22 +124,31 @@ JAKE.task('clean-bundle', function(){
FILE.mkdir(bundleDir);
});
+var copyWebFiles = function(){
+ var webSrcFiles = [ './assets', './css', 'index*', './js'];
+
+ webSrcFiles.forEach(function(){
+ var cmd = 'cp -rf ' + filename + ' ' + htmlDir;
+ OS.system(cmd);
+ });
+};
+
+
JAKE.task('xo-bundle', ['checkout', 'clean-bundle'], function(){
var bundleSrc = './tools/xo_bundle/';
+
bundleType = "xo";
OS.system('cp -r ' + bundleSrc + "/* " + bundleDir );
FILE.mkdir(FILE.join(bundleDir, 'karma'));
-
+ htmlDir = FILE.join(htmlDir, 'karma');
+ copyWebFiles(htmlDir);
+ FILE.move(FILE.join(bundleDir, 'lessons'), FILE.join(htmlDir, 'lessons'));
+
});
-JAKE.task('web-bundle', ['checkout', 'clean-bundle'],function(){
- var webFiles = [ './assets', './css', 'index*', './js'];
+JAKE.task('web-bundle', ['checkout', 'clean-bundle'], function(){
bundleType = 'web';
-
- webFiles.forEach(function(filename){
- var cmd = 'cp -rf ' + filename + ' ' + bundledir;
- OS.system(cmd);
- });
+ copyWebFiles(htmlDir);
});
diff --git a/build/lessons/karma_lesson1 b/build/lessons/karma_lesson1
deleted file mode 160000
-Subproject b29570fce1bd6661925853289b4af850f6a998b