Skip to content
This repository has been archived by the owner on Jan 1, 2021. It is now read-only.

Commit

Permalink
Iterate over the locales rather than having to hardcode them. Thanks …
Browse files Browse the repository at this point in the history
…to Hiroshi Miura!
  • Loading branch information
gravitystorm committed Nov 26, 2011
1 parent 08c2015 commit cd73dd2
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 15 deletions.
2 changes: 1 addition & 1 deletion build.properties.template
Expand Up @@ -19,4 +19,4 @@ test.src.dir = ${basedir}/tests/src
test.fakeroot.dir = ${basedir}/tests/fakeroot
test.bin.dir = ${basedir}/tests/bin
report.dir = ${basedir}/tests/report
report.html.dir = ${basedir}/tests/report/html
report.html.dir = ${basedir}/tests/report/html
54 changes: 40 additions & 14 deletions build.xml
@@ -1,4 +1,4 @@
<project name="Potlatch 2" default="debug">
<project name="Potlatch 2" default="debug" xmlns:ac="antlib:net.sf.antcontrib">

<!-- load properties from the environment -->
<property environment="env" />
Expand All @@ -9,6 +9,9 @@
<!-- flexTasks comes with flex, but apparently it's good practice to put in the libs folder -->
<taskdef resource="flexTasks.tasks" classpath="${basedir}/lib/flexTasks.jar"/>

<!-- ant-contrib to build multiple locales -->
<taskdef uri="antlib:net.sf.antcontrib" resource="net/sf/antcontrib/antlib.xml" classpath="${basedir}/lib/ant-contrib-1.0b3.jar"/>

<!-- if you are running git-svn, you need to run "git tag -a 0.4 0ac0de" where 0ac0de corresponds to the commitid of
potlatch2 v0.4 . You need to do this for each point release while we're still in SVN.
If you don't, then expect "git describe" to fail miserably.
Expand Down Expand Up @@ -58,7 +61,7 @@
</target>

<!-- note that there's an asdoc target in Flex 4, if/when we move to that -->
<target name="docs" depends="manifests">
<target name="docs" depends="manifests,makeLocalesList">
<exec executable="${ASDOC}" failonerror="true">
<arg line="-source-path ."/>
<arg line="-doc-sources net/systemeD/"/>
Expand Down Expand Up @@ -89,6 +92,8 @@
<arg line="-package net.systemeD.potlatch2.utils 'Data loading utilities'" />

<arg line="-left-frameset-width 300" />
<arg line="-locale=${locales.list}" />
<arg line="-allow-source-path-overlap true" />
</exec>
</target>

Expand Down Expand Up @@ -257,23 +262,44 @@
</sequential>
</macrodef>

<target name="buildLocales">
<echo>Building Localization .swf's</echo>
<compileLocale locale="en_US" />
<compileLocale locale="en_GB" />
<compileLocale locale="fr_FR" />
<compileLocale locale="de_DE" />
<compileLocale locale="pl_PL" />
<target name="makeLocalesList">
<ac:for param="dirname">
<path>
<dirset dir="${basedir}/l10n/locale/">
<exclude name="bundles"/>
<include name="??_??"/>
</dirset>
</path>
<sequential>
<ac:var name="localename" unset="true"/>
<basename property="localename" file="@{dirname}" />
<script language="javascript"><![CDATA[
if ((l = project.getProperty("locales.list")) != null) {
project.setUserProperty("locales.list", l+ "," +project.getProperty("localename"));
} else {
project.setUserProperty("locales.list", project.getProperty("localename"));
}
]]></script>
</sequential>
</ac:for>
</target>

<target name="buildLocales" depends="makeLocalesList">
<echo>Building Localization .swf's</echo>
<ac:for list="${locales.list}" keepgoing="true" param="localename">
<sequential>
<compileLocale locale="@{localename}" />
</sequential>
</ac:for>
</target>

<target name="deployLocales" depends="buildLocales">
<echo>Deploying the compiled swf and assets package for the given locales</echo>
<deployLocale locale="en_US" />
<deployLocale locale="en_GB" />
<deployLocale locale="fr_FR" />
<deployLocale locale="de_DE" />
<deployLocale locale="pl_PL" />
<ac:for list="${locales.list}" keepgoing="true" param="localename">
<sequential>
<deployLocale locale="@{localename}" />
</sequential>
</ac:for>
</target>


Expand Down
Binary file added lib/ant-contrib-1.0b3.jar
Binary file not shown.

0 comments on commit cd73dd2

Please sign in to comment.