Skip to content

Commit

Permalink
Switch to amd64 (#49)
Browse files Browse the repository at this point in the history
To improve clarity and be consistent with the naming in
amousavigourabi/thrift-binary
  • Loading branch information
amousavigourabi authored Aug 15, 2023
2 parents 9e1335a + 68b0bb3 commit 99318ab
Show file tree
Hide file tree
Showing 22 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Multi-platform Thrift compiler.

Executable JAR that packages precompiled Thrift compiler binaries for Windows and Linux systems,
providing portability across these platforms. Supports all Thrift versions starting at 0.6.0 for Windows
and Linux systems running on 64-bit x86, aarch64, s390x, ppc64le, and armv7 machines. As Thrift only
and Linux systems running on aarch64, amd64, armv7, ppc64le, and s390x machines. As Thrift only
publishes binaries for Windows, it is impossible to avoid using the embedded binaries and instead
download them on the fly.

Expand Down
16 changes: 8 additions & 8 deletions src/main/java/me/atour/thriftjar/ThriftExtractor.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ enum OperatingSystems {
LINUX_ARMV7,
LINUX_PPC64LE,
LINUX_S390X,
LINUX_X86_64,
LINUX_AMD64,
WINDOWS,
UNKNOWN
}
Expand Down Expand Up @@ -109,8 +109,8 @@ public ThriftExtractor(String thriftVersion) throws IOException {
return "thrift-linux_ppc64le.exe";
case LINUX_S390X:
return "thrift-linux_s390x.exe";
case LINUX_X86_64:
return "thrift-linux_x86_64.exe";
case LINUX_AMD64:
return "thrift-linux_amd64.exe";
case UNKNOWN:
default:
throw new CannotLocateAppropriateExecutableException();
Expand All @@ -125,8 +125,8 @@ public ThriftExtractor(String thriftVersion) throws IOException {
private ThriftExtractor.OperatingSystems getOs() {
OperatingSystems os;
if (SystemUtils.IS_OS_LINUX) {
if (isX86_64()) {
os = OperatingSystems.LINUX_X86_64;
if (isAmd64()) {
os = OperatingSystems.LINUX_AMD64;
} else if (isS390x()) {
os = OperatingSystems.LINUX_S390X;
} else if (isArmV7()) {
Expand All @@ -147,11 +147,11 @@ private ThriftExtractor.OperatingSystems getOs() {
}

/**
* Checks whether this machine is x86_64.
* Checks whether this machine is amd64.
*
* @return a {@code boolean} indicating whether this machine is x86_64
* @return a {@code boolean} indicating whether this machine is amd64
*/
private boolean isX86_64() {
private boolean isAmd64() {
String arch = System.getProperty("os.arch").toLowerCase();
return arch.contains("x8664") || arch.contains("x64") || arch.contains("amd64");
}
Expand Down

0 comments on commit 99318ab

Please sign in to comment.