File tree Expand file tree Collapse file tree 6 files changed +15
-10
lines changed
booster-kotlinx/src/main/kotlin/com/didiglobal/booster/kotlinx
booster-task-compression-cwebp/src/main
kotlin/com/didiglobal/booster/task/compression/cwebp
resources/bin/macosx/x86_64 Expand file tree Collapse file tree 6 files changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,11 @@ object OS {
44
55 val name: String = System .getProperty(" os.name" , " " ).lowercase()
66
7- val arch: String = System .getProperty(" os.arch" , " " ).lowercase()
7+ val arch: String = try {
8+ " arch" .execute().stdout.trim().lowercase()
9+ } catch (e: Throwable ) {
10+ System .getProperty(" os.arch" , " " ).lowercase()
11+ }
812
913 val version = object : Comparable <String > {
1014
@@ -62,8 +66,6 @@ object OS {
6266
6367 fun isMac () = name.startsWith(" mac" )
6468
65- fun isArm64Chip () = arch.startsWith(" aarch64" )
66-
6769 fun isWindows () = name.startsWith(" windows" )
6870
6971}
Original file line number Diff line number Diff line change @@ -57,13 +57,16 @@ internal val PREBUILT_CWEBP_EXECUTABLE = "bin/" + when {
5757 " x64" , " x86_64" , " amd64" -> " x64"
5858 else -> TODO (" Unsupported architecture ${OS .arch} " )
5959 }
60- OS .isMac() -> " macosx/" + when {
61- OS .isArm64Chip() -> " arm64"
62- OS .version >= " 10.15" -> " 10.15"
63- OS .version >= " 10.14" -> " 10.14"
64- OS .version >= " 10.13" -> " 10.13"
65- OS .version >= " 10.12" -> " 10.12"
66- else -> TODO (" Unsupported system version ${OS .version} " )
60+ OS .isMac() -> " macosx/" + when (OS .arch) {
61+ " arm64" -> " arm64"
62+ " x86_64" -> " x86_64/" + when {
63+ OS .version >= " 10.15" -> " 10.15"
64+ OS .version >= " 10.14" -> " 10.14"
65+ OS .version >= " 10.13" -> " 10.13"
66+ OS .version >= " 10.12" -> " 10.12"
67+ else -> TODO (" Unsupported system version ${OS .version} " )
68+ }
69+ else -> TODO (" Unsupported architecture ${OS .arch} " )
6770 }
6871 OS .isWindows() -> " windows/" + when (OS .arch) {
6972 " x64" , " x86_64" , " amd64" -> " x64"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
You can’t perform that action at this time.
0 commit comments