For flatpak generation, also pull in the node binaries
from the flathub platform extension to fully enable language server features

Change-Id: I381be9eab51af66c60317b1fffcfc0a67b45b2bf
Signed-off-by: Mat Booth <mat.booth@redhat.com>
diff --git a/maven-plugins/eclipse-flatpak-packager/src/main/java/org/eclipse/cbi/maven/plugins/flatpakager/CreateFlatpakMojo.java b/maven-plugins/eclipse-flatpak-packager/src/main/java/org/eclipse/cbi/maven/plugins/flatpakager/CreateFlatpakMojo.java
index 914092d..8b1bc52 100644
--- a/maven-plugins/eclipse-flatpak-packager/src/main/java/org/eclipse/cbi/maven/plugins/flatpakager/CreateFlatpakMojo.java
+++ b/maven-plugins/eclipse-flatpak-packager/src/main/java/org/eclipse/cbi/maven/plugins/flatpakager/CreateFlatpakMojo.java
@@ -547,22 +547,41 @@
 				.add(new AdditionalSource(appdataFile, new File("/app/share/metainfo", appdataFile.getName())));
 
 		// OpenJDK module
-		Module.Builder jdkModuleBuilder = Module.builder().name("openjdk").buildSystem("simple")
+		Module.Builder jdkModuleBuilder = Module.builder()
+				.name("openjdk")
+				.buildSystem("simple")
 				.addbuildCommand("/usr/lib/sdk/openjdk11/installjdk.sh");
 
+		// Node module
+		Module.Builder nodeModuleBuilder = Module.builder()
+				.name("node")
+				.buildSystem("simple")
+				.addbuildCommand("/usr/lib/sdk/node10/install.sh");
+
 		// Eclipse module
-		Module.Builder eclipseModuleBuilder = Module.builder().name("eclipse").buildSystem("simple")
-				.addbuildCommand("mv eclipse /app").addbuildCommand("mkdir -p /app/bin")
+		Module.Builder eclipseModuleBuilder = Module.builder()
+				.name("eclipse")
+				.buildSystem("simple")
+				.addbuildCommand("mv eclipse /app")
+				.addbuildCommand("mkdir -p /app/bin")
 				.addbuildCommand("ln -s /app/eclipse/" + command + " /app/bin");
-		Source sourceArchive = Source.builder().type("archive").path(source.getName()).stripComponents(0).build();
+		Source sourceArchive = Source.builder()
+				.type("archive")
+				.path(source.getName())
+				.stripComponents(0)
+				.build();
 		eclipseModuleBuilder.addSource(sourceArchive);
 		for (AdditionalSource addSource : additionalSources) {
 			getLog().debug("Additional Source: " + addSource.getSource() + " -> " + addSource.getDestination());
-			Source sourceFile = Source.builder().type("file").path(addSource.getSource().getName())
-					.destFilename(addSource.getSource().getName()).build();
+			Source sourceFile = Source.builder()
+					.type("file")
+					.path(addSource.getSource().getName())
+					.destFilename(addSource.getSource().getName())
+					.build();
 			eclipseModuleBuilder.addSource(sourceFile);
-			eclipseModuleBuilder.addbuildCommand("install -Dm " + addSource.getPermissions() + " "
-					+ addSource.getSource().getName() + " " + addSource.getDestination());
+			eclipseModuleBuilder
+					.addbuildCommand("install -Dm " + addSource.getPermissions() + " " + addSource.getSource()
+							.getName() + " " + addSource.getDestination());
 		}
 		// Install icons from the branding plug-in
 		if (brandingPlugin == null || brandingPlugin.isEmpty()) {
@@ -583,6 +602,7 @@
 				.runtime(runtime)
 				.runtimeVersion(runtimeVersion)
 				.addModule(jdkModuleBuilder.build())
+				.addModule(nodeModuleBuilder.build())
 				.addModule(eclipseModuleBuilder.build());
 		if (appendDefaultFinishArgs) {
 			manifestBuilder.addFinishArg("--require-version=" + minFlatpakVersion);
diff --git a/maven-plugins/eclipse-flatpak-packager/src/main/java/org/eclipse/cbi/maven/plugins/flatpakager/model/Manifest.java b/maven-plugins/eclipse-flatpak-packager/src/main/java/org/eclipse/cbi/maven/plugins/flatpakager/model/Manifest.java
index 4349527..91324f2 100644
--- a/maven-plugins/eclipse-flatpak-packager/src/main/java/org/eclipse/cbi/maven/plugins/flatpakager/model/Manifest.java
+++ b/maven-plugins/eclipse-flatpak-packager/src/main/java/org/eclipse/cbi/maven/plugins/flatpakager/model/Manifest.java
@@ -28,14 +28,14 @@
 	public static final String DEFAULT_FLATPAKVERSION = "1.0.2";
 
 	// Probably always want JDK
-	public static final List<String> DEFAULT_SDK_EXTENSIONS = Collections
-			.unmodifiableList(Arrays.asList("org.freedesktop.Sdk.Extension.openjdk11"));
+	public static final List<String> DEFAULT_SDK_EXTENSIONS = Collections.unmodifiableList(
+			Arrays.asList("org.freedesktop.Sdk.Extension.openjdk11", "org.freedesktop.Sdk.Extension.node10"));
 
 	// Fairly liberal by default: Access to host file system, windowing system and
 	// network connection. Allow communication with the host DBus session bus.
 	public static final List<String> DEFAULT_FINISH_ARGS = Collections.unmodifiableList(Arrays.asList(
 			"--filesystem=host", "--share=network", "--share=ipc", "--socket=x11", "--socket=wayland", "--allow=devel",
-			"--socket=session-bus", "--device=dri", "--env=PATH=/app/bin:/app/jdk/bin:/usr/bin"));
+			"--socket=session-bus", "--device=dri", "--env=PATH=/app/bin:/app/jdk/bin:/app/node/bin:/usr/bin"));
 
 	@JsonProperty("id")
 	public abstract String id();