Skip to content

Commit

Permalink
Minify strophe.js in release mode
Browse files Browse the repository at this point in the history
  • Loading branch information
benlangfeld committed Nov 10, 2010
1 parent 521168d commit e4ee43f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ Documentation
*Build
debug.txt
Resources/Strophe/strophe.js
strophe.js
21 changes: 18 additions & 3 deletions Jakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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.