frontend-maven-plugin
frontend-maven-plugin copied to clipboard
add support for armv6l or armv7l
Summary Add support for armv6l or armv7l for "arm" architecture (as detected by Java system property "os.arch").
Related to issue #704 This PR adds support for installing node on armv6l or armv7l on a Raspberry Pi.
On the LTS node download site: https://nodejs.org/dist/v8.10.0/ there are only two choices for "arm" versions of node ("aarch64" is a different case): armv6l and armv7l.
This patch executes a "name -a" command and looks for "armv6l" in the result. If no such string is found (or any other error occurs), the return value is "armv7l".
Tests and Documentation
I ran the following test code on a raspberry pi to confirm the behavior produced valid node download URLs:
package com.github.eirslett.maven.plugins.frontend.lib;
public class PlatformTest
{
public static void main(final String[] args) {
final com.github.eirslett.maven.plugins.frontend.lib.Platform platform = Platform.guess();
System.out.println("os.arch:" + System.getProperty("os.arch"));
final Architecture architecture = Architecture.guess();
System.out.println("Architecture.guess(): " + architecture);
final String actual = platform.getNodeDownloadFilename("v8.10.0", false);
System.out.println("Platform.getNodeDownloadFilename(): " + actual);
}
}
The test output was:
os.arch:arm
Architecture.guess(): armv7l
Platform.getNodeDownloadFilename(): v8.10.0/node-v8.10.0-linux-armv7l.tar.gz
That output should produce a valid download URL from this page:
https://nodejs.org/dist/v8.10.0/