From 1e2b6813fb92a346ab2331bec70dd0c164f78781 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillermo=20P=C3=A9rez?= Date: Tue, 22 May 2012 16:58:28 +0200 Subject: [PATCH 1/4] Move language template file to a property If you want to use a different i18n loader than Y.Intl.add you need to be able to override the template used to load the translation files. --- componentbuild/shared/macrolib.xml | 2 +- componentbuild/shared/properties.xml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/componentbuild/shared/macrolib.xml b/componentbuild/shared/macrolib.xml index 65870d4..7d2fbe4 100644 --- a/componentbuild/shared/macrolib.xml +++ b/componentbuild/shared/macrolib.xml @@ -289,7 +289,7 @@ - + diff --git a/componentbuild/shared/properties.xml b/componentbuild/shared/properties.xml index d678a21..1f0793c 100644 --- a/componentbuild/shared/properties.xml +++ b/componentbuild/shared/properties.xml @@ -106,6 +106,9 @@ + + + From 81291a289980acb9b3b40fd51b712e0d2673e3f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillermo=20P=C3=A9rez?= Date: Tue, 22 May 2012 17:22:16 +0200 Subject: [PATCH 2/4] Add support for compiling handlebars templates into a js file Detect if templates/ (configurable) directory exists and compile the templates there into a js file (by default compiled-templates.js). This makes all the templates of the module directly available when loading the module. --- componentbuild/shared/macrolib.xml | 13 +++++++++++ componentbuild/shared/properties.xml | 5 +++++ componentbuild/shared/targets.xml | 33 +++++++++++++++++++++++++++- 3 files changed, 50 insertions(+), 1 deletion(-) diff --git a/componentbuild/shared/macrolib.xml b/componentbuild/shared/macrolib.xml index 7d2fbe4..d9fc39d 100644 --- a/componentbuild/shared/macrolib.xml +++ b/componentbuild/shared/macrolib.xml @@ -1,6 +1,19 @@ + + + + + + + + + + + + + diff --git a/componentbuild/shared/properties.xml b/componentbuild/shared/properties.xml index 1f0793c..8ad10cb 100644 --- a/componentbuild/shared/properties.xml +++ b/componentbuild/shared/properties.xml @@ -28,6 +28,7 @@ + @@ -60,6 +61,10 @@ + + + + diff --git a/componentbuild/shared/targets.xml b/componentbuild/shared/targets.xml index fc0f03a..e8ef6e0 100644 --- a/componentbuild/shared/targets.xml +++ b/componentbuild/shared/targets.xml @@ -34,6 +34,37 @@ + + + + + + Precompiling templates for ${component} + + + + +Compiled templates not included in jsfiles! + +ERROR: +The component ${component} uses templates, but +'${compiled-templates.file}' is not listed in the +'component.jsfiles' entry of 'build.properties'. + +Please, add it to the file: +${component.basedir}/build.properties + + + + + + + ${component.jsfiles.base}/${compiled-templates.file} + + + + + @@ -75,7 +106,7 @@ - + From d929bf1a4bb9f19ef7d57530d9c4b661d0927af4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillermo=20P=C3=A9rez?= Date: Tue, 22 May 2012 17:32:59 +0200 Subject: [PATCH 3/4] Add build cache to avoid rebuilding components already uptodate Using ant uptodate we compare source files with a file generated during the build to detect if the components really needs rebuild. This decreases the build time significantly. --- componentbuild/shared/targets.xml | 65 +++++++++++++++++++++---------- 1 file changed, 44 insertions(+), 21 deletions(-) diff --git a/componentbuild/shared/targets.xml b/componentbuild/shared/targets.xml index e8ef6e0..c8a8a1f 100644 --- a/componentbuild/shared/targets.xml +++ b/componentbuild/shared/targets.xml @@ -2,30 +2,52 @@ - Starting Build For ${component} - - Ant Properties - Home : ${ant.home} - Ant Version : ${ant.version} - Build File : ${ant.file} - Local Build Properties - version : ${yui.version} - srcdir : ${srcdir} - builddir : ${builddir} - component : ${component} - component.basefilename : ${component.basefilename} - component.basedir : ${component.basedir} - component.builddir : ${component.builddir} - Global Build Properties - global.build.base : ${global.build.base} - global.build.component : ${global.build.component} - global.build.component.assets : ${global.build.component.assets} - + + + + + + + + + + + + + + + ${component} build is uptodate, skipping... + + + + + + + + + + + Starting Build For ${component} - - + Ant Properties + Home : ${ant.home} + Ant Version : ${ant.version} + Build File : ${ant.file} + Local Build Properties + version : ${yui.version} + srcdir : ${srcdir} + builddir : ${builddir} + component : ${component} + component.basefilename : ${component.basefilename} + component.basedir : ${component.basedir} + component.builddir : ${component.builddir} + Global Build Properties + global.build.base : ${global.build.base} + global.build.component : ${global.build.component} + global.build.component.assets : ${global.build.component.assets} + @@ -104,6 +126,7 @@ ${component.basedir}/build.properties + From bf900a2c863faeff819e795ca774323c9cb17d3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillermo=20P=C3=A9rez?= Date: Tue, 22 May 2012 17:35:38 +0200 Subject: [PATCH 4/4] Add flag to skip minify (minify.skip) During development, sometimes is handy to avoid the minification of the components to save build time, or if the minification is done as part of another build system atop yui's Ant. --- componentbuild/shared/targets.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/componentbuild/shared/targets.xml b/componentbuild/shared/targets.xml index c8a8a1f..e5ae81f 100644 --- a/componentbuild/shared/targets.xml +++ b/componentbuild/shared/targets.xml @@ -132,7 +132,7 @@ ${component.basedir}/build.properties - +