Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aulizko/202343 to your computer and use it in GitHub Desktop.
Save aulizko/202343 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<project name="deploy" default="stripFirebugConsoleCalls" basedir=".">
<!-- место, где сложены наши еще не сжатые и не слитые в один js-скрипты -->
<property name="js" value="js/"/>
<!-- регулярка для отлова нездоровых элементов (беззастенчиво утянута с yui builder'a, и слегка доведена напильником)
http://github.com/yui/builder/blob/master/componentbuild/shared/properties.xml 79-я строка -->
<property name="firebug.console.regex" value="^.*?(?:console.log|console.dir).*?(?:;|\).*;|(?:\r?\n.*?)*?\).*;).*;?.*?\r?\n" />
<property name="firebug.console.regex.flags" value="mg" />
<property name="firebug.console.regex.byline" value="false" />
<property name="firebug.console.regex.replace" value="" />
<!-- Сам таргет тоже без затей "вдохновен" YUI Builder'ом, оригинал тут:
http://github.com/yui/builder/blob/master/componentbuild/3.x/module.xml 19-я строка -->
<target name="stripFirebugConsoleCalls" description="Replace firebug console calls">
<replaceregexp byline="${firebug.console.regex.byline}"
match="${firebug.console.regex}"
replace="${firebug.console.regex.replace}"
flags="${firebug.console.regex.flags}">
<fileset dir="${js}" includes="*.js" />
</replaceregexp>
</target>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment