From: Marius Gavrilescu Date: Sun, 8 Mar 2015 10:17:15 +0000 (+0200) Subject: Merge branch 'master' into newmc X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=e892a76a1aed693d33fba7f0015f42824ecf4dbb;p=plack-app-gruntmaster.git Merge branch 'master' into newmc Conflicts: Makefile.PL make_static.PL --- e892a76a1aed693d33fba7f0015f42824ecf4dbb diff --cc Makefile.PL index c6d91a7,021ffdb..2b025b1 --- a/Makefile.PL +++ b/Makefile.PL @@@ -10,7 -10,7 +10,7 @@@ WriteMakefile LICENSE => 'AGPL_3', SIGN => 1, clean => { - FILES => 'static/css/ static/js.js css/logos.css static/logos.png' - FILES => 'static/css/ static/js.js static/js.map static/js/' ++ FILES => 'static/css/ static/js.js css/logos.css static/logos.png static/js.map static/js/' }, BUILD_REQUIRES => { qw/CSS::Minifier::XS 0 diff --cc make_static.PL index 5594f75,fe06da9..01c6125 --- a/make_static.PL +++ b/make_static.PL @@@ -39,27 -19,13 +39,34 @@@ for () write_file "static/css/$theme.css", CSS::Minifier::XS::minify $css; } - my $js; - $js .= read_file $_ for ; - write_file 'static/js.js', JavaScript::Minifier::XS::minify $js; + if (-f 'compiler.jar') { + 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/,, ; + my $js = read_file 'static/js.js'; + write_file 'static/js.js', '//# sourceMappingURL=/static/js.map', "\n", $js; + system 'cp', '-rp', 'js', 'static/'; + } else { + my $js; + $js .= read_file $_ for ; + write_file 'static/js.js', JavaScript::Minifier::XS::minify $js; + } + +package + Local::CSS::SpriteMaker; + +use parent qw/CSS::SpriteMaker/; + +sub _get_stylesheet_string { + my $self = shift; + my @ret = split "\n", $self->SUPER::_get_stylesheet_string(@_); + shift @ret; + @ret = sort @ret; + unshift @ret, <