Skip to content

Commit 3bd8da7

Browse files
committed
Add check for CI and only building current arch
1 parent 035ac9c commit 3bd8da7

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

OpacityCore/build.gradle

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ android {
1818
cppFlags ''
1919
}
2020
}
21+
22+
if (isRunningOnCI()) {
23+
ndk {
24+
abiFilters getCurrentArchitecture()
25+
}
26+
}
2127
}
2228

2329
buildTypes {
@@ -74,4 +80,21 @@ publishing {
7480
}
7581
}
7682
}
83+
}
84+
85+
// Function to detect the current architecture
86+
def getCurrentArchitecture() {
87+
def arch = System.getProperty("os.arch")
88+
if (arch.contains("aarch64") || arch.contains("arm64")) {
89+
return "arm64-v8a"
90+
} else if (arch.contains("x86_64") || arch.contains("amd64")) {
91+
return "x86_64"
92+
} else {
93+
return "x86_64"
94+
}
95+
}
96+
97+
// Function to check if running on CI in test configuration
98+
def isRunningOnCI() {
99+
return System.getenv("CI_TEST")?.toBoolean() ?: false
77100
}

0 commit comments

Comments
 (0)