android: add script in Android archive to create a SDK

Also,
- Move mingw's pkg-support into build-scripts
- Add type annotations to python scripts for mypy
- ci: use v4 tag of actions/cache
- cmake: use PYTHON3_EXECUTABLE for running xxd.py
  (Python3::Interpreter is not always recognized.)
This commit is contained in:
Anonymous Maarten
2024-07-31 00:05:54 +02:00
parent 091960441b
commit a1c6f99877
13 changed files with 414 additions and 62 deletions

View File

@@ -36,7 +36,7 @@ runs:
echo "cache-key=${archive}-${{ inputs.version }}-${{ runner.os }}-${{ runner.arch }}" >> ${GITHUB_OUTPUT}
- name: 'Restore cached ${{ steps.calc.outputs.archive }}'
id: cache-restore
uses: actions/cache/restore@main
uses: actions/cache/restore@v4
with:
path: '${{ runner.temp }}/${{ steps.calc.outputs.archive }}'
key: ${{ steps.calc.outputs.cache-key }}
@@ -47,7 +47,7 @@ runs:
Invoke-WebRequest "https://github.com/ninja-build/ninja/releases/download/v${{ inputs.version }}/${{ steps.calc.outputs.archive }}" -OutFile "${{ runner.temp }}/${{ steps.calc.outputs.archive }}"
- name: 'Cache ${{ steps.calc.outputs.archive }}'
if: ${{ !steps.cache-restore.outputs.cache-hit }}
uses: actions/cache/save@main
uses: actions/cache/save@v4
with:
path: '${{ runner.temp }}/${{ steps.calc.outputs.archive }}'
key: ${{ steps.calc.outputs.cache-key }}

View File

@@ -596,9 +596,6 @@ jobs:
echo "Project contents:"
echo ""
find "/tmp/projects/org.libsdl.testspriteminimal"
- name: 'Remove SDL sources to make sure they are not used'
run: |
rm -rf "${{ steps.src.outputs.path }}"
- name: 'Copy SDL3 aar into Gradle project'
run: |
cp "${{ github.workspace }}/${{ needs.android.outputs.android-aar }}" "${{ steps.create-gradle-project.outputs.path }}/app/libs"
@@ -615,3 +612,26 @@ jobs:
run: |
cd "${{ steps.create-gradle-project.outputs.path }}"
./gradlew -i assembleRelease
- name: 'Extract Android SDK from AAR'
id: sdk
run: |
python "${{ github.workspace }}/${{ needs.android.outputs.android-aar }}" -o /tmp/SDL3-android
echo "prefix=/tmp/SDL3-android" >>$GITHUB_OUTPUT
- name: 'CMake (configure + build) x86, x64, arm32, arm64'
run: |
android_abis="x86 x86_64 armeabi-v7a arm64-v8a"
for android_abi in ${android_abis}; do
echo "Configure ${android_abi}"
cmake -S "${{ steps.src.outputs.path }}/cmake/test" \
-DTEST_FULL=TRUE \
-DTEST_STATIC=FALSE \
-DTEST_TEST=TRUE \
-DCMAKE_PREFIX_PATH="${{ steps.sdk.outputs.prefix }}" \
-DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake \
-DANDROID_ABI=${android_abi} \
-Werror=dev \
-DCMAKE_BUILD_TYPE=Release \
-B "${android_abi}"
done
echo "Build ${android_abi}"
cmake --build "${android_abi}" --config Release --verbose