Permalink
Browse files

Minify strophe.js in release mode

  • Loading branch information...
1 parent 521168d commit e4ee43f42e3e3d0d07bad9836d463f582b8cb8db @benlangfeld benlangfeld committed Nov 10, 2010
Showing with 19 additions and 3 deletions.
  1. +1 −0 .gitignore
  2. +18 −3 Jakefile
View
@@ -6,3 +6,4 @@ Documentation
*Build
debug.txt
Resources/Strophe/strophe.js
+strophe.js
View
@@ -56,13 +56,13 @@ framework ("StropheCappuccino", function(task)
task("build", ["StropheCappuccino"]);
-task("debug", ["build-strophe"], function()
+task("debug", ["build-strophe-debug"], function()
{
ENV["CONFIG"] = "Debug"
JAKE.subjake(["."], "build", ENV);
});
-task("release", ["build-strophe"], function()
+task("release", ["build-strophe-release"], function()
{
ENV["CONFIG"] = "Release"
JAKE.subjake(["."], "build", ENV);
@@ -120,12 +120,27 @@ task("test", function()
task("build-strophe", function()
{
- var cmdString = "cd strophejs && make normal && mv strophe.js ../Resources/Strophe/strophe.js && cd ../";
+ var cmdString = "cd strophejs && make normal && mv strophe.js ../ && cd ../";
var code = OS.system(cmdString);
if (code !== 0)
OS.exit(code);
});
+task("build-strophe-release", ["build-strophe"], function()
+{
+ var miniInput = FILE.read(FILE.join("strophe.js"), { charset:"UTF-8" });
+ var minified = require("minify/shrinksafe").compress(miniInput, { charset : "UTF-8", useServer : true });
+ FILE.path("Resources/Strophe").absolute().join("strophe.js").write(minified, { charset : "UTF-8" });
+});
+
+task("build-strophe-debug", ["build-strophe"], function()
+{
+ var cmdString = "mv strophe.js Resources/Strophe/strophe.js";
+ var code = OS.system(cmdString);
+ if (code !== 0)
+ OS.exit(code);
+});
+
task ("default", ["release"]);
task ("docs", ["release", "documentation"]);
task ("all", ["release", "debug", "documentation"]);

0 comments on commit e4ee43f

Please sign in to comment.