add linux-other-arch complie/build support (#2443)

pull/2501/head
火云邪神 2 years ago committed by GitHub
parent 398d05fee8
commit ed381886b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -161,6 +161,21 @@
</plugins>
</build>
</profile>
<!-- linux other-arch-->
<profile>
<id>linux-${os.arch}</id>
<activation>
<os>
<name>linux</name>
<arch>!amd64</arch>
</os>
</activation>
<properties>
<os_name>linux</os_name>
<lib_name>libArthasJniLibrary-${os.arch}.so</lib_name>
</properties>
</profile>
</profiles>
<build>

@ -71,6 +71,10 @@ public class OSUtils {
return "x86_32".equals(arch);
}
public static boolean isX86_64() {
return "x86_64".equals(arch);
}
private static String normalizeArch(String value) {
value = normalize(value);
if (value.matches("^(x8664|amd64|ia32e|em64t|x64)$")) {
@ -127,8 +131,7 @@ public class OSUtils {
if ("s390x".equals(value)) {
return "s390_64";
}
return UNKNOWN;
return value;
}
private static String normalize(String value) {

@ -12,11 +12,14 @@ public class VmToolUtils {
libName = "libArthasJniLibrary.dylib";
}
if (OSUtils.isLinux()) {
libName = "libArthasJniLibrary-x64.so";
if (OSUtils.isArm32()) {
libName = "libArthasJniLibrary-arm.so";
} else if (OSUtils.isArm64()) {
libName = "libArthasJniLibrary-aarch64.so";
} else if (OSUtils.isX86_64()) {
libName = "libArthasJniLibrary-x64.so";
}else {
libName = "libArthasJniLibrary-" + OSUtils.arch() + ".so";
}
}
if (OSUtils.isWindows()) {

@ -57,6 +57,7 @@
<file>
<source>../bin/as-service.bat</source>
</file>
</files>
<fileSets>
@ -66,5 +67,12 @@
<fileSet>
<directory>../lib</directory>
</fileSet>
<fileSet>
<directory>../arthas-vmtool/target</directory>
<outputDirectory>lib</outputDirectory>
<includes>
<include>libArthasJniLibrary*</include>
</includes>
</fileSet>
</fileSets>
</assembly>

Loading…
Cancel
Save