From 33a200fead1b9faf244d377a125d8b3e2214fcb9 Mon Sep 17 00:00:00 2001 From: qkdreyer Date: Sun, 14 Jun 2020 12:18:44 +0200 Subject: [PATCH] refactor: add README + Makefile + ci fix #1 --- .github/workflows/android.yml | 22 ++++++++++ .gitignore | 3 +- .gitmodules | 3 ++ CMakeLists.txt | 5 ++- Makefile | 30 ++++++++++++++ README.md | 65 ++++++++++++++++++++++++++++++ config/base.hxml | 8 ++++ config/main.hxml | 2 + config/pak.hxml | 2 + hashlink | 2 +- heaps | 1 + openal-nativetools/CMakeLists.txt | 10 ++--- openal-nativetools/bin2h | Bin 0 -> 17264 bytes openal-nativetools/bsincgen | Bin 0 -> 21596 bytes 14 files changed, 145 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/android.yml create mode 100644 Makefile create mode 100644 README.md create mode 100644 config/base.hxml create mode 100644 config/main.hxml create mode 100644 config/pak.hxml create mode 160000 heaps create mode 100755 openal-nativetools/bin2h create mode 100755 openal-nativetools/bsincgen diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml new file mode 100644 index 0000000..379e1e9 --- /dev/null +++ b/.github/workflows/android.yml @@ -0,0 +1,22 @@ +name: android +on: + pull_request: + push: + branches: + - master + +jobs: + build: + runs-on: macOS-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - run: make init + - run: make heaps-world + - run: make build + - uses: actions/upload-artifact@v2 + with: + name: heapsapp-debug.apk + path: heaps-android-app/heapsapp/build/outputs/apk/debug/heapsapp-debug.apk diff --git a/.gitignore b/.gitignore index 5468d9e..3fe56f5 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -/out/* +out +build diff --git a/.gitmodules b/.gitmodules index b503e12..02a6fcd 100644 --- a/.gitmodules +++ b/.gitmodules @@ -14,3 +14,6 @@ [submodule "heaps-android-app"] path = heaps-android-app url = https://github.com/rtissera/heaps-android-app.git +[submodule "heaps"] + path = heaps + url = https://github.com/HeapsIO/heaps.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 5317444..df9ca26 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,6 +9,7 @@ include_directories(hashlink/src) file(GLOB libhl hashlink/src/std/*.c hashlink/src/alloc.c + hashlink/src/gc.c ) list(REMOVE_ITEM libhl ${CMAKE_CURRENT_SOURCE_DIR}/hashlink/src/std/debug.c) @@ -38,6 +39,7 @@ file(GLOB png hashlink/include/png/*.c) file(GLOB zlib hashlink/include/zlib/*.c) file(GLOB vorbis hashlink/include/vorbis/*.c) file(GLOB mikkt hashlink/include/mikktspace/*.c) +file(GLOB minimp3 hashlink/include/minimp3/*.c) add_library(fmt.hdll STATIC ${fmt} @@ -52,9 +54,10 @@ file(GLOB tj_include libjpeg-turbo/jni/vendor/libjpeg-turbo/libjpeg-turbo-*) target_link_libraries(fmt.hdll ${TJ_LIB}) target_compile_definitions(fmt.hdll PRIVATE PNG_ARM_NEON_OPT=0) #disable Neon support for now -target_include_directories(fmt.hdll PRIVATE +target_include_directories(fmt.hdll PRIVATE hashlink/include/png hashlink/include/mikktspace + hashlink/include/minimp3 hashlink/include/vorbis hashlink/include/zlib ${tj_include} diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..4e7ea7f --- /dev/null +++ b/Makefile @@ -0,0 +1,30 @@ +.PHONY: all init build install clean heaps-world + +all: build install + +init: + brew install haxe + brew bundle install --file hashlink/Brewfile --no-lock + make -C hashlink + make install -C hashlink + haxelib setup /usr/local/lib/haxe/lib + brew cask install android-studio + ln -sf /Applications/Android\ Studio.app/Contents/plugins/android/lib/templates/gradle/wrapper/gradlew /usr/local/bin + chmod u+x /usr/local/bin/gradlew + +build: + gradlew buildDebug -p heaps-android-app + +install: + adb install heaps-android-app/heapsapp/build/outputs/apk/debug/heapsapp-debug.apk + +clean: + gradlew clean -p heaps-android-app + +heaps-world: heaps-world-hl heaps-world-pak + +heaps-world-hl: + cd heaps/samples && haxelib install --always ../../config/main.hxml && haxe -hl ../../out/main.c ../../config/main.hxml + +heaps-world-pak: + cd heaps/samples && haxe -hl ../../out/pak.hl ../../config/pak.hxml && hl ../../out/pak.hl -out ../../out/res diff --git a/README.md b/README.md new file mode 100644 index 0000000..36ef0d4 --- /dev/null +++ b/README.md @@ -0,0 +1,65 @@ +# Heaps Android +Forked from https://github.com/HeapsIO/heaps-android/ + +![android](https://github.com/qkdreyer/heaps-android/workflows/android/badge.svg?branch=master) + + +## Setup + +```sh +git clone https://github.com/qkdreyer/heaps-android +cd heaps-android +make init +``` + +## Usage + +```sh +make heaps-world +make build +make install +``` + +# Extra + +## Visual Studio Code + +`.vscode/tasks.json` +``` +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "Build & Run (Android)", + "dependsOn": [ + "Build (Android)", + "Run (Android)" + ], + "dependsOrder": "sequence", + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": [] + }, + { + "label": "Build (Android)", + "type": "shell", + "command": "make build", + "group": "build", + "problemMatcher": [] + }, + { + "label": "Run (Android)", + "type": "shell", + "command": "make install", + "group": "build", + "problemMatcher": [] + }, +] +} +``` diff --git a/config/base.hxml b/config/base.hxml new file mode 100644 index 0000000..3ea31c3 --- /dev/null +++ b/config/base.hxml @@ -0,0 +1,8 @@ +World.hx +-lib heaps +-lib hlsdl +-lib hxbit +-lib format +-lib hashlink +-D windowSize=1024x768 +-D resourcesPath=world_res diff --git a/config/main.hxml b/config/main.hxml new file mode 100644 index 0000000..e26dd9c --- /dev/null +++ b/config/main.hxml @@ -0,0 +1,2 @@ +../../config/base.hxml +-main World diff --git a/config/pak.hxml b/config/pak.hxml new file mode 100644 index 0000000..54bf658 --- /dev/null +++ b/config/pak.hxml @@ -0,0 +1,2 @@ +../../config/base.hxml +-main hxd.fmt.pak.Build diff --git a/hashlink b/hashlink index 0fd764d..70a1884 160000 --- a/hashlink +++ b/hashlink @@ -1 +1 @@ -Subproject commit 0fd764d7711ad170115f173a59c81a6bc1da8c4b +Subproject commit 70a1884cd3bd5921f85d780ce48324141ff6e452 diff --git a/heaps b/heaps new file mode 160000 index 0000000..50e0707 --- /dev/null +++ b/heaps @@ -0,0 +1 @@ +Subproject commit 50e0707ee5d5cd05a6672a25a857ef246e9c2b80 diff --git a/openal-nativetools/CMakeLists.txt b/openal-nativetools/CMakeLists.txt index 28f908e..4e4bc96 100644 --- a/openal-nativetools/CMakeLists.txt +++ b/openal-nativetools/CMakeLists.txt @@ -1307,8 +1307,8 @@ ADD_CUSTOM_TARGET(native-tools ]] -file(COPY ${OpenAL_SOURCE_DIR}/../openal-nativetools/bin2h.exe DESTINATION ${NATIVE_BIN_DIR}) -file(COPY ${OpenAL_SOURCE_DIR}/../openal-nativetools/bsincgen.exe DESTINATION ${NATIVE_BIN_DIR}) +file(COPY ${OpenAL_SOURCE_DIR}/../openal-nativetools/bin2h DESTINATION ${NATIVE_BIN_DIR}) +file(COPY ${OpenAL_SOURCE_DIR}/../openal-nativetools/bsincgen DESTINATION ${NATIVE_BIN_DIR}) option(ALSOFT_EMBED_HRTF_DATA "Embed the HRTF data files (increases library footprint)" ON) if(ALSOFT_EMBED_HRTF_DATA) @@ -1578,7 +1578,7 @@ ENDIF() IF(ALSOFT_UTILS) ADD_EXECUTABLE(openal-info utils/openal-info.c) TARGET_COMPILE_OPTIONS(openal-info PRIVATE ${C_FLAGS}) - TARGET_LINK_LIBRARIES(openal-info PRIVATE ${LINKER_FLAGS} OpenAL) + TARGET_LINK_LIBRARIES(openal-info PRIVATE ${LINKER_FLAGS} OpenAL OpenSLES log) SET(MAKEHRTF_SRCS utils/makehrtf.c) IF(NOT HAVE_GETOPT) @@ -1612,7 +1612,7 @@ IF(ALSOFT_TESTS) ADD_EXECUTABLE(altonegen examples/altonegen.c ${TEST_COMMON_OBJS}) TARGET_COMPILE_DEFINITIONS(altonegen PRIVATE ${CPP_DEFS}) TARGET_COMPILE_OPTIONS(altonegen PRIVATE ${C_FLAGS}) - TARGET_LINK_LIBRARIES(altonegen PRIVATE ${LINKER_FLAGS} common OpenAL ${MATH_LIB}) + TARGET_LINK_LIBRARIES(altonegen PRIVATE ${LINKER_FLAGS} common OpenAL OpenSLES log ${MATH_LIB}) IF(ALSOFT_INSTALL) INSTALL(TARGETS altonegen @@ -1630,7 +1630,7 @@ IF(ALSOFT_EXAMPLES) ADD_EXECUTABLE(alrecord examples/alrecord.c) TARGET_COMPILE_DEFINITIONS(alrecord PRIVATE ${CPP_DEFS}) TARGET_COMPILE_OPTIONS(alrecord PRIVATE ${C_FLAGS}) - TARGET_LINK_LIBRARIES(alrecord PRIVATE ${LINKER_FLAGS} common OpenAL) + TARGET_LINK_LIBRARIES(alrecord PRIVATE ${LINKER_FLAGS} common OpenAL OpenSLES log) IF(ALSOFT_INSTALL) INSTALL(TARGETS alrecord diff --git a/openal-nativetools/bin2h b/openal-nativetools/bin2h new file mode 100755 index 0000000000000000000000000000000000000000..b3288246b4ea331a795c34f12f0ffe9af6582b51 GIT binary patch literal 17264 zcmeHPU2GIZ9G@a+Dd-gw4Sug56);!|v9Z!Lwn%l+iYQ95s?k)5|-!wDH%>2LR z|NqZ#X76El=Dzszr@t-|qUHi2#5B};)O9n2C&YI43YpPA;c&l2b!waM`QEA~gfjbmT+Q$8zoQugoeR{gGA+Jd#m@alG zLbZh(ByUG;p)$9+Wob6sDM zewKHv>2U6PVC8DHx|Z@IHxvhemxUV)h5L<_X;b7leYwc8ft{`AA&i)dlo7F3EkkD62sev)b?b3s0|*EHprU zb>L|6r^U~pJxOirK6Z%$-wxWP5ouZ+*$-Lea+sD{Dl&ArjUPi`K#g7e=%A>~tIqIs zyx_D;qcVwd^Y2hreuGHII;vu^n}{V%iz6>E)&ZCz)^~JLZaad}h((Qx^&aFAG}>rZ z8kJ5<`wr8r+~_+mt2RjG%5@uzoum?%`RHgt2q!YWg zM|>TFbLnf>alCL4 z!x0Sjk__|Oc^PM;Weo`$5XZt6m6!y(+|IaO%iIjGR}IpG5~~4l#k!2sJ8l7V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