From cd3dc78d4dcd27483e83294101cde3e1b254be04 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Wed, 20 Nov 2024 06:29:21 +0300 Subject: [PATCH] Include android project into the sources --- android/.gitmodules | 11 ------- android/app/build.gradle.kts | 8 ++--- android/app/src/main/cpp/CMakeLists.txt | 41 ------------------------- android/app/src/main/cpp/SDL | 1 - android/app/src/main/cpp/hlsdk-portable | 1 - android/app/src/main/cpp/xash3d-fwgs | 1 - scripts/gha/deps_android.sh | 19 ++---------- 7 files changed, 6 insertions(+), 76 deletions(-) delete mode 100644 android/.gitmodules delete mode 100644 android/app/src/main/cpp/CMakeLists.txt delete mode 160000 android/app/src/main/cpp/SDL delete mode 160000 android/app/src/main/cpp/hlsdk-portable delete mode 160000 android/app/src/main/cpp/xash3d-fwgs diff --git a/android/.gitmodules b/android/.gitmodules deleted file mode 100644 index d3ba1cf36e..0000000000 --- a/android/.gitmodules +++ /dev/null @@ -1,11 +0,0 @@ -[submodule "hlsdk-portable"] - path = app/src/main/cpp/hlsdk-portable - url = https://github.com/FWGS/hlsdk-portable - branch = mobile_hacks -[submodule "xash3d-fwgs"] - path = app/src/main/cpp/xash3d-fwgs - url = https://github.com/FWGS/xash3d-fwgs -[submodule "SDL"] - path = app/src/main/cpp/SDL - url = https://github.com/libsdl-org/SDL - branch = release-2.24.1 diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index bcfc148f54..55ddb0658d 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -31,7 +31,7 @@ android { externalNativeBuild { cmake { version = "3.22.1" - path = file("${project.projectDir}/src/main/cpp/CMakeLists.txt") + path = file("${project.projectDir}/CMakeLists.txt") } } @@ -75,9 +75,9 @@ android { sourceSets { getByName("main") { - assets.srcDir("${project.projectDir}/src/main/cpp/xash3d-fwgs/3rdparty/extras/xash-extras") + assets.srcDir("${project.projectDir}/../../3rdparty/xash-extras") assets.srcDir("${project.projectDir}/../moddb") - java.srcDir("${project.projectDir}/src/main/cpp/SDL/android-project/app/src/main/java") + java.srcDir("${project.projectDir}/../../3rdparty/SDL/android-project/app/src/main/java") } } @@ -127,4 +127,4 @@ fun getBuildNum(): Int { val qBuildNum = releaseDate.until(now, ChronoUnit.DAYS) val minuteOfDay = now.hour * 60 + now.minute return (qBuildNum * 10000 + minuteOfDay).toInt() -} \ No newline at end of file +} diff --git a/android/app/src/main/cpp/CMakeLists.txt b/android/app/src/main/cpp/CMakeLists.txt deleted file mode 100644 index 6274cf13a2..0000000000 --- a/android/app/src/main/cpp/CMakeLists.txt +++ /dev/null @@ -1,41 +0,0 @@ -cmake_minimum_required(VERSION 3.6) - -project(XASH_ANDROID) - -# armeabi-v7a requires cpufeatures library -include(AndroidNdkModules) -android_ndk_import_module_cpufeatures() - -find_package(PythonInterp 2.7 REQUIRED) - -get_filename_component(C_COMPILER_ID ${CMAKE_C_COMPILER} NAME_WE) -get_filename_component(CXX_COMPILER_ID ${CMAKE_CXX_COMPILER} NAME_WE) - -if(${CMAKE_BUILD_TYPE} STREQUAL "Debug") - set(BUILD_TYPE "debug") -else() - set(BUILD_TYPE "release") -endif() - -set(CMAKE_VERBOSE_MAKEFILE ON) - -set(WAF_CC "${CMAKE_C_COMPILER} --target=${CMAKE_C_COMPILER_TARGET}") -set(WAF_CXX "${CMAKE_CXX_COMPILER} --target=${CMAKE_CXX_COMPILER_TARGET}") - -execute_process( - COMMAND ${CMAKE_COMMAND} -E env - CC=${WAF_CC} CXX=${WAF_CXX} - AR=${CMAKE_AR} STRIP=${CMAKE_STRIP} - ${PYTHON_EXECUTABLE} waf configure -vvv -T ${BUILD_TYPE} cmake - --check-c-compiler=${C_COMPILER_ID} --check-cxx-compiler=${CXX_COMPILER_ID} - -s "${CMAKE_CURRENT_SOURCE_DIR}/SDL" --skip-sdl2-sanity-check - WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/xash3d-fwgs" -) - -if(CMAKE_SIZEOF_VOID_P MATCHES "8") - set(64BIT ON CACHE BOOL "" FORCE) -endif() -add_subdirectory("hlsdk-portable") -add_subdirectory("SDL") -add_subdirectory("xash3d-fwgs") -add_subdirectory("xash3d-fwgs/3rdparty/mainui") \ No newline at end of file diff --git a/android/app/src/main/cpp/SDL b/android/app/src/main/cpp/SDL deleted file mode 160000 index 2eef7ca475..0000000000 --- a/android/app/src/main/cpp/SDL +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2eef7ca475decd2b864214cdbfe72b143b16d459 diff --git a/android/app/src/main/cpp/hlsdk-portable b/android/app/src/main/cpp/hlsdk-portable deleted file mode 160000 index 0d8a19fd82..0000000000 --- a/android/app/src/main/cpp/hlsdk-portable +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 0d8a19fd82758746cc41af5e18946a9410e4533f diff --git a/android/app/src/main/cpp/xash3d-fwgs b/android/app/src/main/cpp/xash3d-fwgs deleted file mode 160000 index 1c84a5c8ad..0000000000 --- a/android/app/src/main/cpp/xash3d-fwgs +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 1c84a5c8ade7cfac17d6b558669d4f721a0bf11f diff --git a/scripts/gha/deps_android.sh b/scripts/gha/deps_android.sh index ff730d7e37..063d52d8f8 100755 --- a/scripts/gha/deps_android.sh +++ b/scripts/gha/deps_android.sh @@ -8,13 +8,12 @@ ANDROID_PLATFORM_VER="android-34" ANDROID_NDK_VER="26.3.11579264" echo "Download JDK 17" -wget https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.7%2B7/OpenJDK17U-jdk_x64_linux_hotspot_17.0.7_7.tar.gz -qO jdk.tar.gz || exit 1 -tar -xzf jdk.tar.gz +wget https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.7%2B7/OpenJDK17U-jdk_x64_linux_hotspot_17.0.7_7.tar.gz -qO- | tar -xzvf - || exit 1 export JAVA_HOME=$GITHUB_WORKSPACE/jdk-17.0.7+7 export PATH=$PATH:$JAVA_HOME/bin echo "Download hlsdk-portable" -git clone --depth 1 --recursive https://github.com/FWGS/hlsdk-portable -b mobile_hacks hlsdk || exit 1 +git clone --depth 1 --recursive https://github.com/FWGS/hlsdk-portable -b mobile_hacks 3rdparty/hlsdk-portable || exit 1 echo "Download Android SDK" mkdir -p sdk || exit 1 @@ -32,17 +31,3 @@ popd echo "Download all needed tools and Android NDK" yes | sdkmanager --licenses > /dev/null 2>/dev/null # who even reads licenses? :) sdkmanager --install build-tools\;${ANDROID_BUILD_TOOLS_VER} platform-tools platforms\;${ANDROID_PLATFORM_VER} ndk\;${ANDROID_NDK_VER} - -echo "Download Xash3D FWGS Android source code" -git clone --depth 1 --recursive https://github.com/FWGS/xash3d-android-project -b gradle android || exit 1 -pushd android/app/src/main/cpp - -mv xash3d-fwgs xash3d-fwgs-sub -ln -s $GITHUB_WORKSPACE xash3d-fwgs -echo "Installed Xash3D FWGS source symlink" - -mv hlsdk-portable hlsdk-portable-sub -ln -s $GITHUB_WORKSPACE/hlsdk hlsdk-portable -echo "Installed hlsdk-portable source symlink" - -popd