diff --git a/docs/Linux编译教程.md b/docs/Linux编译教程.md index bc4a9ddd0e..0df085a375 100644 --- a/docs/Linux编译教程.md +++ b/docs/Linux编译教程.md @@ -55,7 +55,13 @@ sudo ldconfig 1. 直接拷贝上面编译的第三方库到 `3rdparty/lib` 或者 手动修改 `CMakeLists.txt` 指定第三方库路径 2. `3rdparty/include/opencv` 中的头文件是 `4.5.3` 版本的,若是使用其他版本,请注意头文件冲突问题(直接将你的 `opencv` 头文件覆盖过去就好) 3. 安装 `adb`, 并修改 `resource/config.json` 中 `Custom`.`adb`.`path` 的值为 `"adb"` -4. 复制资源文件到 `libMeoAssitant.so` 同一目录下,具体可参考 [这个脚本](../tools/update_resource.sh) +4. 复制资源文件到 `libMeoAssitant.so` 同一目录下 + +```sh +cd tools +sh ./update_resource.sh +``` + 5. 通过 [Python 接口](../src/Python/interface.py) 或 [C 接口](../include/AsstCaller.h) 进行调用,需要自行编写少量的代码 6. `cmake` 可通过添加 `-DBUILD_TEST=ON` 选项来编译一个测试小 demo diff --git a/src/MeoAssistant/Assistant.cpp b/src/MeoAssistant/Assistant.cpp index 99bb27b9c1..43caa4bdb0 100644 --- a/src/MeoAssistant/Assistant.cpp +++ b/src/MeoAssistant/Assistant.cpp @@ -37,7 +37,7 @@ Assistant::Assistant(std::string dirname, AsstCallback callback, void* callback_ LogTraceFunction; - bool resource_ret = Resrc.load(m_dirname + "Resource/"); + bool resource_ret = Resrc.load(m_dirname + "resource/"); if (!resource_ret) { const std::string& error = Resrc.get_last_error(); Log.error("resource broken:", error); diff --git a/tools/build_release.bat b/tools/build_release.bat index d00a174d11..e096171266 100644 --- a/tools/build_release.bat +++ b/tools/build_release.bat @@ -1,2 +1 @@ -MSBuild.exe ..\MeoAssistantArknights.sln /p:Configuration=Release /p:Platform=x64 /t:Rebuild -sh zip_release.sh \ No newline at end of file +MSBuild.exe ..\MeoAssistantArknights.sln /p:Configuration=Release /p:Platform=x64 /t:Rebuild \ No newline at end of file diff --git a/tools/update_resource.bat b/tools/update_resource.bat deleted file mode 100644 index e5a7a15fcd..0000000000 --- a/tools/update_resource.bat +++ /dev/null @@ -1,2 +0,0 @@ -xcopy /e /y /i ..\resource ..\x64\RelWithDebInfo\resource -xcopy /e /y /i ..\3rdparty\resource ..\x64\RelWithDebInfo\resource \ No newline at end of file diff --git a/tools/update_resource.sh b/tools/update_resource.sh index 1ae0edd08b..ba06b0b954 100644 --- a/tools/update_resource.sh +++ b/tools/update_resource.sh @@ -1,3 +1,14 @@ -mkdir -p ../build/Resource -cp -r ../resource/* ../build/Resource -cp -r ../3rdparty/resource/* ../build/Resource \ No newline at end of file +#!/bin/sh + +TargetDir="" + +if [ $1 ]; then + TargetDir=$1 +else + echo "Please enter TargetDir" + exit 1 +fi + +mkdir -p $TargetDir +cp -r "../resource/" "../3rdparty/resource/" $TargetDir +exit 0 \ No newline at end of file diff --git a/tools/update_resource_deb.bat b/tools/update_resource_deb.bat new file mode 100644 index 0000000000..11603e2094 --- /dev/null +++ b/tools/update_resource_deb.bat @@ -0,0 +1 @@ +sh ./update_resource.sh ..\x64\RelWithDebInfo \ No newline at end of file diff --git a/tools/update_resource_rel.bat b/tools/update_resource_rel.bat new file mode 100644 index 0000000000..73b4e31715 --- /dev/null +++ b/tools/update_resource_rel.bat @@ -0,0 +1 @@ +sh ./update_resource.sh ..\x64\Release \ No newline at end of file diff --git a/tools/update_resource_release.bat b/tools/update_resource_release.bat deleted file mode 100644 index 309901eb42..0000000000 --- a/tools/update_resource_release.bat +++ /dev/null @@ -1,2 +0,0 @@ -xcopy /e /y /i ..\resource ..\x64\Release\resource -xcopy /e /y /i ..\3rdparty\resource ..\x64\Release\resource \ No newline at end of file diff --git a/tools/zip_release.bat b/tools/zip_release.bat new file mode 100644 index 0000000000..42897f3087 --- /dev/null +++ b/tools/zip_release.bat @@ -0,0 +1 @@ +sh ./zip_release.sh \ No newline at end of file diff --git a/tools/zip_release.sh b/tools/zip_release.sh index 7d78a3e60b..f2f89f262a 100644 --- a/tools/zip_release.sh +++ b/tools/zip_release.sh @@ -1,3 +1,5 @@ +#!/bin/sh + TargetDir="../x64/Release" LatestTag=$(git describe --tags $(git rev-list --tags --max-count=1)) Package="../x64/MeoAssistantArknights_"$LatestTag".zip"