Author: sflanigan
Date: 2008-11-20 22:30:58 -0500 (Thu, 20 Nov 2008)
New Revision: 11938
Removed:
trunk/i18n/plugin-template.mf
Modified:
trunk/i18n/build.xml
Log:
Refactored plugin generation to use one pass; inlined manifest to be part of the jar task;
removed generation of zip files.
Modified: trunk/i18n/build.xml
===================================================================
--- trunk/i18n/build.xml 2008-11-21 02:11:55 UTC (rev 11937)
+++ trunk/i18n/build.xml 2008-11-21 03:30:58 UTC (rev 11938)
@@ -81,6 +81,10 @@
<echo message="| |__ ${echo.dependency.classpath}" />
</target>
+ <target name="cleanpot" description="Remove all pot files">
+ <delete dir="po" includes="**/*.pot" />
+ </target>
+
<target name="clean" description="Remove generated files">
<!-- obsolete dirs -->
<delete dir="target/pot" />
@@ -98,48 +102,37 @@
<target name="prop2pot" depends="init"
description="Extract translation templates (POT) from the JBoss Tools English
properties files">
- <for param="moduledir" >
- <path>
- <dirset dir="${jbt.srcdir}" includes="*"
excludes="i18n,.*" />
- </path>
- <sequential>
- <!-- FIXME create BundleNameMapper -->
- <propertyregex override="true" property="module"
- input="@{moduledir}"
- regexp="^${jbt.srcdir}${file.separator}([^/\\]+).*"
- select="\1" />
- <checkprop propname="module"/>
- <echo message="module=${module}" />
-
- <!-- paths under jbt.srcdir look like: ${module}/plugins/${plugin}/{src,main,...}
-->
- <!-- FIXME includes should be just plugins/*/src/**/*.properties.
- See
https://jira.jboss.org/jira/browse/JBIDE-2972
includes="plugins/*/*/**/*.properties" -->
- <prop2pot srcDir="@{moduledir}" dstDir="po/${module}"
includes="plugins/*/src/**/*.properties" >
- <!-- next two are Maven style, not currently used in JBT: -->
+ <!-- paths under jbt.srcdir look like: ${module}/plugins/${plugin}/{src,main,...}
-->
+ <!-- TODO includes should be just plugins/*/src/**/*.properties.
+ See
https://jira.jboss.org/jira/browse/JBIDE-2972
includes="plugins/*/*/**/*.properties" -->
+ <prop2pot srcDir="${jbt.srcdir}" dstDir="po"
includes="*/plugins/*/src/**/*.properties" >
+ <!-- next two are Maven style, not currently used in JBT: -->
<!--
- <fileset erroronmissingdir="false"
dir="${plugindir}/src/main/java"/>
- <fileset erroronmissingdir="false"
dir="${plugindir}/src/main/resources"/>
-
- <fileset erroronmissingdir="false"
dir="${plugindir}/src/main" excludes="java,resources"/>
- <fileset erroronmissingdir="false" dir="${plugindir}/src"
excludes="main"/>
- <fileset erroronmissingdir="false"
dir="${plugindir}/jbosscore"/>
- <fileset erroronmissingdir="false"
dir="${plugindir}/jbossui"/>
- <fileset erroronmissingdir="false"
dir="${plugindir}/resources"/>
- <fileset erroronmissingdir="false"
dir="${plugindir}/template-src"/>
- //<fileset dir="${plugindir}/templates"/>
+ <fileset erroronmissingdir="false"
dir="${plugindir}/src/main/java"/>
+ <fileset erroronmissingdir="false"
dir="${plugindir}/src/main/resources"/>
+
+ <fileset erroronmissingdir="false" dir="${plugindir}/src/main"
excludes="java,resources"/>
+ <fileset erroronmissingdir="false" dir="${plugindir}/src"
excludes="main"/>
+ <fileset erroronmissingdir="false"
dir="${plugindir}/jbosscore"/>
+ <fileset erroronmissingdir="false"
dir="${plugindir}/jbossui"/>
+ <fileset erroronmissingdir="false"
dir="${plugindir}/resources"/>
+ <fileset erroronmissingdir="false"
dir="${plugindir}/template-src"/>
+ //<fileset dir="${plugindir}/templates"/>
-->
- <!-- rename to pluginID-org.jboss.ide.*/org.jboss.ide.*.pot -->
- <chainedmapper>
- <regexpmapper handledirsep="true"
from="^plugins/([^/]+)/[^/]+/(.*)[.]properties$$" to="\1-\2~\2.pot"
/>
- <filtermapper>
- <!-- org/jboss/ide/* -> org.jboss.ide.* -->
- <replacestring from="${file.separator}" to="."/>
- <replacestring from="~" to="/"/>
- </filtermapper>
- </chainedmapper>
- </prop2pot>
- </sequential>
- </for>
+ <chainedmapper>
+ <!-- rename to module~pluginID-org.jboss.ide.*~org.jboss.ide.*.pot -->
+ <regexpmapper
+ handledirsep="true"
+ from="^([^/]+)/plugins/([^/]+)/[^/]+/(.*)[.]properties$$"
+ to="\1~\2-\3~\3.pot" />
+ <filtermapper>
+ <!-- org/jboss/ide/* -> org.jboss.ide.* -->
+ <replacestring from="${file.separator}" to="."/>
+ <!-- rename to module/pluginID-org.jboss.ide.*/org.jboss.ide.*.pot -->
+ <replacestring from="~" to="/"/>
+ </filtermapper>
+ </chainedmapper>
+ </prop2pot>
</target>
<!-- autogenerated "translations" -->
@@ -182,79 +175,36 @@
</if>
</sequential>
</macrodef>
-
- <!-- = = = = = = = = = = = = = = = = =
- macrodef: processlocaleplugins
- = = = = = = = = = = = = = = = = = -->
- <macrodef name="processlocaleplugins">
- <attribute name="rootdir" />
- <attribute name="task" />
- <sequential>
- <for param="plugindir">
- <path>
- <dirset dir="@{rootdir}" includes="*/*" />
- </path>
- <sequential>
- <!-- FIXME -->
- <propertyregex override="true" property="plugin"
- input="@{plugindir}"
- regexp="^(a){rootdir}[/\\][^/\\]+[/\\]([^/\\]+).*"
- select="\1" />
- <checkprop propname="plugin"/>
- <echo level="verbose" message="@{plugindir} contains props for
plugin ${plugin}"/>
- <antcall target="@{task}">
- <param name="plugin" value="${plugin}"/>
- <param name="plugindir" value="@{plugindir}"/>
- </antcall>
- </sequential>
- </for>
- </sequential>
- </macrodef>
-
+
<!-- Processes the generated props directory, one plugin at a time,
- generating manifests -->
- <target name="manifests" depends="init"
description="Generate fragment plugin manifests for langpack plugins">
+ generating manifests and jars -->
+ <target name="plugins" depends="init" description="Generate
fragment manifests and jars for langpack plugins">
<delete dir="target/manifests" />
- <processlocaleplugins rootdir="${propdir}" task="-manifest"
/>
- </target>
-
-
- <!-- Generates the manifests (one per locale) for one plugin. Called by
processlocaleplugins. -->
- <target name="-manifest">
- <!-- NB don't depend on initTaskDefs here, or ant loads the
- classes over and over until it exhausts memory -->
- <checkprop propname="plugindir"/>
- <checkprop propname="plugin"/>
- <checkprop propname="PLUGIN_VERSION"/>
- <checkprop propname="PLUGIN_VENDOR"/>
- <for param="locale" list="${locales}">
+ <delete dir="${jardir}/plugins" />
+ <mkdir dir="${jardir}/plugins" />
+ <for param="plugindir">
+ <path>
+ <dirset dir="${propdir}" includes="*/*" />
+ </path>
<sequential>
+ <echo message="@{plugindir}" />
<!-- FIXME -->
- <var name="locale" value="@{locale}" />
- <propertycopy override="true" property="localename"
from="NAME_${locale}"/>
- <checkprop propname="localename"/>
- <copy overwrite="true" file="plugin-template.mf"
tofile="target/manifests/${plugin}/${locale}">
- <filterchain>
- <expandproperties/>
- </filterchain>
- </copy>
-<!-- for debug output:
- <concat><filelist
files="target/manifests/${plugin}/${locale}"></filelist></concat>
--->
+ <propertyregex override="true" property="plugin"
+ input="@{plugindir}"
+ regexp="^${propdir}[/\\][^/\\]+[/\\]([^/\\]+).*"
+ select="\1" />
+ <checkprop propname="plugin"/>
+ <echo level="verbose" message="@{plugindir} contains props for
plugin ${plugin}"/>
+ <antcall target="-jar">
+ <param name="plugin" value="${plugin}"/>
+ <param name="plugindir" value="@{plugindir}"/>
+ </antcall>
</sequential>
</for>
</target>
- <!-- Processes the generated props directory, one plugin at a time,
- generating plugin jars from the props and manifest -->
- <target name="fragments" depends="init"
description="Generate fragment plugin jars to contain translations" >
- <delete dir="${jardir}" />
- <mkdir dir="${jardir}/plugins" />
- <processlocaleplugins rootdir="${propdir}" task="-fragment"
/>
- </target>
-
- <!-- Jars up one fragment plugin. Called by processlocaleplugins. -->
- <target name="-fragment">
+ <!-- Jars up one fragment plugin. -->
+ <target name="-jar">
<!-- NB don't depend on initTaskDefs here, or ant loads the
classes over and over until it exhausts memory -->
<checkprop propname="plugindir"/>
@@ -265,7 +215,6 @@
<for param="locale" list="${locales}">
<sequential>
<!-- FIXME -->
- <var name="__locale" value="@{locale}" />
<propertycopy override="true" property="localename"
from="NAME_@{locale}"/>
<checkprop propname="localename"/>
@@ -277,8 +226,16 @@
update="no"
basedir="${plugindir}"
duplicate="fail"
- includes="**/*_(a){locale}.properties"
- manifest="target/manifests/${plugin}/@{locale}">
+ includes="**/*_(a){locale}.properties">
+ <manifest>
+ <attribute name="Manifest-Version" value="1.0"/>
+ <attribute name="Created-By" value="JBoss Tools i18n
build.xml"/>
+ <attribute name="Bundle-Name" value="${plugin} ${localename} NLS
Support"/>
+ <attribute name="Bundle-SymbolicName"
value="${plugin}.nl_@{locale} ;singleton=true"/>
+ <attribute name="Bundle-Version"
value="${PLUGIN_VERSION}"/>
+ <attribute name="Bundle-Vendor"
value="${PLUGIN_VENDOR}"/>
+ <attribute name="Fragment-Host"
value="${plugin};bundle-version="[0.0.0,9.9.9)""/>
+ </manifest>
</jar>
</sequential>
</for>
@@ -301,11 +258,6 @@
</path>
<sequential>
<!-- FIXME -->
- <propertyregex override="true" property="module"
- input="@{featurexml}"
- regexp="^${jbt.srcdir}${file.separator}([^/\\]+).*"
- select="\1" />
- <checkprop propname="module"/>
<propertyregex override="true" property="feature"
input="@{featurexml}"
regexp="^${jbt.srcdir}${file.separator}[^/\\]+${file.separator}features${file.separator}([^/\\]+)${file.separator}feature.xml"
@@ -314,7 +266,7 @@
<!-- FIXME -->
<var name="featurename" value="${feature}" />
<var name="jarsize" value="0" />
- <echo level="verbose" message="Processing feature ${feature} in
module ${module}"/>
+ <echo level="verbose" message="Processing feature
${feature}"/>
<for param="locale" list="${locales}">
<sequential>
<!-- FIXME -->
@@ -445,27 +397,10 @@
</exec>
</target>
- <target name="zips" depends="init" description="Generate zip
files containing langpacks, one zip per locale">
- <delete dir="${zipdir}" />
- <mkdir dir="${zipdir}" />
- <for param="locale" list="${locales}">
- <sequential>
- <zip
- destfile="${zipdir}/jbosstools-nls-(a){locale}_${LANGPACK_VERSION}.zip"
- compress="false"
- whenempty="fail"
- basedir="${jardir}" >
- <include name="plugins/*.nl-(a){locale}_${PLUGIN_VERSION}.jar" />
- <include name="features/*.nl-(a){locale}_${PLUGIN_VERSION}.jar/" />
- </zip>
- </sequential>
- </for>
- </target>
-
- <target name="most" depends="clean, prop2pot, en, qps, en_AA, po2prop,
manifests, fragments, features"
+ <target name="most" depends="clean, prop2pot, en, qps, en_AA, po2prop,
plugins, features"
description="Generates langpacks and metadata" />
- <target name="all" depends="clean, prop2pot, en, qps, en_AA, po2prop,
manifests, fragments, features, p2, zips"
+ <target name="all" depends="clean, prop2pot, en, qps, en_AA, po2prop,
plugins, features, p2"
description="Runs all targets in an appropriate order"/>
Deleted: trunk/i18n/plugin-template.mf
===================================================================
--- trunk/i18n/plugin-template.mf 2008-11-21 02:11:55 UTC (rev 11937)
+++ trunk/i18n/plugin-template.mf 2008-11-21 03:30:58 UTC (rev 11938)
@@ -1,7 +0,0 @@
-Manifest-Version: 1.0
-Created-By: JBoss Tools localization build.xml
-Bundle-Name: ${plugin} ${localename} NLS Support
-Bundle-SymbolicName: ${plugin}.nl_${locale} ;singleton=true
-Bundle-Version: ${PLUGIN_VERSION}
-Bundle-Vendor: ${PLUGIN_VENDOR}
-Fragment-Host: ${plugin};bundle-version="[0.0.0,9.9.9)"