Hello,
Frederik Ramm <[email protected]>
writes:
> I propose to split up the build process so that it builds a special
> version for each language. In addition, we can keep building the
> all-languages version for those in a true multilingual environment (or
> those on a fat pipe who would rather not be bothered). That would be the
> easiest way to tackle the problem. I'm not an ant guru but I think even
> I could do that.
You mean something like the attached patch? This version would need
an <antcall> for each supported language (in the patch are "en" and
"de" added).
$ LANG=C du -h dist/*
2.7M dist/josm-custom-de.jar
2.7M dist/josm-custom-en.jar
5.4M dist/josm-custom.jar
Greetings
Sebastian Waschik
PS: I do not know why property="translationselect" instead of direct
usage of property="translation" is needed in <include> but that does
not matter.
Index: build.xml
===================================================================
--- build.xml (revision 1800)
+++ build.xml (working copy)
@@ -29,10 +29,26 @@
<!-- styles -->
<copy file="styles/standard/elemstyles.xml" todir="build/styles/standard"/>
+ <antcall target="create-jar" />
+ <antcall target="create-jar">
+ <param name="translation" value="de" />
+ </antcall>
+ <antcall target="create-jar">
+ <param name="translation" value="en" />
+ </antcall>
+ </target>
+ <target name="create-jar">
<!-- create josm-custom.jar -->
- <delete file="dist/josm-custom.jar"/>
- <jar destfile="dist/josm-custom.jar" basedir="build">
+ <condition property="translationsuffix" value="-${translation}" else="">
+ <isset property="translation" />
+ </condition>
+ <condition property="translationselect" value="${translation}" else="">
+ <isset property="translation" />
+ </condition>
+ <property name="dist-file-name" value="dist/josm-custom${translationsuffix}.jar" />
+ <delete file="${dist-file-name} "/>
+ <jar destfile="${dist-file-name}" basedir="build">
<manifest>
<attribute name="Main-class" value="JOSM" />
<attribute name="Main-Version" value="${version.entry.commit.revision} SVN"/>
@@ -40,7 +56,12 @@
</manifest>
<zipfileset dir="presets" prefix="presets" />
<zipfileset dir="images" prefix="images" />
- <zipfileset src="lib/josm-translation.jar" />
+ <zipfileset src="lib/josm-translation.jar">
+ <patternset>
+ <include name="**/*.properties" />
+ <include name="**/Translation_${translationselect}*.class" />
+ </patternset>
+ </zipfileset>
<!-- All jar files necessary to run only JOSM (no tests) -->
<zipfileset src="lib/gettext-commons-0.9.6.jar" />
_______________________________________________
josm-dev mailing list
[email protected]
http://lists.openstreetmap.org/listinfo/josm-dev