Skip to content

Commit

Permalink
cleanup and seperate SDL3-jar build step (workaround)
Browse files Browse the repository at this point in the history
  • Loading branch information
Green-Sky committed Jun 4, 2024
1 parent fb21089 commit 547159a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 22 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ jobs:
- name: Build (tomato)
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j 4 -t tomato

#- name: Build (all)
# run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j 4
- name: Build (SDL3-jar) (workaround)
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j 4 -t SDL3-jar

- name: Build (apk)
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j 4 -t SDL3-jar -t tomato-jar -t tomato-dex -t tomato-apk
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j 4 -t tomato-apk

- uses: actions/upload-artifact@v4
with:
Expand Down
22 changes: 3 additions & 19 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ if (ANDROID AND TARGET SDL3::Jar)

list(APPEND CMAKE_MODULE_PATH "${SDL3_SOURCE_DIR}/cmake/android")

# here be dragons

find_package(SdlAndroid MODULE)
find_package(Java)
find_package(SdlAndroidPlatform MODULE)
Expand All @@ -85,33 +87,14 @@ if (ANDROID AND TARGET SDL3::Jar)
sdl_create_android_debug_keystore(tomato-debug-keystore)
sdl_android_compile_resources(tomato-resources RESFOLDER android/app/res)

#god

#set(ANDROID_MANIFEST_APP_NAME "${TEST}")
#set(ANDROID_MANIFEST_LABEL "${TEST}")
#set(ANDROID_MANIFEST_LIB_NAME "$<TARGET_FILE_BASE_NAME:tomato>")
set(ANDROID_MANIFEST_PACKAGE "org.libsdl.app.tomato")
#set(generated_manifest_path "${CMAKE_CURRENT_BINARY_DIR}/android/${TEST}-src/AndroidManifest.xml")
string(REPLACE "." "/" JAVA_PACKAGE_DIR "${ANDROID_MANIFEST_PACKAGE}")
#set(GENERATED_SRC_FOLDER "${CMAKE_CURRENT_BINARY_DIR}/android/${TEST}-src")
#set(GENERATED_RES_FOLDER "${GENERATED_SRC_FOLDER}/res")
#set(JAVA_PACKAGE_DIR "${GENERATED_SRC_FOLDER}/${JAVA_PACKAGE_DIR}")
set(JAVA_PACKAGE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android/app/java/${JAVA_PACKAGE_DIR}")
#configure_file(android/cmake/SDLEntryTestActivity.java.cmake "${JAVA_PACKAGE_DIR}/SDLEntryTestActivity.java" @ONLY)
#configure_file(android/cmake/SDLTestActivity.java.cmake "${JAVA_PACKAGE_DIR}/SDLTestActivity.java" @ONLY)
#configure_file(android/cmake/res/values/strings.xml.cmake android/res/values/strings-${TEST}.xml @ONLY)
#configure_file(android/cmake/res/xml/shortcuts.xml.cmake "${GENERATED_RES_FOLDER}/xml/shortcuts.xml" @ONLY)
#configure_file(android/cmake/AndroidManifest.xml.cmake "${generated_manifest_path}" @ONLY)
#file(GENERATE
# OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/android/${TEST}-$<CONFIG>/res/values/strings.xml"
# INPUT "${CMAKE_CURRENT_BINARY_DIR}/android/res/values/strings-${TEST}.xml"
#)

#sdl_android_compile_resources(${TEST}-resources
# RESOURCES
# "${CMAKE_CURRENT_BINARY_DIR}/android/${TEST}-$<CONFIG>/res/values/strings.xml"
# "${GENERATED_RES_FOLDER}/xml/shortcuts.xml"
#)

sdl_android_link_resources(tomato-apk-linked
MANIFEST "android/app/AndroidManifest.xml"
Expand Down Expand Up @@ -142,6 +125,7 @@ if (ANDROID AND TARGET SDL3::Jar)
DEPENDS $<TARGET_PROPERTY:tomato-apk-linked,OUTPUTS> "$<TARGET_PROPERTY:SDL3::Jar,JAR_FILE>"
)
add_custom_target(tomato-jar DEPENDS "${OUT_JAR}")
add_dependencies(tomato-jar SDL3::Jar) # HACK: somehow their jar is not registered as an output
set_property(TARGET tomato-jar PROPERTY OUTPUT "${OUT_JAR}")

set(dexworkdir "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/tomato-dex.dir")
Expand Down

0 comments on commit 547159a

Please sign in to comment.