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 06:29:38 (GMT)
committer Bryan Berry <bryan@olenepal.org>2010-01-04 06:29:38 (GMT)
commitf168768ce4fb9d6a449e35be3364b9d5a4c1f1e5 (patch)
treef57d6e0668f1dfd5db1546cc0da3d18691cb376e
parent62233207535800501b313abe3f4a0dc0c428143b (diff)
jake clean-bundle works
-rw-r--r--Jakefile101
m---------build/lessons/karma_lesson10
2 files changed, 87 insertions, 14 deletions
diff --git a/Jakefile b/Jakefile
index 6fe3753..21e37f7 100644
--- a/Jakefile
+++ b/Jakefile
@@ -6,11 +6,21 @@ var FILE = require("file"),
JAKE = require("jake");
var buildDir = './build',
- bundleSrcDir = FILE.join(buildDir, 'bundleSrc'),
- lessonsDir = FILE.join(buildDir, 'bundleSrc');
-
+ bundleDir = FILE.join(buildDir, 'bundle'),
+ lessonsDir = FILE.join(buildDir, 'lessons');
+
+var LESSONS = [ ['~/tmp/karma_lesson1', 'karma_lesson1'],
+ ['~/tmp/karma_lesson2', 'karma_lesson2'],
+ ['~/tmp/karma_lesson3', 'karma_lesson3'],
+ // [" git://git.sugarlabs.org/karma_adding_up_to_10_svg/mainline.git",
+ // "karma_adding_up_to_10_svg"],
+ // ["gitorious@git.sugarlabs.org:karma_conozco-uruguay/mainline.git",
+ // 'karma_Conozco-Uruguay'],
+ // ["~/karma/lessons/English_Alphabet_Puzzle_Solving",
+ // 'karma_English_Alphabet_Puzzle_Solving']
+ ];
var includedLessons = [];
-
+var bundleType = '';
var CLEAN = require('jake/clean').CLEAN;
CLEAN.include('**/#*#', '**/\.tmp');
@@ -31,25 +41,88 @@ JAKE.task('docs', function(){
});
-JAKE.task('build stable', function()
-{
- if (!FILE.exists(buildDir)){
- FILE.mkdir(buildDir);
+JAKE.task('checkout', function(){
+ OS.system('git checkout master;');
+});
+
+
+JAKE.filedir('lessons-dir', function(){
+ FILE.mkdirs(lessonsDir);
+});
+
+var prepareEachLessonDir = function(repo, tag){
+ var exitCode = '';
+ var lessonRepo = repo[0];
+ var lessonName = repo[1];
+ var cmd = '';
+ var lessonDir = FILE.join(lessonsDir, lessonName);
+
+ if(!FILE.exists(FILE.join(lessonDir, '.git'))){
+ if(FILE.exists(lessonDir)){
+ FILE.rmdir(lessonDir);
+ FILE.mkdir(lessonDir);
}
-
- print('foo');
+
+ cmd = "git clone " + lessonRepo + " " + lessonDir;
+ OS.system(cmd);
+ }
+
+ print(tag);
+ cmd = "cd " + lessonDir + ";git pull -t origin master; git checkout " + tag ;
+ exitCode = OS.system(cmd);
+
+ if(exitCode === 0){
+ includedLessons.push(lessonName);
+ }
+};
+
+
+JAKE.task('build-stable', ['checkout', 'lessons-dir'], function()
+{
+ LESSONS.forEach(function(lessonRepo) {
+ prepareEachLessonDir(lessonRepo, "stable");
+ });
});
+JAKE.task('build', ['build-latest']);
-JAKE.task('build', function()
+JAKE.task('build-latest',['checkout', 'lessons-dir'], function()
{
- if (!FILE.exists(buildDir)){
- FILE.mkdir(buildDir);
+ LESSONS.forEach(function(lessonRepo) {
+ prepareEachLessonDir(lessonRepo, "master");
+ });
+
+});
+
+JAKE.task('clean-bundle', function(){
+ if(FILE.exists(bundleDir)){
+ FILE.rmtree(bundleDir);
}
- print('foobar');
+ FILE.mkdir(bundleDir);
+});
+
+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'));
+
});
+JAKE.task('web-bundle', ['checkout', 'clean-bundle'],function(){
+ var webFiles = [ './assets', './css', 'index*', './js'];
+ bundleType = 'web';
+
+ webFiles.forEach(function(filename){
+ var cmd = 'cp -rf ' + filename + ' ' + bundledir;
+ OS.system(cmd);
+ });
+});
+
+
+
+
//clobber
diff --git a/build/lessons/karma_lesson1 b/build/lessons/karma_lesson1
new file mode 160000
+Subproject b29570fce1bd6661925853289b4af850f6a998b