tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
eclipse/plugins: support multiple plugins JARs
Robert Helgesson
8 years ago
3a70f217
0cca5468
+23
-11
1 changed file
expand all
collapse all
unified
split
pkgs
applications
editors
eclipse
plugins.nix
+23
-11
pkgs/applications/editors/eclipse/plugins.nix
···
20
20
21
21
# Helper for the common case where we have separate feature and
22
22
# plugin JARs.
23
23
-
buildEclipsePlugin = { name, srcFeature, srcPlugin, ... } @ attrs:
24
24
-
buildEclipsePluginBase (attrs // {
25
25
-
srcs = [ srcFeature srcPlugin ];
23
23
+
buildEclipsePlugin =
24
24
+
{ name, srcFeature, srcPlugin ? null, srcPlugins ? [], ... } @ attrs:
25
25
+
assert srcPlugin == null -> srcPlugins != [];
26
26
+
assert srcPlugin != null -> srcPlugins == [];
26
27
27
27
-
buildCommand = ''
28
28
-
dropinDir="$out/eclipse/dropins/${name}"
28
28
+
let
29
29
30
30
-
mkdir -p $dropinDir/features
31
31
-
unzip ${srcFeature} -d $dropinDir/features/
30
30
+
pSrcs = if (srcPlugin != null) then [ srcPlugin ] else srcPlugins;
32
31
33
33
-
mkdir -p $dropinDir/plugins
34
34
-
cp -v ${srcPlugin} $dropinDir/plugins/${name}.jar
35
35
-
'';
36
36
-
});
32
32
+
in
33
33
+
34
34
+
buildEclipsePluginBase (attrs // {
35
35
+
srcs = [ srcFeature ] ++ pSrcs;
36
36
+
37
37
+
buildCommand = ''
38
38
+
dropinDir="$out/eclipse/dropins/${name}"
39
39
+
40
40
+
mkdir -p $dropinDir/features
41
41
+
unzip ${srcFeature} -d $dropinDir/features/
42
42
+
43
43
+
mkdir -p $dropinDir/plugins
44
44
+
for plugin in ${toString pSrcs}; do
45
45
+
cp -v $plugin $dropinDir/plugins/$(stripHash $plugin)
46
46
+
done
47
47
+
'';
48
48
+
});
37
49
38
50
# Helper for the case where the build directory has the layout of an
39
51
# Eclipse update site, that is, it contains the directories