ci: update andorid build/ci

This commit is contained in:
KorewaWatchful
2026-05-21 14:02:20 -04:00
committed by Gamid
parent c93dcb7ee1
commit 9dddc4e784
9 changed files with 92 additions and 72 deletions
+1 -2
View File
@@ -12,7 +12,6 @@ rm -rf android/app/assets/data android/app/assets/shaders-builtin
cp -r data android/app/assets/data cp -r data android/app/assets/data
cp -r vita3k/shaders-builtin android/app/assets/shaders-builtin cp -r vita3k/shaders-builtin android/app/assets/shaders-builtin
export JAVA_HOME="${JAVA_HOME_17_X64}"
chmod +x android/gradlew chmod +x android/gradlew
if [[ -e "${SIGNING_STORE_PATH:-}" ]]; then if [[ -e "${SIGNING_STORE_PATH:-}" ]]; then
@@ -22,7 +21,7 @@ else
fi fi
pushd android > /dev/null pushd android > /dev/null
./gradlew --stacktrace --configuration-cache --build-cache --parallel --configure-on-demand ":app:assemble${BUILD_TYPE}" ./gradlew --stacktrace ":app:assemble${BUILD_TYPE}"
popd > /dev/null popd > /dev/null
APK_PATH="android/app/build/outputs/apk/${BUILD_TYPE,,}/app-${BUILD_TYPE,,}.apk" APK_PATH="android/app/build/outputs/apk/${BUILD_TYPE,,}/app-${BUILD_TYPE,,}.apk"
+22
View File
@@ -1,11 +1,33 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -euo pipefail set -euo pipefail
android_api_level="${ANDROID_API_LEVEL:-35}"
android_build_tools="${ANDROID_BUILD_TOOLS:-36.0.0}"
android_ndk_version="${ANDROID_NDK_VERSION:-29.0.14206865}"
sudo apt-get update sudo apt-get update
sudo apt-get install -y ninja-build sudo apt-get install -y ninja-build
repo_root="$(cd "$(dirname "$0")/.." && pwd)" repo_root="$(cd "$(dirname "$0")/.." && pwd)"
if command -v sdkmanager > /dev/null; then
set +o pipefail
yes | sdkmanager --licenses > /dev/null
set -o pipefail
sdkmanager --install \
"platforms;android-${android_api_level}" \
"build-tools;${android_build_tools}" \
"ndk;${android_ndk_version}"
sdk_root="${ANDROID_SDK_ROOT:-${ANDROID_HOME:-}}"
if [[ -n "${sdk_root:-}" ]]; then
export ANDROID_NDK_HOME="${sdk_root}/ndk/${android_ndk_version}"
if [[ -n "${GITHUB_ENV:-}" ]]; then
echo "ANDROID_NDK_HOME=${ANDROID_NDK_HOME}" >> "${GITHUB_ENV}"
fi
fi
fi
pushd "$repo_root" > /dev/null pushd "$repo_root" > /dev/null
for triplet in arm64-android x64-android; do for triplet in arm64-android x64-android; do
vcpkg install --triplet "$triplet" vcpkg install --triplet "$triplet"
+18 -7
View File
@@ -237,13 +237,21 @@ jobs:
restore-keys: | restore-keys: |
cache-android-native- cache-android-native-
- name: Restore Gradle cache - name: Set up Java
uses: actions/cache@v5 uses: actions/setup-java@v5
with: with:
path: ~/.gradle/ distribution: temurin
key: ${{ runner.os }}-gradle-${{ hashFiles('android/**/*.gradle', 'android/**/*.properties', 'android/**/*.xml', 'android/**/*.java', 'android/**/*.kt') }} java-version: '17'
restore-keys: |
${{ runner.os }}-gradle- - name: Set up Gradle
uses: gradle/actions/setup-gradle@v6
with:
add-job-summary: on-failure
cache-provider: basic
validate-wrappers: false
- name: Set up Android SDK tools
uses: android-actions/setup-android@v4
- name: Set up Android build environment - name: Set up Android build environment
env: env:
@@ -273,10 +281,13 @@ jobs:
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }} SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }}
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }} SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }}
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }} SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
JVM_OPTS: -Xmx6G
VCPKG_ROOT: /usr/local/share/vcpkg VCPKG_ROOT: /usr/local/share/vcpkg
ANDROID_NDK_HOME: ${{ env.ANDROID_NDK_HOME }}
run: bash ./.ci/build-android.sh "${{ env.ARTIFACT_DIR }}" run: bash ./.ci/build-android.sh "${{ env.ARTIFACT_DIR }}"
- name: Print Android ccache statistics
run: ccache -s
- name: Upload Android artifact - name: Upload Android artifact
uses: actions/upload-artifact@v7 uses: actions/upload-artifact@v7
with: with:
+42 -50
View File
@@ -1,6 +1,7 @@
apply plugin: 'com.android.application' plugins {
apply plugin: 'org.jetbrains.kotlin.android' id 'com.android.application'
apply plugin: 'org.jetbrains.kotlin.plugin.compose' id 'org.jetbrains.kotlin.plugin.compose'
}
def signingStorePath = System.getenv("SIGNING_STORE_PATH") def signingStorePath = System.getenv("SIGNING_STORE_PATH")
def signingStorePassword = System.getenv("SIGNING_STORE_PASSWORD") def signingStorePassword = System.getenv("SIGNING_STORE_PASSWORD")
@@ -9,74 +10,68 @@ def signingKeyPassword = System.getenv("SIGNING_KEY_PASSWORD")
def hasCiSigning = signingStorePath && signingStorePassword && signingKeyAlias && signingKeyPassword def hasCiSigning = signingStorePath && signingStorePassword && signingKeyAlias && signingKeyPassword
android { android {
namespace "org.vita3k.emulator" namespace = "org.vita3k.emulator"
compileSdk 35 compileSdk = 35
ndkVersion "27.3.13750724" ndkVersion = "29.0.14206865"
buildFeatures { buildFeatures {
buildConfig true buildConfig = true
compose true compose = true
} }
defaultConfig { defaultConfig {
applicationId "org.vita3k.emulator" applicationId = "org.vita3k.emulator"
minSdk 28 minSdk = 28
targetSdk 35 targetSdk = 35
versionCode 21 versionCode = 21
versionName "0.2.1" versionName = "0.2.1"
ndk { ndk {
abiFilters "arm64-v8a", "x86_64" abiFilters "arm64-v8a", "x86_64"
} }
externalNativeBuild {
cmake {
arguments "-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON" // required until NDK r28
}
}
} }
signingConfigs { signingConfigs {
ci { ci {
if (hasCiSigning) { if (hasCiSigning) {
storeFile file(signingStorePath) storeFile = file(signingStorePath)
storePassword signingStorePassword storePassword = signingStorePassword
keyAlias signingKeyAlias keyAlias = signingKeyAlias
keyPassword signingKeyPassword keyPassword = signingKeyPassword
} }
} }
} }
buildTypes { buildTypes {
debug { debug {
debuggable true debuggable = true
jniDebuggable true jniDebuggable = true
applicationIdSuffix '.debug' applicationIdSuffix = '.debug'
} }
reldebug { reldebug {
debuggable true debuggable = true
jniDebuggable true jniDebuggable = true
externalNativeBuild { externalNativeBuild {
cmake { cmake {
arguments "-DCMAKE_BUILD_TYPE=RelWithDebInfo" arguments "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
} }
} }
minifyEnabled false minifyEnabled = false
shrinkResources false shrinkResources = false
applicationIdSuffix '.debug' applicationIdSuffix = '.debug'
signingConfig = signingConfigs.debug signingConfig = signingConfigs.debug
} }
release { release {
debuggable false debuggable = false
jniDebuggable false jniDebuggable = false
externalNativeBuild { externalNativeBuild {
cmake { cmake {
arguments "-DCMAKE_BUILD_TYPE=Release" arguments "-DCMAKE_BUILD_TYPE=Release"
} }
} }
minifyEnabled true minifyEnabled = true
shrinkResources true shrinkResources = true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig = hasCiSigning ? signingConfigs.ci : signingConfigs.debug signingConfig = hasCiSigning ? signingConfigs.ci : signingConfigs.debug
} }
@@ -86,9 +81,6 @@ android {
sourceCompatibility JavaVersion.VERSION_17 sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17 targetCompatibility JavaVersion.VERSION_17
} }
kotlinOptions {
jvmTarget = '17'
}
sourceSets { sourceSets {
main { main {
@@ -104,20 +96,20 @@ android {
externalNativeBuild { externalNativeBuild {
cmake { cmake {
path '../../CMakeLists.txt' path = '../../CMakeLists.txt'
version '3.22.1+' version = '3.22.1+'
} }
} }
lint { lint {
abortOnError false abortOnError = false
checkReleaseBuilds false checkReleaseBuilds = false
} }
packagingOptions { packaging {
jniLibs { jniLibs {
useLegacyPackaging true useLegacyPackaging = true
} }
} }
} }
dependencies { dependencies {
+4 -6
View File
@@ -1,10 +1,8 @@
plugins { plugins {
id 'com.android.application' version '8.13.0' apply false id 'com.android.application' version '9.2.1' apply false
id 'com.android.library' version '8.13.0' apply false id 'org.jetbrains.kotlin.plugin.compose' version '2.3.21' apply false
id 'org.jetbrains.kotlin.android' version '2.1.20' apply false
id 'org.jetbrains.kotlin.plugin.compose' version '2.1.20' apply false
} }
task clean(type: Delete) { tasks.register('clean', Delete) {
delete rootProject.buildDir delete(rootProject.layout.buildDirectory)
} }
+2 -5
View File
@@ -7,6 +7,7 @@
# Specifies the JVM arguments used for the daemon process. # Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings. # The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx3g -XX:+UseParallelGC org.gradle.jvmargs=-Xmx3g -XX:+UseParallelGC
org.gradle.caching=true
# When configured, Gradle will run in incubating parallel mode. # When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit # This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
@@ -17,11 +18,7 @@ org.gradle.daemon=true
# Android operating system, and which are packaged with your app's APK # Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn # https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
# Android NDK verbose build output # Android NDK verbose build output
android.native.buildOutput=verbose android.native.buildOutput=verbose
# Gradle Configuration Cache # Gradle Configuration Cache
org.gradle.unsafe.configuration-cache=true org.gradle.configuration-cache=true
android.nonTransitiveRClass=false
android.nonFinalResIds=false
+1 -1
View File
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
+1 -1
View File
@@ -161,7 +161,7 @@ Note: The CMake preset `linux-ninja-clang` makes use of the LLD linker, which wi
- Building can be done with Android studio: select the Vita3K Android folder and click on the build icon or by command line: - Building can be done with Android studio: select the Vita3K Android folder and click on the build icon or by command line:
```sh ```sh
./gradlew --stacktrace --configuration-cache --build-cache --parallel --configure-on-demand assembleReldebug ./gradlew --stacktrace assembleReldebug
``` ```
## Note ## Note
+1
View File
@@ -1,6 +1,7 @@
{ {
"name": "vita3k", "name": "vita3k",
"version-string": "0.0.0", "version-string": "0.0.0",
"builtin-baseline": "77df67cfff9c12ccfdb52284e07c87c75092f723",
"dependencies": [ "dependencies": [
"boost-filesystem", "boost-filesystem",
"boost-icl", "boost-icl",