#!/usr/bin/env php
<?php
$unminifiedFile = '../sample/js/jquery-calx-sample-2.2.8.js';
$minifiedFile = '../sample/js/jquery-calx-sample-2.2.8.min.js';
/**
* gathering all js source and build into one package
*/
ob_start();
require 'calx-build-sample.php';
$jsBuild = ob_get_contents();
ob_end_clean();
file_put_contents($unminifiedFile, $jsBuild);
/**
* start minifiying completed built
*/
require 'vendor/autoload.php';
use Devize\ClosureCompiler\ClosureCompiler;
$compiler = new ClosureCompiler;
$compiler->addSourceFile($unminifiedFile);
$compiler->setTargetFile($minifiedFile);
$compiler->setCompilationLevel('SIMPLE');
$compiler->compile();
//unlink($unminifiedFile);
?>
|