eclipse/plugins: support multiple plugins JARs

This commit is contained in:
Robert Helgesson 2018-01-18 20:07:47 +01:00
parent 0cca54688f
commit 3a70f21738
No known key found for this signature in database
GPG Key ID: C3DB11069E65DC86

View File

@ -20,20 +20,32 @@ rec {
# Helper for the common case where we have separate feature and # Helper for the common case where we have separate feature and
# plugin JARs. # plugin JARs.
buildEclipsePlugin = { name, srcFeature, srcPlugin, ... } @ attrs: buildEclipsePlugin =
buildEclipsePluginBase (attrs // { { name, srcFeature, srcPlugin ? null, srcPlugins ? [], ... } @ attrs:
srcs = [ srcFeature srcPlugin ]; assert srcPlugin == null -> srcPlugins != [];
assert srcPlugin != null -> srcPlugins == [];
buildCommand = '' let
dropinDir="$out/eclipse/dropins/${name}"
mkdir -p $dropinDir/features pSrcs = if (srcPlugin != null) then [ srcPlugin ] else srcPlugins;
unzip ${srcFeature} -d $dropinDir/features/
mkdir -p $dropinDir/plugins in
cp -v ${srcPlugin} $dropinDir/plugins/${name}.jar
''; buildEclipsePluginBase (attrs // {
}); srcs = [ srcFeature ] ++ pSrcs;
buildCommand = ''
dropinDir="$out/eclipse/dropins/${name}"
mkdir -p $dropinDir/features
unzip ${srcFeature} -d $dropinDir/features/
mkdir -p $dropinDir/plugins
for plugin in ${toString pSrcs}; do
cp -v $plugin $dropinDir/plugins/$(stripHash $plugin)
done
'';
});
# Helper for the case where the build directory has the layout of an # Helper for the case where the build directory has the layout of an
# Eclipse update site, that is, it contains the directories # Eclipse update site, that is, it contains the directories