]> iEval git - gruntmaster-page.git/blame - make_static.PL
Add ruby
[gruntmaster-page.git] / make_static.PL
CommitLineData
8798626b
MG
1#!/usr/bin/perl
2use v5.14;
3use warnings;
4
5use CSS::Minifier::XS qw//;
6use JavaScript::Minifier::XS qw//;
7
8use File::Slurp qw/read_file write_file/;
9
10mkdir 'static';
11mkdir 'static/css';
12
13my $common_css;
14$common_css .= read_file $_ for <css/*.css>;
15for (<css/themes/*>) {
16 my ($theme) = m,themes/(.*)\.css,;
17 my $css = read_file $_;
18 $css .= $common_css;
19 write_file "static/css/$theme.css", CSS::Minifier::XS::minify $css;
20}
21
9cad7bdd
MG
22if (-f 'compiler.jar') {
23 system java => -jar => 'compiler.jar', qw,-O SIMPLE --create_source_map static/js.map --js_output_file static/js.js --language_in ECMASCRIPT5_STRICT --source_map_location_mapping js/|/static/js/,, <js/*>;
24 my $js = read_file 'static/js.js';
25 write_file 'static/js.js', '//# sourceMappingURL=/static/js.map', "\n", $js;
26 system 'cp', '-rp', 'js', 'static/';
27} else {
28 my $js;
29 $js .= read_file $_ for <js/*.js>;
30 write_file 'static/js.js', JavaScript::Minifier::XS::minify $js;
31}
This page took 0.023891 seconds and 4 git commands to generate.