Skip to content

Commit

Permalink
Add riscv32 and riscv64 support (#62)
Browse files Browse the repository at this point in the history
Motivation:

- `os-maven-plugin` doesn't recognize the following `os.arch` values:
  - `riscv32`
  - `riscv64`

Modifications:

- Return `riscv` for `riscv` and `riscv32`.
- Return `riscv64` for `riscv64`.

Result:
- Fixes #61

Co-authored-by: Trustin Lee <t@motd.kr>
  • Loading branch information
zinovya and trustin committed Nov 7, 2022
1 parent 6bd9cfa commit 4df5494
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Expand Up @@ -44,7 +44,8 @@
* `ppcle_64` - if the value is `ppc64le`
* `s390_32` - if the value is `s390`
* `s390_64` if the value is `s390x`
* `riscv` if the value is `riscv`
* `riscv` if the value is `riscv` or `riscv32`
* `riscv64` if the value is `riscv64`
* `e2k` if the value is `e2k`

Note: The bitness part of this property relies on the bitness of the JVM binary, e.g. You'll get the property that ends with `_32` if you run a 32-bit JVM on a 64-bit OS.
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/kr/motd/maven/os/Detector.java
Expand Up @@ -245,9 +245,12 @@ private static String normalizeArch(String value) {
if ("s390x".equals(value)) {
return "s390_64";
}
if ("riscv".equals(value)) {
if (value.matches("^(riscv|riscv32)$")) {
return "riscv";
}
if ("riscv64".equals(value)) {
return "riscv64";
}
if ("e2k".equals(value)) {
return "e2k";
}
Expand Down

0 comments on commit 4df5494

Please sign in to comment.