Skip to content

Commit

Permalink
Merge branch 'main' into feat/lhg
Browse files Browse the repository at this point in the history
  • Loading branch information
neko-para committed Feb 28, 2024
2 parents 602b3dc + 63333be commit 0d009fb
Show file tree
Hide file tree
Showing 71 changed files with 4,158 additions and 577 deletions.
25 changes: 2 additions & 23 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
is_release=${{ startsWith(github.ref, 'refs/tags/v') }}
tag=$(git describe --tags --match "v*" ${{ github.ref }} || true)
if [[ $tag != v* ]]; then
tag=$(curl -sX GET "https://api.github.com/repos/MaaAssistantArknights/MaaFramework/releases/latest" --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' | awk '/tag_name/{print $4}' FS='["]')
tag=$(curl -sX GET "https://api.github.com/repos/MaaXYZ/MaaFramework/releases/latest" --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' | awk '/tag_name/{print $4}' FS='["]')
if [[ $tag != v* ]]; then
tag="v0.0.0"
fi
Expand Down Expand Up @@ -81,13 +81,6 @@ jobs:
with:
sdk-version: 22621

# Download host arch tools for Thrift of ThriftControlUnit
- name: Download host tools from MaaDeps
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
python3 tools/maadeps-download.py x64-windows
- name: Bootstrap MaaDeps
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -140,7 +133,7 @@ jobs:
pacman -Sy
pacman -S --noconfirm cmake python ccache ninja git
# https://github.com/MaaAssistantArknights/MaaFramework/actions/runs/5643408179/job/15285186255
# https://github.com/MaaXYZ/MaaFramework/actions/runs/5643408179/job/15285186255
- uses: actions/checkout@v3
with:
submodules: true
Expand All @@ -156,13 +149,6 @@ jobs:
with:
remove_stale_cache: false

# Download host arch tools for Thrift of ThriftControlUnit
- name: Download host tools from MaaDeps
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
python3 tools/maadeps-download.py x64-linux
- name: Bootstrap MaaDeps
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -226,13 +212,6 @@ jobs:
brew install llvm
# 17

# Download host arch tools for Thrift of ThriftControlUnit
- name: Download host tools from MaaDeps
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
python3 tools/maadeps-download.py x64-osx
- name: Bootstrap MaaDeps
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: deploy-docs

on:
push:
tags:
- "v*"
branches:
- "**"
paths:
- ".github/workflows/doc.yml"
- "include/**"
- "Doxyfile"

workflow_dispatch:

jobs:
meta:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Build Doxygen
uses: mattnotmitt/doxygen-action@v1.9.5

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs-gen/html
publish_branch: gh-pages
16 changes: 8 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
is_release=${{ startsWith(github.ref, 'refs/tags/v') }}
tag=$(git describe --tags --match "v*" ${{ github.ref }} || true)
if [[ $tag != v* ]]; then
tag=$(curl -sX GET "https://api.github.com/repos/MaaAssistantArknights/MaaFramework/releases/latest" --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' | awk '/tag_name/{print $4}' FS='["]')
tag=$(curl -sX GET "https://api.github.com/repos/MaaXYZ/MaaFramework/releases/latest" --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' | awk '/tag_name/{print $4}' FS='["]')
if [[ $tag != v* ]]; then
tag="v0.0.0"
fi
Expand Down Expand Up @@ -114,8 +114,8 @@ jobs:
- name: Run Python testing
shell: bash
run: |
python3 -m pip install -r ./source/binding/Python/requirements.txt
python3 ./test/python/binding_test.py
python3 -m pip install -r ./install/binding/Python/requirements.txt
python3 ./test/python/binding_test.py ./install
- uses: actions/upload-artifact@v3
if: always()
Expand Down Expand Up @@ -149,7 +149,7 @@ jobs:
pacman -Sy
pacman -S --noconfirm cmake python python-pip ccache ninja git
# https://github.com/MaaAssistantArknights/MaaFramework/actions/runs/5643408179/job/15285186255
# https://github.com/MaaXYZ/MaaFramework/actions/runs/5643408179/job/15285186255
- uses: actions/checkout@v3
with:
submodules: recursive
Expand Down Expand Up @@ -207,8 +207,8 @@ jobs:
run: |
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install -r ./source/binding/Python/requirements.txt
python3 ./test/python/binding_test.py
python3 -m pip install -r ./install/binding/Python/requirements.txt
python3 ./test/python/binding_test.py ./install
- uses: actions/upload-artifact@v3
if: always()
Expand Down Expand Up @@ -288,8 +288,8 @@ jobs:
- name: Run Python testing
shell: bash
run: |
python3 -m pip install -r ./source/binding/Python/requirements.txt
python3 ./test/python/binding_test.py
python3 -m pip install -r ./install/binding/Python/requirements.txt
python3 ./test/python/binding_test.py ./install
- uses: actions/upload-artifact@v3
if: always()
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# docs
docs/node_modules
docs/.vuepress/.temp
docs-gen
# Prerequisites
*.d

Expand Down
9 changes: 6 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
[submodule "3rdparty/MaaDeps"]
path = 3rdparty/MaaDeps
url = https://github.com/MaaAssistantArknights/MaaDeps
url = https://github.com/MaaXYZ/MaaDeps
[submodule "3rdparty/MaaAgentBinary"]
path = 3rdparty/MaaAgentBinary
url = https://github.com/MaaAssistantArknights/MaaAgentBinary
url = https://github.com/MaaXYZ/MaaAgentBinary
[submodule "test/TestingDataSet"]
path = test/TestingDataSet
url = https://github.com/MaaAssistantArknights/MaaFrameworkTesting.git
url = https://github.com/MaaXYZ/MaaFrameworkTesting.git
[submodule "source/binding/Rust"]
path = source/binding/Rust
url = https://github.com/MaaXYZ/maa-framework-rs.git
[submodule "source/MaaHttp/LHG"]
path = source/MaaHttp/LHG
url = https://github.com/neko-para/LibHttpGen
5 changes: 5 additions & 0 deletions 3rdparty/include/meojson/common/array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ class basic_array

basic_array<string_t>& operator=(const basic_array<string_t>&) = default;
basic_array<string_t>& operator=(basic_array<string_t>&&) noexcept = default;
template <typename value_t, std::enable_if_t<std::is_convertible_v<value_t, basic_array<string_t>>, bool> = true>
basic_array<string_t>& operator=(value_t rhs)
{
return *this = basic_array<string_t>(std::move(rhs));
}

bool operator==(const basic_array<string_t>& rhs) const;
bool operator!=(const basic_array<string_t>& rhs) const { return !(*this == rhs); }
Expand Down
5 changes: 5 additions & 0 deletions 3rdparty/include/meojson/common/object.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ class basic_object

basic_object<string_t>& operator=(const basic_object<string_t>&) = default;
basic_object<string_t>& operator=(basic_object<string_t>&&) = default;
template <typename value_t, std::enable_if_t<std::is_convertible_v<value_t, basic_object<string_t>>, bool> = true>
basic_object<string_t>& operator=(value_t rhs)
{
return *this = basic_object<string_t>(std::move(rhs));
}

bool operator==(const basic_object<string_t>& rhs) const;
bool operator!=(const basic_object<string_t>& rhs) const { return !(*this == rhs); }
Expand Down
7 changes: 1 addition & 6 deletions 3rdparty/include/meojson/common/value.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,7 @@ class basic_value
basic_value<string_t>& operator=(const basic_value<string_t>& rhs);
basic_value<string_t>& operator=(basic_value<string_t>&&) noexcept;
template <typename value_t, std::enable_if_t<std::is_convertible_v<value_t, basic_value<string_t>>, bool> = true>
basic_value<string_t>& operator=(const value_t& rhs)
{
return *this = basic_value<string_t>(rhs);
}
template <typename value_t, std::enable_if_t<std::is_convertible_v<value_t, basic_value<string_t>>, bool> = true>
basic_value<string_t>& operator=(value_t&& rhs)
basic_value<string_t>& operator=(value_t rhs)
{
return *this = basic_value<string_t>(std::move(rhs));
}
Expand Down
20 changes: 12 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/modules")
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set(CMAKE_MAP_IMPORTED_CONFIG_DebWithRelDeps "DebWithRelDeps;Release;")

set(Boost_NO_WARN_NEW_VERSIONS 1)
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
set(Boost_NO_WARN_NEW_VERSIONS ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

option(USE_MAADEPS "use third-party libraries built by MaaDeps" ON)

option(WITH_ADB_CONTROLLER "build with adb controller" ON)
option(WITH_THRIFT_CONTROLLER "build with thrift controller" ON)
option(WITH_DBG_CONTROLLER "build with debugging controller" ON)
option(WITH_WIN32_CONTROLLER "build with win32 controller" ON)
option(WITH_DBG_CONTROLLER "build with debugging controller" ON)
option(WITH_THRIFT_CONTROLLER "build with thrift controller" OFF)

option(WITH_GRPC "build with protobuf and grpc" OFF)

Expand Down Expand Up @@ -44,22 +44,21 @@ if(NOT WITH_GRPC)
set(BUILD_GRPC_CLI OFF)
set(BUILD_GRPC_TESTING OFF)
endif()

if(NOT WITH_DBG_CONTROLLER)
message(STATUS "Dbg controller is disabled, disable BUILD_PIPELINE_TESTING")
set(BUILD_PIPELINE_TESTING OFF)
endif()

if(WITH_WIN32_CONTROLLER AND NOT WIN32)
message(STATUS "Not on Windows, disable WITH_WIN32_CONTROLLER")
set(WITH_WIN32_CONTROLLER OFF)
endif()
if(WITH_THRIFT_CONTROLLER AND MAA_CROSSCOMPILE)
message(STATUS "Cross-compiling, disable WITH_THRIFT_CONTROLLER")
set(WITH_THRIFT_CONTROLLER OFF)
endif()

if(WITH_THRIFT_CONTROLLER)
include(${PROJECT_SOURCE_DIR}/cmake/thrift-gen.cmake)
endif()

if(WITH_GRPC)
include(${PROJECT_SOURCE_DIR}/cmake/grpc-gen.cmake)
endif()
Expand All @@ -69,9 +68,11 @@ find_package(Boost REQUIRED COMPONENTS system)
find_package(ZLIB REQUIRED)
find_package(fastdeploy_ppocr REQUIRED)
find_package(ONNXRuntime)

if(WITH_THRIFT_CONTROLLER)
find_package(Thrift CONFIG REQUIRED)
endif()

if(WITH_GRPC)
find_package(protobuf CONFIG REQUIRED)
find_package(gRPC CONFIG REQUIRED)
Expand All @@ -84,13 +85,16 @@ add_subdirectory(tools)
if(BUILD_SAMPLE)
add_subdirectory(sample/cpp)
endif()

if(BUILD_PIPELINE_TESTING)
add_subdirectory(test/pipeline)
add_subdirectory(test/TestingDataSet)
endif()

if(BUILD_GRPC_TESTING)
add_subdirectory(test/grpc)
endif()

if(BUILD_DLOPEN_TESTING)
add_subdirectory(test/dlopen)
endif()
Expand Down
Loading

0 comments on commit 0d009fb

Please sign in to comment.