Add license info to compiled handlebars templates

This commit is contained in:
Dmitriy Simushev 2013-02-06 12:24:26 +00:00
parent fdd7ff70b1
commit 9a86a61c99
9 changed files with 91 additions and 25 deletions

View File

@ -28,6 +28,8 @@
<!-- Compile Handlebars templates for dialogs styles --> <!-- Compile Handlebars templates for dialogs styles -->
<target name="styles_handlebars"> <target name="styles_handlebars">
<echo>Compile Handlebars templates for dialogs styles</echo> <echo>Compile Handlebars templates for dialogs styles</echo>
<!-- Compile templates -->
<apply executable="handlebars"> <apply executable="handlebars">
<arg value="-m"/> <arg value="-m"/>
<arg value="-f"/> <arg value="-f"/>
@ -35,8 +37,26 @@
<dirset dir="."> <dirset dir=".">
<include name="${dialogs_styles_path}/*/handlebars_templates" /> <include name="${dialogs_styles_path}/*/handlebars_templates" />
</dirset> </dirset>
<mapper type="glob" from="*/handlebars_templates" to="*/js/compiled/templates.js" /> <mapper type="glob" from="*/handlebars_templates" to="*/js/compiled/templates_tmp.js" />
</apply> </apply>
<!-- Appent license info -->
<move todir="${dialogs_styles_path}" overwrite="true">
<fileset dir="${dialogs_styles_path}"/>
<mapper type="glob" from="*/js/compiled/templates_tmp.js" to="*/js/compiled/templates.js"/>
<filterchain>
<!-- Remove comments -->
<stripjavacomments />
<!-- Add header -->
<concatfilter prepend="compiled_templates_header.txt" />
<!-- Skip empty lines -->
<linecontainsregexp negate="true">
<regexp pattern="^\s+$$" />
</linecontainsregexp>
</filterchain>
</move>
<echo>Done</echo> <echo>Done</echo>
</target> </target>
@ -137,30 +157,17 @@
<target name="app_js" depends="core_handlebars"> <target name="app_js" depends="core_handlebars">
<echo>Build "${app_name}" JavaScript application</echo> <echo>Build "${app_name}" JavaScript application</echo>
<!-- Initialization code goes first. Preserve header comment but strip <!-- Remove old application file -->
empty lines --> <delete file="${js_path}/compiled/${app_name}_app.js" />
<!-- Append application files to the result file -->
<concat destfile="${js_path}/compiled/${app_name}_app.js" eol="lf"> <concat destfile="${js_path}/compiled/${app_name}_app.js" eol="lf">
<!-- Append templates --> <!-- Append templates -->
<filelist dir="${js_path}/templates/compiled" files="${app_name}_app.tpl.js" /> <filelist dir="${js_path}/templates/compiled" files="${app_name}_app.tpl.js" />
<!-- For some reasons handlebars do not add trailing semicolon.
Add it manually -->
<string>;</string>
<!-- Append application static initialization code --> <!-- Append application static initialization code -->
<filelist dir="${js_path}/compiled/${app_name}" files="init.js" /> <filelist dir="${js_path}/compiled/${app_name}" files="init.js" />
<!-- Apply filters -->
<filterchain>
<!-- Skip empty lines -->
<linecontainsregexp negate="true">
<regexp pattern="^\s+$$" />
</linecontainsregexp>
</filterchain>
</concat>
<!-- Append application files to the result file -->
<concat destfile="${js_path}/compiled/${app_name}_app.js" eol="lf" append="true">
<!-- Include files from ${js_path}/compiled/${app_name}/ --> <!-- Include files from ${js_path}/compiled/${app_name}/ -->
<fileset dir="${js_path}/compiled/${app_name}"> <fileset dir="${js_path}/compiled/${app_name}">
<include name="*.js" /> <include name="*.js" />
@ -290,7 +297,7 @@
<dirset dir="."> <dirset dir=".">
<include name="${js_path}/templates/source/*" /> <include name="${js_path}/templates/source/*" />
</dirset> </dirset>
<mapper type="regexp" from="^(.*)/source/(.*)$$" to="\1/compiled/\2_app.tpl.js" /> <mapper type="regexp" from="^(.*)/source/(.*)$$" to="\1/compiled/\2_app_tmp.tpl.js" />
</apply> </apply>
<!-- Build misc files --> <!-- Build misc files -->
@ -301,9 +308,32 @@
<fileset dir="."> <fileset dir=".">
<include name="${js_path}/templates/source/*.handlebars" /> <include name="${js_path}/templates/source/*.handlebars" />
</fileset> </fileset>
<mapper type="regexp" from="^(.*)/source/(.*)\.handlebars$$" to="\1/compiled/\2.tpl.js" /> <mapper type="regexp" from="^(.*)/source/(.*)\.handlebars$$" to="\1/compiled/\2_tmp.tpl.js" />
</apply> </apply>
<!-- Add licanse info -->
<move todir="${js_path}/templates/compiled" overwrite="true">
<fileset dir="${js_path}/templates/compiled">
<include name="*_tmp.tpl.js" />
</fileset>
<mapper type="glob" from="*_tmp.tpl.js" to="*.tpl.js"/>
<filterchain>
<!-- Remove comments -->
<stripjavacomments />
<!-- For some reasons handlebars do not add trailing semicolon.
Assume that where is only one line in file and add semicolon
manually -->
<suffixlines suffix=";" />
<!-- Add header -->
<concatfilter prepend="compiled_templates_header.txt" />
<!-- Skip empty lines -->
<linecontainsregexp negate="true">
<regexp pattern="^\s+$$" />
</linecontainsregexp>
</filterchain>
</move>
<echo>Done</echo> <echo>Done</echo>
</target> </target>

View File

@ -0,0 +1,6 @@
/*
This file is part of Mibew Messenger project.
http://mibew.org
Copyright (c) 2005-2011 Mibew Messenger Community
License: http://mibew.org/license.php
*/

View File

@ -1,4 +1,4 @@
;/* /*
This file is part of Mibew Messenger project. This file is part of Mibew Messenger project.
http://mibew.org http://mibew.org
Copyright (c) 2005-2011 Mibew Messenger Community Copyright (c) 2005-2011 Mibew Messenger Community

View File

@ -1,3 +1,9 @@
/*
This file is part of Mibew Messenger project.
http://mibew.org
Copyright (c) 2005-2011 Mibew Messenger Community
License: http://mibew.org/license.php
*/
(function(){var a=Handlebars.template,b=Handlebars.templates=Handlebars.templates||{};b.default_control=a(function(a,b,c,d,e){c=c||a.helpers;var f="",g,h,i="function",j=this.escapeExpression;return f+="<strong>",h=c.title,h?g=h.call(b,{hash:{}}):(g=b.title,g=typeof g===i?g():g),f+=j(g)+"</strong>",f}),b.sound=a(function(a,b,c,d,e){function j(a,b){var d="",e,f;return d+='\n<audio autoplay src="',f=c.file,f?e=f.call(a,{hash:{}}):(e=a.file,e=typeof e===g?e():e),d+=h(e)+'">\n <embed src="',f=c.file,f?e=f.call(a,{hash:{}}):(e=a.file,e=typeof e===g?e():e),d+=h(e)+'" hidden="true" autostart="true" loop="false" />\n</audio>\n',d}c=c||a.helpers;var f,g="function",h=this.escapeExpression,i=this;return f=b.file,f=c["if"].call(b,f,{hash:{},inverse:i.noop,fn:i.program(1,j,e)}),f||f===0?f:""}),b.message=a(function(a,b,c,d,e){function m(a,b){var d="",e,f;return d+="<span class='n",f=c.kindName,f?e=f.call(a,{hash:{}}):(e=a.kindName,e=typeof e===i?e():e),d+=j(e)+"'>",f=c.name,f?e=f.call(a,{hash:{}}):(e=a.name,e=typeof e===i?e():e),d+=j(e)+"</span>: ",d}function n(a,b){var d,e;return d=a.message,e=c.apply,d=e?e.call(a,d,"urlReplace, nl2br, allowTags",{hash:{}}):k.call(a,"apply",d,"urlReplace, nl2br, allowTags",{hash:{}}),j(d)}function o(a,b){var d,e;return d=a.message,e=c.apply,d=e?e.call(a,d,"urlReplace, nl2br",{hash:{}}):k.call(a,"apply",d,"urlReplace, nl2br",{hash:{}}),j(d)}c=c||a.helpers;var f="",g,h,i="function",j=this.escapeExpression,k=c.helperMissing,l=this;f+="<span>",g=b.created,h=c.formatTime,g=h?h.call(b,g,{hash:{}}):k.call(b,"formatTime",g,{hash:{}}),f+=j(g)+"</span>\n",g=b.name,g=c["if"].call(b,g,{hash:{},inverse:l.noop,fn:l.program(1,m,e)});if(g||g===0)f+=g;f+="\n<span class='m",h=c.kindName,h?g=h.call(b,{hash:{}}):(g=b.kindName,g=typeof g===i?g():g),f+=j(g)+"'>",g=b.allowFormatting,g=c["if"].call(b,g,{hash:{},inverse:l.program(5,o,e),fn:l.program(3,n,e)});if(g||g===0)f+=g;return f+="</span><br/>",f})})();/* (function(){var a=Handlebars.template,b=Handlebars.templates=Handlebars.templates||{};b.default_control=a(function(a,b,c,d,e){c=c||a.helpers;var f="",g,h,i="function",j=this.escapeExpression;return f+="<strong>",h=c.title,h?g=h.call(b,{hash:{}}):(g=b.title,g=typeof g===i?g():g),f+=j(g)+"</strong>",f}),b.sound=a(function(a,b,c,d,e){function j(a,b){var d="",e,f;return d+='\n<audio autoplay src="',f=c.file,f?e=f.call(a,{hash:{}}):(e=a.file,e=typeof e===g?e():e),d+=h(e)+'">\n <embed src="',f=c.file,f?e=f.call(a,{hash:{}}):(e=a.file,e=typeof e===g?e():e),d+=h(e)+'" hidden="true" autostart="true" loop="false" />\n</audio>\n',d}c=c||a.helpers;var f,g="function",h=this.escapeExpression,i=this;return f=b.file,f=c["if"].call(b,f,{hash:{},inverse:i.noop,fn:i.program(1,j,e)}),f||f===0?f:""}),b.message=a(function(a,b,c,d,e){function m(a,b){var d="",e,f;return d+="<span class='n",f=c.kindName,f?e=f.call(a,{hash:{}}):(e=a.kindName,e=typeof e===i?e():e),d+=j(e)+"'>",f=c.name,f?e=f.call(a,{hash:{}}):(e=a.name,e=typeof e===i?e():e),d+=j(e)+"</span>: ",d}function n(a,b){var d,e;return d=a.message,e=c.apply,d=e?e.call(a,d,"urlReplace, nl2br, allowTags",{hash:{}}):k.call(a,"apply",d,"urlReplace, nl2br, allowTags",{hash:{}}),j(d)}function o(a,b){var d,e;return d=a.message,e=c.apply,d=e?e.call(a,d,"urlReplace, nl2br",{hash:{}}):k.call(a,"apply",d,"urlReplace, nl2br",{hash:{}}),j(d)}c=c||a.helpers;var f="",g,h,i="function",j=this.escapeExpression,k=c.helperMissing,l=this;f+="<span>",g=b.created,h=c.formatTime,g=h?h.call(b,g,{hash:{}}):k.call(b,"formatTime",g,{hash:{}}),f+=j(g)+"</span>\n",g=b.name,g=c["if"].call(b,g,{hash:{},inverse:l.noop,fn:l.program(1,m,e)});if(g||g===0)f+=g;f+="\n<span class='m",h=c.kindName,h?g=h.call(b,{hash:{}}):(g=b.kindName,g=typeof g===i?g():g),f+=j(g)+"'>",g=b.allowFormatting,g=c["if"].call(b,g,{hash:{},inverse:l.program(5,o,e),fn:l.program(3,n,e)});if(g||g===0)f+=g;return f+="</span><br/>",f})})();/*
This file is part of Mibew Messenger project. This file is part of Mibew Messenger project.
http://mibew.org http://mibew.org

View File

@ -1,4 +1,4 @@
;/* /*
This file is part of Mibew Messenger project. This file is part of Mibew Messenger project.
http://mibew.org http://mibew.org
Copyright (c) 2005-2011 Mibew Messenger Community Copyright (c) 2005-2011 Mibew Messenger Community

File diff suppressed because one or more lines are too long

View File

@ -1 +1,7 @@
(function(){var a=Handlebars.template,b=Handlebars.templates=Handlebars.templates||{};b.default_control=a(function(a,b,c,d,e){c=c||a.helpers;var f="",g,h,i="function",j=this.escapeExpression;return f+="<strong>",h=c.title,h?g=h.call(b,{hash:{}}):(g=b.title,g=typeof g===i?g():g),f+=j(g)+"</strong>",f}),b.sound=a(function(a,b,c,d,e){function j(a,b){var d="",e,f;return d+='\n<audio autoplay src="',f=c.file,f?e=f.call(a,{hash:{}}):(e=a.file,e=typeof e===g?e():e),d+=h(e)+'">\n <embed src="',f=c.file,f?e=f.call(a,{hash:{}}):(e=a.file,e=typeof e===g?e():e),d+=h(e)+'" hidden="true" autostart="true" loop="false" />\n</audio>\n',d}c=c||a.helpers;var f,g="function",h=this.escapeExpression,i=this;return f=b.file,f=c["if"].call(b,f,{hash:{},inverse:i.noop,fn:i.program(1,j,e)}),f||f===0?f:""}),b.message=a(function(a,b,c,d,e){function m(a,b){var d="",e,f;return d+="<span class='n",f=c.kindName,f?e=f.call(a,{hash:{}}):(e=a.kindName,e=typeof e===i?e():e),d+=j(e)+"'>",f=c.name,f?e=f.call(a,{hash:{}}):(e=a.name,e=typeof e===i?e():e),d+=j(e)+"</span>: ",d}function n(a,b){var d,e;return d=a.message,e=c.apply,d=e?e.call(a,d,"urlReplace, nl2br, allowTags",{hash:{}}):k.call(a,"apply",d,"urlReplace, nl2br, allowTags",{hash:{}}),j(d)}function o(a,b){var d,e;return d=a.message,e=c.apply,d=e?e.call(a,d,"urlReplace, nl2br",{hash:{}}):k.call(a,"apply",d,"urlReplace, nl2br",{hash:{}}),j(d)}c=c||a.helpers;var f="",g,h,i="function",j=this.escapeExpression,k=c.helperMissing,l=this;f+="<span>",g=b.created,h=c.formatTime,g=h?h.call(b,g,{hash:{}}):k.call(b,"formatTime",g,{hash:{}}),f+=j(g)+"</span>\n",g=b.name,g=c["if"].call(b,g,{hash:{},inverse:l.noop,fn:l.program(1,m,e)});if(g||g===0)f+=g;f+="\n<span class='m",h=c.kindName,h?g=h.call(b,{hash:{}}):(g=b.kindName,g=typeof g===i?g():g),f+=j(g)+"'>",g=b.allowFormatting,g=c["if"].call(b,g,{hash:{},inverse:l.program(5,o,e),fn:l.program(3,n,e)});if(g||g===0)f+=g;return f+="</span><br/>",f})})() /*
This file is part of Mibew Messenger project.
http://mibew.org
Copyright (c) 2005-2011 Mibew Messenger Community
License: http://mibew.org/license.php
*/
(function(){var a=Handlebars.template,b=Handlebars.templates=Handlebars.templates||{};b.default_control=a(function(a,b,c,d,e){c=c||a.helpers;var f="",g,h,i="function",j=this.escapeExpression;return f+="<strong>",h=c.title,h?g=h.call(b,{hash:{}}):(g=b.title,g=typeof g===i?g():g),f+=j(g)+"</strong>",f}),b.sound=a(function(a,b,c,d,e){function j(a,b){var d="",e,f;return d+='\n<audio autoplay src="',f=c.file,f?e=f.call(a,{hash:{}}):(e=a.file,e=typeof e===g?e():e),d+=h(e)+'">\n <embed src="',f=c.file,f?e=f.call(a,{hash:{}}):(e=a.file,e=typeof e===g?e():e),d+=h(e)+'" hidden="true" autostart="true" loop="false" />\n</audio>\n',d}c=c||a.helpers;var f,g="function",h=this.escapeExpression,i=this;return f=b.file,f=c["if"].call(b,f,{hash:{},inverse:i.noop,fn:i.program(1,j,e)}),f||f===0?f:""}),b.message=a(function(a,b,c,d,e){function m(a,b){var d="",e,f;return d+="<span class='n",f=c.kindName,f?e=f.call(a,{hash:{}}):(e=a.kindName,e=typeof e===i?e():e),d+=j(e)+"'>",f=c.name,f?e=f.call(a,{hash:{}}):(e=a.name,e=typeof e===i?e():e),d+=j(e)+"</span>: ",d}function n(a,b){var d,e;return d=a.message,e=c.apply,d=e?e.call(a,d,"urlReplace, nl2br, allowTags",{hash:{}}):k.call(a,"apply",d,"urlReplace, nl2br, allowTags",{hash:{}}),j(d)}function o(a,b){var d,e;return d=a.message,e=c.apply,d=e?e.call(a,d,"urlReplace, nl2br",{hash:{}}):k.call(a,"apply",d,"urlReplace, nl2br",{hash:{}}),j(d)}c=c||a.helpers;var f="",g,h,i="function",j=this.escapeExpression,k=c.helperMissing,l=this;f+="<span>",g=b.created,h=c.formatTime,g=h?h.call(b,g,{hash:{}}):k.call(b,"formatTime",g,{hash:{}}),f+=j(g)+"</span>\n",g=b.name,g=c["if"].call(b,g,{hash:{},inverse:l.noop,fn:l.program(1,m,e)});if(g||g===0)f+=g;f+="\n<span class='m",h=c.kindName,h?g=h.call(b,{hash:{}}):(g=b.kindName,g=typeof g===i?g():g),f+=j(g)+"'>",g=b.allowFormatting,g=c["if"].call(b,g,{hash:{},inverse:l.program(5,o,e),fn:l.program(3,n,e)});if(g||g===0)f+=g;return f+="</span><br/>",f})})();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long