mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-01-19 13:51:16 +00:00
workflow and format
This commit is contained in:
parent
0836f5fd35
commit
bb0bbe397e
27
.github/workflows/ci.yml
vendored
27
.github/workflows/ci.yml
vendored
@ -47,6 +47,8 @@ jobs:
|
|||||||
- { name: 'Emscripten', os: 'ubuntu-latest', generator: 'Ninja', dx5: false, config: false, emsdk: true, werror: true, clang-tidy: false, cmake-wrapper: 'emcmake' }
|
- { name: 'Emscripten', os: 'ubuntu-latest', generator: 'Ninja', dx5: false, config: false, emsdk: true, werror: true, clang-tidy: false, cmake-wrapper: 'emcmake' }
|
||||||
- { name: 'Nintendo 3DS', os: 'ubuntu-latest', generator: 'Ninja', dx5: false, config: false, n3ds: true, werror: true, clang-tidy: false, container: 'devkitpro/devkitarm:latest', cmake-args: '-DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/3DS.cmake' }
|
- { name: 'Nintendo 3DS', os: 'ubuntu-latest', generator: 'Ninja', dx5: false, config: false, n3ds: true, werror: true, clang-tidy: false, container: 'devkitpro/devkitarm:latest', cmake-args: '-DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/3DS.cmake' }
|
||||||
- { name: 'Xbox One', os: 'windows-latest', generator: 'Visual Studio 17 2022', dx5: false, config: false, msvc: true, werror: false, clang-tidy: false, vc-arch: 'amd64', cmake-args: '-DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0.26100.0', xbox-one: true}
|
- { name: 'Xbox One', os: 'windows-latest', generator: 'Visual Studio 17 2022', dx5: false, config: false, msvc: true, werror: false, clang-tidy: false, vc-arch: 'amd64', cmake-args: '-DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0.26100.0', xbox-one: true}
|
||||||
|
- { name: 'Android', os: 'ubuntu-latest', generator: 'Ninja', dx5: false, config: false, android: true, werror: true, clang-tidy: false, cmake-args: ' -DANDROID_NDK_PATH=$ANDROID_NDK_HOME' }
|
||||||
|
- { name: 'Android (Debug)', os: 'ubuntu-latest', generator: 'Ninja', dx5: false, config: false, android: true, werror: true, clang-tidy: false, debug: true, cmake-args: ' -DANDROID_NDK_PATH=$ANDROID_NDK_HOME' }
|
||||||
steps:
|
steps:
|
||||||
- name: Setup vcvars
|
- name: Setup vcvars
|
||||||
if: ${{ !!matrix.msvc }}
|
if: ${{ !!matrix.msvc }}
|
||||||
@ -81,7 +83,7 @@ jobs:
|
|||||||
chmod a+x /opt/devkitpro/tools/bin/makerom
|
chmod a+x /opt/devkitpro/tools/bin/makerom
|
||||||
|
|
||||||
- name: Install Linux dependencies (apt-get)
|
- name: Install Linux dependencies (apt-get)
|
||||||
if: ${{ matrix.linux }}
|
if: ${{ matrix.linux || matrix.android }}
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y \
|
sudo apt-get install -y \
|
||||||
@ -106,6 +108,18 @@ jobs:
|
|||||||
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Java (Android)
|
||||||
|
if: ${{ matrix.android }}
|
||||||
|
uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
distribution: 'temurin'
|
||||||
|
java-version: '17'
|
||||||
|
- name: Setup SDK (Android)
|
||||||
|
if: ${{ matrix.android }}
|
||||||
|
uses: android-actions/setup-android@v3
|
||||||
|
with:
|
||||||
|
packages: 'ndk;26.3.11579264 cmake;3.30.5'
|
||||||
|
|
||||||
- name: Configure (CMake)
|
- name: Configure (CMake)
|
||||||
run: |
|
run: |
|
||||||
${{ matrix.cmake-wrapper || '' }} cmake -S . -B build -G "${{ matrix.generator }}" \
|
${{ matrix.cmake-wrapper || '' }} cmake -S . -B build -G "${{ matrix.generator }}" \
|
||||||
@ -123,7 +137,7 @@ jobs:
|
|||||||
run: cmake --build build --verbose --config Release
|
run: cmake --build build --verbose --config Release
|
||||||
|
|
||||||
- name: Package (CPack)
|
- name: Package (CPack)
|
||||||
if: ${{ !matrix.n3ds }}
|
if: ${{ !matrix.n3ds && !matrix.android }}
|
||||||
run: |
|
run: |
|
||||||
cd build
|
cd build
|
||||||
success=0
|
success=0
|
||||||
@ -172,6 +186,14 @@ jobs:
|
|||||||
mv *.3dsx dist/
|
mv *.3dsx dist/
|
||||||
mv *.cia dist/
|
mv *.cia dist/
|
||||||
|
|
||||||
|
- name: Package (Android)
|
||||||
|
if: ${{ matrix.android }}
|
||||||
|
run: |
|
||||||
|
cd build
|
||||||
|
mkdir -p dist
|
||||||
|
find ../ -name '*.apk'
|
||||||
|
mv ../android-project/app/build/outputs/apk/*/*.apk dist/
|
||||||
|
|
||||||
- name: Package Assets Separately
|
- name: Package Assets Separately
|
||||||
if: matrix.build-assets
|
if: matrix.build-assets
|
||||||
run: (cd build/assets && zip -r ../dist/isle-assets.zip .)
|
run: (cd build/assets && zip -r ../dist/isle-assets.zip .)
|
||||||
@ -185,6 +207,7 @@ jobs:
|
|||||||
build/dist/*.AppImage
|
build/dist/*.AppImage
|
||||||
build/dist/*.3dsx
|
build/dist/*.3dsx
|
||||||
build/dist/*.cia
|
build/dist/*.cia
|
||||||
|
build/dist/*.apk
|
||||||
|
|
||||||
flatpak:
|
flatpak:
|
||||||
name: "Flatpak (${{ matrix.arch }})"
|
name: "Flatpak (${{ matrix.arch }})"
|
||||||
|
|||||||
@ -144,7 +144,8 @@ if (ANDROID_NDK_PATH)
|
|||||||
add_custom_target(ANDROID_GRADLE_BUILD ALL
|
add_custom_target(ANDROID_GRADLE_BUILD ALL
|
||||||
DEPENDS "${SDL_ANDROID_ARCHIVE}"
|
DEPENDS "${SDL_ANDROID_ARCHIVE}"
|
||||||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/android-project"
|
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/android-project"
|
||||||
COMMAND "${GRADLEW}" -i ${GRADLE_TASK} -PcmakeArgs=" -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DISLE_USE_DX5=${ISLE_USE_DX5} -DISLE_BUILD_CONFIG=${ISLE_BUILD_CONFIG} -DENABLE_CLANG_TIDY=${ENABLE_CLANG_TIDY} -DISLE_WERROR=${ISLE_WERROR} -DISLE_DEBUG=${ISLE_DEBUG} -Werror=dev"
|
COMMAND "${GRADLEW}" ${GRADLE_TASK} -PcmakeArgs="-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DISLE_USE_DX5=${ISLE_USE_DX5} -DISLE_BUILD_CONFIG=${ISLE_BUILD_CONFIG} -DENABLE_CLANG_TIDY=${ENABLE_CLANG_TIDY} -DISLE_WERROR=${ISLE_WERROR} -DISLE_DEBUG=${ISLE_DEBUG} -Werror=dev"
|
||||||
|
VERBATIM
|
||||||
COMMENT "Building Android APK with Gradle"
|
COMMENT "Building Android APK with Gradle"
|
||||||
)
|
)
|
||||||
message(STATUS "SDL AAR")
|
message(STATUS "SDL AAR")
|
||||||
|
|||||||
@ -1,29 +1,29 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include <SDL3/SDL_system.h>
|
|
||||||
#include <SDL3/SDL_filesystem.h>
|
#include <SDL3/SDL_filesystem.h>
|
||||||
#include <SDL3/SDL_log.h>
|
#include <SDL3/SDL_log.h>
|
||||||
|
#include <SDL3/SDL_system.h>
|
||||||
#include <iniparser.h>
|
#include <iniparser.h>
|
||||||
|
|
||||||
void Android_SetupDefaultConfigOverrides(dictionary* p_dictionary)
|
void Android_SetupDefaultConfigOverrides(dictionary* p_dictionary)
|
||||||
{
|
{
|
||||||
SDL_Log("Overriding default config for Android");
|
SDL_Log("Overriding default config for Android");
|
||||||
|
|
||||||
const char* data = SDL_GetAndroidExternalStoragePath();
|
const char* data = SDL_GetAndroidExternalStoragePath();
|
||||||
char* savedata = new char[strlen(data) + strlen("/saves/") + 1 ];
|
char* savedata = new char[strlen(data) + strlen("/saves/") + 1];
|
||||||
strcpy(savedata, data);
|
strcpy(savedata, data);
|
||||||
strcat(savedata, "/saves/");
|
strcat(savedata, "/saves/");
|
||||||
|
|
||||||
if (!SDL_GetPathInfo(savedata, NULL)) {
|
if (!SDL_GetPathInfo(savedata, NULL)) {
|
||||||
SDL_CreateDirectory(savedata);
|
SDL_CreateDirectory(savedata);
|
||||||
}
|
}
|
||||||
|
|
||||||
iniparser_set(p_dictionary, "isle:diskpath", data);
|
iniparser_set(p_dictionary, "isle:diskpath", data);
|
||||||
iniparser_set(p_dictionary, "isle:cdpath", data);
|
iniparser_set(p_dictionary, "isle:cdpath", data);
|
||||||
|
|
||||||
iniparser_set(p_dictionary, "isle:savepath", savedata);
|
iniparser_set(p_dictionary, "isle:savepath", savedata);
|
||||||
|
|
||||||
// Default to Virtal Mouse
|
// Default to Virtal Mouse
|
||||||
char buf[16];
|
char buf[16];
|
||||||
iniparser_set(p_dictionary, "isle:Touch Scheme", SDL_itoa(0, buf, 10));
|
iniparser_set(p_dictionary, "isle:Touch Scheme", SDL_itoa(0, buf, 10));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1032,12 +1032,12 @@ bool IsleApp::LoadConfig()
|
|||||||
#ifdef IOS
|
#ifdef IOS
|
||||||
const char* prefPath = SDL_GetUserFolder(SDL_FOLDER_DOCUMENTS);
|
const char* prefPath = SDL_GetUserFolder(SDL_FOLDER_DOCUMENTS);
|
||||||
#elif defined(ANDROID)
|
#elif defined(ANDROID)
|
||||||
// SDL_GetAndroidExternalStoragePath() returns without a trailing / resulting in "filesisle.ini" :(
|
// SDL_GetAndroidExternalStoragePath() returns without a trailing / resulting in "filesisle.ini" :(
|
||||||
const char* androidPath = SDL_GetAndroidExternalStoragePath();
|
const char* androidPath = SDL_GetAndroidExternalStoragePath();
|
||||||
char* prefPath = new char[strlen(androidPath) + 2 ];
|
char* prefPath = new char[strlen(androidPath) + 2];
|
||||||
strcpy(prefPath, androidPath);
|
strcpy(prefPath, androidPath);
|
||||||
strcat(prefPath, "/");
|
strcat(prefPath, "/");
|
||||||
SDL_Log("%s", prefPath);
|
SDL_Log("%s", prefPath);
|
||||||
#else
|
#else
|
||||||
char* prefPath = SDL_GetPrefPath("isledecomp", "isle");
|
char* prefPath = SDL_GetPrefPath("isledecomp", "isle");
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user