diff --git a/.github/workflows/maa-dev-build.yaml b/.github/workflows/maa-dev-build.yaml new file mode 100644 index 0000000000..aa321e67d0 --- /dev/null +++ b/.github/workflows/maa-dev-build.yaml @@ -0,0 +1,61 @@ +name: "Maa Dev Build" + +on: + push: + branches: + - dev + paths: + - src/MeoAssistant/** + - src/MeoAssistantBuilder/** + - src/MeoAsstGui/** + - 3rdparty/** + - include/** + - MeoAssistantArknights.sln + pull_request: + paths: + - src/MeoAssistant/** + - src/MeoAssistantBuilder/** + - src/MeoAsstGui/** + - 3rdparty/** + - include/** + - MeoAssistantArknights.sln + workflow_dispatch: + +jobs: + build: + + runs-on: windows-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup .NET 6.0.x + uses: actions/setup-dotnet@v2 + with: + dotnet-version: 6.0.x + + - name: Run dev build task + run: pwsh .\build.ps1 DevBuild + + - name: Read file name + id: read_path + run: pwsh .\read_path.ps1 ./artifacts MaaBundle* + + - name: Upload Artifacts 0 + uses: actions/upload-artifact@v3 + with: + name: ${{ steps.read_path.outputs.name_0 }} + path: ${{ steps.read_path.outputs.path_0 }} + + - name: Upload Artifacts 1 + uses: actions/upload-artifact@v3 + with: + name: ${{ steps.read_path.outputs.name_1 }} + path: ${{ steps.read_path.outputs.path_1 }} + + - name: Upload Artifacts 2 + uses: actions/upload-artifact@v3 + with: + name: ${{ steps.read_path.outputs.name_2 }} + path: ${{ steps.read_path.outputs.path_2 }} diff --git a/.github/workflows/maa-doc-azure-deploy.yaml b/.github/workflows/maa-doc-azure-deploy.yaml index f71103aa47..83b47e6832 100644 --- a/.github/workflows/maa-doc-azure-deploy.yaml +++ b/.github/workflows/maa-doc-azure-deploy.yaml @@ -1,30 +1,30 @@ -name: Azure Static Web Apps CI/CD - -on: - push: - branches: - - master - paths: - - "docs/*" - -jobs: - build_and_deploy: - runs-on: ubuntu-latest - name: Build and Deploy Job - if: github.repository_owner == 'MaaAssistantArknights' - steps: - - uses: actions/checkout@v2 - with: - submodules: true - - name: Build And Deploy - id: builddeploy - uses: Azure/static-web-apps-deploy@v1 - with: - azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_GENTLE_DESERT_00290F400 }} - repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments) - action: "upload" - ###### Repository/Build Configurations - These values can be configured to match your app requirements. ###### - # For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig - app_location: "/docs" # App source code path - api_location: "" # Api source code path - optional - output_location: ".vuepress/dist" # Built app content directory - optional +name: Deploy Docs + +on: + push: + branches: + - master + paths: + - "docs/*" + workflow_dispatch: + +jobs: + build_and_deploy: + runs-on: ubuntu-latest + name: Build and Deploy Job + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - name: Build And Deploy + id: builddeploy + uses: Azure/static-web-apps-deploy@v1 + with: + azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_GENTLE_DESERT_00290F400 }} + repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments) + action: "upload" + ###### Repository/Build Configurations - These values can be configured to match your app requirements. ###### + # For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig + app_location: "/docs" # App source code path + api_location: "" # Api source code path - optional + output_location: ".vuepress/dist" # Built app content directory - optional diff --git a/.github/workflows/maa-release-bundle.yaml b/.github/workflows/maa-release-bundle.yaml new file mode 100644 index 0000000000..eb25aaa7f0 --- /dev/null +++ b/.github/workflows/maa-release-bundle.yaml @@ -0,0 +1,45 @@ +name: Release MaaBundle + +on: + release: + types: + - published + +jobs: + + release-bundle: + + runs-on: windows-latest + + steps: + + - name: Checkout + uses: actions/checkout@v3 + + - name: Get tag + id: tag + uses: dawidd6/action-get-tag@v1 + + - name: Setup .NET 6.0.x + uses: actions/setup-dotnet@v2 + with: + dotnet-version: 6.0.x + + - name: Run release core task + run: pwsh .\build.ps1 ReleaseBundle + + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: MaaBundle-${{ steps.tag.outputs.tag }} + path: ./artifacts/MaaBundle* + + - name: Upload release assets + uses: xresloader/upload-to-github-release@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + file: ./artifacts/MaaBundle* + tags: true + draft: false + verbose: true diff --git a/.github/workflows/maa-release-core.yaml b/.github/workflows/maa-release-core.yaml new file mode 100644 index 0000000000..c8735c956f --- /dev/null +++ b/.github/workflows/maa-release-core.yaml @@ -0,0 +1,45 @@ +name: Release MaaCore + +on: + release: + types: + - published + +jobs: + + release-core: + + runs-on: windows-latest + + steps: + + - name: Checkout + uses: actions/checkout@v3 + + - name: Get tag + id: tag + uses: dawidd6/action-get-tag@v1 + + - name: Setup .NET 6.0.x + uses: actions/setup-dotnet@v2 + with: + dotnet-version: 6.0.x + + - name: Run release core task + run: pwsh .\build.ps1 ReleaseCore + + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: MaaCore-${{ steps.tag.outputs.tag }} + path: ./artifacts/MaaCore* + + - name: Upload release assets + uses: xresloader/upload-to-github-release@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + file: ./artifacts/MaaCore* + tags: true + draft: false + verbose: true diff --git a/.github/workflows/maa-release-resource.yaml b/.github/workflows/maa-release-resource.yaml new file mode 100644 index 0000000000..d68e94c4da --- /dev/null +++ b/.github/workflows/maa-release-resource.yaml @@ -0,0 +1,39 @@ +name: Release MaaResource + +on: + push: + branches: + - master + paths: + - resource/** + - 3rdparty/resource/** + workflow_dispatch: + +jobs: + + release-resource: + + runs-on: windows-latest + + steps: + + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup .NET 6.0.x + uses: actions/setup-dotnet@v2 + with: + dotnet-version: 6.0.x + + - name: Run release resource task + run: pwsh .\build.ps1 ReleaseResource + + - name: Read file name + id: read_path + run: pwsh .\read_path.ps1 ./artifacts MaaResource* + + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: ${{ steps.read_path.outputs.name_0 }} + path: ${{ steps.read_path.outputs.path_0 }} diff --git a/.github/workflows/maa-release-wpf.yaml b/.github/workflows/maa-release-wpf.yaml new file mode 100644 index 0000000000..6dadea0963 --- /dev/null +++ b/.github/workflows/maa-release-wpf.yaml @@ -0,0 +1,38 @@ +name: Release MaaWpf + +on: + push: + branches: + - master + paths: + - src/MeoAsstGui/** + workflow_dispatch: + +jobs: + + release-wpf: + + runs-on: windows-latest + + steps: + + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup .NET 6.0.x + uses: actions/setup-dotnet@v2 + with: + dotnet-version: 6.0.x + + - name: Run release wpf task + run: pwsh .\build.ps1 ReleaseWpf + + - name: Read file name + id: read_path + run: pwsh .\read_path.ps1 ./artifacts MaaWpf* + + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: ${{ steps.read_path.outputs.name_0 }} + path: ${{ steps.read_path.outputs.path_0 }} diff --git a/.gitignore b/.gitignore index b3f724fcad..77f946f4f5 100644 --- a/.gitignore +++ b/.gitignore @@ -435,3 +435,5 @@ screen.png adb_screen.png tools/**/*.png resource/infrast +.vscode +!3rdparty/tools/* diff --git a/3rdparty/include/penguin-stats-recognize/depot.hpp b/3rdparty/include/penguin-stats-recognize/depot.hpp index b2ab6b3c59..6e7d46798e 100644 --- a/3rdparty/include/penguin-stats-recognize/depot.hpp +++ b/3rdparty/include/penguin-stats-recognize/depot.hpp @@ -158,4 +158,4 @@ private: }; } // namespace penguin -#endif // PENGUIN_DEPOT_HPP_ +#endif // PENGUIN_DEPOT_HPP_ \ No newline at end of file diff --git a/3rdparty/include/penguin-stats-recognize/recognize.hpp b/3rdparty/include/penguin-stats-recognize/recognize.hpp index bd0327d908..e8e0acec3a 100644 --- a/3rdparty/include/penguin-stats-recognize/recognize.hpp +++ b/3rdparty/include/penguin-stats-recognize/recognize.hpp @@ -15,6 +15,7 @@ using dict = nlohmann::ordered_json; namespace penguin { + enum class StatusFlags { NORMAL = 0, @@ -842,9 +843,11 @@ private: } void _get_quantity() { - cv::Rect quantityrect = cv::Rect(0, static_cast(round(height * _ITEM_QTY_Y_PROP)), - static_cast(round(width * _ITEM_QTY_WIDTH_PROP)), - static_cast(round(height * _ITEM_QTY_HEIGHT_PROP))); + cv::Rect quantityrect = + cv::Rect(0, + static_cast(round(height * _ITEM_QTY_Y_PROP)), + static_cast(round(width * _ITEM_QTY_WIDTH_PROP)), + static_cast(round(height * _ITEM_QTY_HEIGHT_PROP))); cv::Mat quantityimg = _img(quantityrect); _quantity.set_img(quantityimg); _quantity.analyze(); diff --git a/3rdparty/include/penguin-stats-recognize/recognizer.hpp b/3rdparty/include/penguin-stats-recognize/recognizer.hpp index 070664a2c2..1ec99ff572 100644 --- a/3rdparty/include/penguin-stats-recognize/recognizer.hpp +++ b/3rdparty/include/penguin-stats-recognize/recognizer.hpp @@ -18,7 +18,13 @@ #include "depot.hpp" #include "result.hpp" -static const std::string version = "4.2.3"; +#ifdef PENGUIN_RECOGNIZER_RELEASE_VERSION +#define PENGUIN_RECOGNIZER_VERSION_STRING PENGUIN_RECOGNIZER_RELEASE_VERSION +#else +#define PENGUIN_RECOGNIZER_VERSION_STRING "v0.0.0" +#endif + +static const std::string version = PENGUIN_RECOGNIZER_VERSION_STRING; static const std::string opencv_version = CV_VERSION; cv::Mat decode(std::string JSarrayBuffer) diff --git a/3rdparty/include/penguin-stats-recognize/result.hpp b/3rdparty/include/penguin-stats-recognize/result.hpp index 0d9a639550..ae40bbbeb7 100644 --- a/3rdparty/include/penguin-stats-recognize/result.hpp +++ b/3rdparty/include/penguin-stats-recognize/result.hpp @@ -31,7 +31,7 @@ const double DROP_AREA_X_PROP = 0.21; const double DROP_AREA_Y_PROP = 0.2; const double DROP_AREA_HEIGHT_PROP = 0.8; const double ITEM_DIAMETER_PROP = 0.524; -const double W_H_PROP = 7; +const double W_H_PROP = 6.5; enum DroptypeFlags { @@ -201,7 +201,7 @@ public: } private: - size_t _stars = 0; + int _stars = 0; void _get_is_3stars() { auto& self = *this; @@ -232,7 +232,7 @@ private: star_rect.width = sp.back().end - star_rect.x; _img = star_img = star_img(star_rect); self._relate(star_rect.tl()); - _stars = sp.size(); + _stars = static_cast(sp.size()); } }; @@ -612,7 +612,7 @@ private: { continue; } - int dist = static_cast(abs(kh - hsv[H])); + int dist = static_cast(round(abs(kh - hsv[H]))); _candidates.emplace_back(vtype, dist); } std::sort(_candidates.begin(), _candidates.end(), @@ -751,11 +751,23 @@ public: const int items_count() const { return _items_count; } Widget_Droptype() = default; Widget_Droptype(const cv::Mat& img, const std::string& label, Widget* const parent_widget = nullptr) - : WidgetWithCandidate(img, label, parent_widget) {} + : WidgetWithCandidate(label, parent_widget) + { + set_img(img); + } + void set_img(const cv::Mat& img) + { + cv::Mat img_bin = img; + cv::cvtColor(img_bin, img_bin, cv::COLOR_BGR2GRAY); + cv::threshold(img_bin, img_bin, 127, 255, cv::THRESH_BINARY); + int bottom = separate(img_bin, DirectionFlags::BOTTOM, 1)[0].end; + Widget::set_img(img(cv::Rect(0, 0, img.cols, bottom))); + } Widget_Droptype& analyze() { if (!_img.empty()) { + _get_items_count(); _get_candidates(); } if (const auto type = droptype(); @@ -790,7 +802,7 @@ public: } private: - int _items_count = static_cast(round(width / (height * W_H_PROP))); + int _items_count = 0; Widget_DroptypeLine _line {this}; Widget_DroptypeText _text {this}; void _get_candidates() @@ -809,6 +821,10 @@ private: _candidates = _text.candidates(); } } + void _get_items_count() + { + _items_count = static_cast(round(width / (height * W_H_PROP))); + } }; class Widget_DropArea : public Widget @@ -827,8 +843,7 @@ public: : Widget("dropArea", parent_widget) {} Widget_DropArea(const cv::Mat& img, Widget* const parent_widget = nullptr) : Widget(img, "dropArea", parent_widget) {} - Widget_DropArea& analyze(const std::string& stage, - const std::string& difficulty) + Widget_DropArea& analyze(const std::string& stage) { if (!_img.empty()) { @@ -849,7 +864,7 @@ public: widget_label = "droptypes"; push_exception(ERROR, ExcSubtypeFlags::EXC_ILLEGAL); } - _get_drops(stage, difficulty); + _get_drops(stage); } else { @@ -995,7 +1010,7 @@ private: _droptype_list = q.top(); } - void _get_drops(const std::string& stage, [[maybe_unused]] const std::string& difficulty) + void _get_drops(const std::string& stage) { if (_status == StatusFlags::HAS_ERROR || _status == StatusFlags::ERROR) { @@ -1015,10 +1030,10 @@ private: { continue; } - else if (std::string label = - "drops." + std::to_string(_drop_list.size()); - type == DroptypeFlags::FURNITURE) + else if (type == DroptypeFlags::FURNITURE) { + std::string label = + "drops." + std::to_string(_drop_list.size()); _drop_list.emplace_back( Drop(Widget_Item(FURNI_1, label, this), type)); } @@ -1034,13 +1049,13 @@ private: int length = (droptype.width) / items_count; for (int i = 0; i < items_count; i++) { - std::string cur_label = + std::string label = "drops." + std::to_string(_drop_list.size()); auto range = cv::Range(droptype.x - x + length * i, droptype.x - x + length * (i + 1)); auto dropimg = _img(cv::Range(0, droptype.y - y), range); - Widget_Item drop {dropimg, item_diameter, cur_label, this}; + Widget_Item drop {dropimg, item_diameter, label, this}; drop.analyze(templs); _drop_list.emplace_back(drop, type); _drops_data.push_back({{"dropType", Droptype2Str[type]}, @@ -1216,10 +1231,10 @@ private: } const auto& bv = _baseline_v; auto drop_area_img = _img( - cv::Range(static_cast(bv.y + bv.height * DROP_AREA_Y_PROP), bv.y + bv.height), - cv::Range(static_cast(bv.x + bv.height * DROP_AREA_X_PROP), width)); + cv::Range(bv.y + static_cast(bv.height * DROP_AREA_Y_PROP), bv.y + bv.height), + cv::Range(bv.x + static_cast(bv.height * DROP_AREA_X_PROP), width)); _drop_area.set_img(drop_area_img); - _drop_area.analyze(_stage.stage_code(), "NORMAL"); + _drop_area.analyze(_stage.stage_code()); } }; @@ -1285,11 +1300,10 @@ private: { return; } - cv::Mat img_bin = _img(cv::Rect( - 0, - static_cast(0.2 * height), - static_cast(0.2 * width), - static_cast(0.4 * height))); + cv::Mat img_bin = _img(cv::Rect(0, + static_cast(0.2 * height), + static_cast(0.2 * width), + static_cast(0.4 * height))); cv::cvtColor(img_bin, img_bin, cv::COLOR_BGR2GRAY); cv::threshold(img_bin, img_bin, 120, 255, cv::THRESH_BINARY); @@ -1309,8 +1323,9 @@ private: abs(img_temp.cols - last_height) <= 1 && abs(first_height - last_height) <= 1) { - baseline_v_rect = cv::Rect(range.start, sp2.front().start + static_cast(0.2 * height), - img_temp.cols, sp2.back().end - sp2.front().start); + baseline_v_rect = + cv::Rect(range.start, sp2.front().start + static_cast(0.2 * height), + img_temp.cols, sp2.back().end - sp2.front().start); break; } } @@ -1336,11 +1351,10 @@ private: : x(x_), y(y_), width(width_), height(height_), area(area_) {} }; - cv::Mat img_bin = _img(cv::Rect( - 0, - static_cast(0.2 * height), - static_cast(0.2 * width), - static_cast(0.4 * height))); + cv::Mat img_bin = _img(cv::Rect(0, + static_cast(0.2 * height), + static_cast(0.2 * width), + static_cast(0.4 * height))); cv::cvtColor(img_bin, img_bin, cv::COLOR_BGR2GRAY); cv::threshold(img_bin, img_bin, 120, 255, cv::THRESH_BINARY); cv::Mat _; @@ -1381,10 +1395,11 @@ private: { if (ccomps[0].x == ccomps[1].x) { - baseline_v_rect = cv::Rect(ccomps[0].x, - ccomps[0].y + static_cast(0.2 * height), - ccomps[0].width, - ccomps[1].y - ccomps[0].y + ccomps[1].height); + baseline_v_rect = + cv::Rect(ccomps[0].x, + ccomps[0].y + static_cast(0.2 * height), + ccomps[0].width, + ccomps[1].y - ccomps[0].y + ccomps[1].height); } } else if (const auto ccsize = ccomps.size(); @@ -1393,10 +1408,11 @@ private: for (int i = 0; i < ccsize - 1; ++i) { if (ccomps[i].x == ccomps[i + 1].x) - baseline_v_rect = cv::Rect(ccomps[i].x, - ccomps[i].y + static_cast(0.2 * height), - ccomps[i].width, - ccomps[i + 1].y - ccomps[i].y + ccomps[i + 1].height); + baseline_v_rect = + cv::Rect(ccomps[i].x, + ccomps[i].y + static_cast(0.2 * height), + ccomps[i].width, + ccomps[i + 1].y - ccomps[i].y + ccomps[i + 1].height); } } @@ -1420,8 +1436,9 @@ private: } const auto& bv = _baseline_v; int left_margin = bv.x + bv.width; - auto result_img = _img(cv::Range(bv.y, bv.y + bv.height / 2), - cv::Range(left_margin, static_cast(left_margin + 1.5 * bv.height))); + auto result_img = + _img(cv::Range(bv.y, bv.y + bv.height / 2), + cv::Range(left_margin, left_margin + static_cast(1.5 * bv.height))); cv::Mat img_bin; cv::cvtColor(result_img, img_bin, cv::COLOR_BGR2GRAY); cv::threshold(img_bin, img_bin, 200, 255, cv::THRESH_BINARY); @@ -1438,8 +1455,9 @@ private: } const auto& bv = _baseline_v; int left_margin = bv.x + bv.width; - auto star_img = _img(cv::Range(bv.y + bv.height / 2, bv.y + bv.height), - cv::Range(left_margin, static_cast(left_margin + 1.2 * bv.height))); + auto star_img = + _img(cv::Range(bv.y + bv.height / 2, bv.y + bv.height), + cv::Range(left_margin, left_margin + static_cast(1.2 * bv.height))); cv::Mat img_bin; cv::cvtColor(star_img, img_bin, cv::COLOR_BGR2GRAY); cv::threshold(img_bin, img_bin, 127, 255, cv::THRESH_BINARY); @@ -1456,9 +1474,10 @@ private: } const auto& bv = _baseline_v; int left_margin = bv.x + bv.width; - auto stage_img = _img(cv::Range(0, bv.y), - cv::Range(static_cast(left_margin + 0.43 * bv.height), - static_cast(left_margin + 1.5 * bv.height))); + auto stage_img = + _img(cv::Range(0, bv.y), + cv::Range(left_margin + static_cast(0.43 * bv.height), + left_margin + static_cast(1.5 * bv.height))); cv::Mat img_bin; cv::cvtColor(stage_img, img_bin, cv::COLOR_BGR2GRAY); cv::threshold(img_bin, img_bin, 200, 255, cv::THRESH_BINARY); @@ -1475,8 +1494,9 @@ private: } const auto& bv = _baseline_v; int left_margin = bv.x + bv.width; - auto diff_img = _img(cv::Range(0, bv.y), - cv::Range(left_margin, static_cast(left_margin + 0.43 * bv.height))); + auto diff_img = + _img(cv::Range(0, bv.y), + cv::Range(left_margin, left_margin + static_cast(0.43 * bv.height))); cv::Mat img_bin; cv::cvtColor(diff_img, img_bin, cv::COLOR_BGR2GRAY); cv::threshold(img_bin, img_bin, 64, 255, cv::THRESH_BINARY); @@ -1492,19 +1512,22 @@ private: return; } const auto& bv = _baseline_v; - cv::Mat img_bin = _img(cv::Range(bv.y + bv.height, height), - cv::Range(bv.x + bv.width, static_cast(0.2 * width))); + cv::Mat img_bin = + _img(cv::Range(bv.y + bv.height, height), + cv::Range(bv.x + bv.width, static_cast(0.2 * width))); cv::cvtColor(img_bin, img_bin, cv::COLOR_BGR2GRAY); cv::threshold(img_bin, img_bin, 127, 255, cv::THRESH_BINARY); auto sp = separate(img_bin, DirectionFlags::TOP, 2); int top_margin = bv.y + bv.height + sp[1].start; auto drop_area_img = _img( - cv::Range(top_margin + static_cast(bv.height * DROP_AREA_Y_PROP), top_margin + bv.height), + cv::Range(top_margin + static_cast(bv.height * DROP_AREA_Y_PROP), + top_margin + bv.height), cv::Range(bv.x + bv.width, width)); _drop_area.set_img(drop_area_img); - _drop_area.analyze(_stage.stage_code(), _difficutly.difficulty()); + _drop_area.analyze(_stage.stage_code()); } }; + } // namespace penguin #endif // PENGUIN_RESULT_HPP_ diff --git a/MeoAssistantArknights.sln b/MeoAssistantArknights.sln index 04bd634b6e..a2deaf4e91 100644 --- a/MeoAssistantArknights.sln +++ b/MeoAssistantArknights.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 -VisualStudioVersion = 17.1.32228.430 +VisualStudioVersion = 17.1.32414.318 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{6C4B8D52-51D1-45F8-AAEC-808035443FD6}" EndProject @@ -10,6 +10,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestCaller", "tools\TestCal {362D1E30-F5AE-4279-9985-65C27B3BA300} = {362D1E30-F5AE-4279-9985-65C27B3BA300} EndProjectSection EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MeoAsstGui", "src\MeoAsstGui\MeoAsstGui.csproj", "{FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}" +EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TransparentImageCvt", "tools\TransparentImageCvt\TransparentImageCvt.vcxproj", "{093A3174-A27E-4D23-B64E-16F9448AD5AC}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MeoAssistant", "src\MeoAssistant\MeoAssistant.vcxproj", "{362D1E30-F5AE-4279-9985-65C27B3BA300}" @@ -19,36 +21,52 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution .editorconfig = .editorconfig EndProjectSection EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MeoAssistantBuilder", "src\MeoAssistantBuilder\MeoAssistantBuilder.csproj", "{8D9036DD-75F1-4BD0-89E2-DFB37B925DA3}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution + CICD|x64 = CICD|x64 + Debug|x64 = Debug|x64 Release|x64 = Release|x64 - Release|x86 = Release|x86 RelWithDebInfo|x64 = RelWithDebInfo|x64 - RelWithDebInfo|x86 = RelWithDebInfo|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {63B4F1A2-291C-4C85-91E1-A1F6DAE30D64}.CICD|x64.ActiveCfg = RelWithDebInfo|x64 + {63B4F1A2-291C-4C85-91E1-A1F6DAE30D64}.CICD|x64.Build.0 = RelWithDebInfo|x64 + {63B4F1A2-291C-4C85-91E1-A1F6DAE30D64}.Debug|x64.ActiveCfg = RelWithDebInfo|x64 + {63B4F1A2-291C-4C85-91E1-A1F6DAE30D64}.Debug|x64.Build.0 = RelWithDebInfo|x64 {63B4F1A2-291C-4C85-91E1-A1F6DAE30D64}.Release|x64.ActiveCfg = Release|x64 {63B4F1A2-291C-4C85-91E1-A1F6DAE30D64}.Release|x64.Build.0 = Release|x64 - {63B4F1A2-291C-4C85-91E1-A1F6DAE30D64}.Release|x86.ActiveCfg = Release|x64 {63B4F1A2-291C-4C85-91E1-A1F6DAE30D64}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 {63B4F1A2-291C-4C85-91E1-A1F6DAE30D64}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 - {63B4F1A2-291C-4C85-91E1-A1F6DAE30D64}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|x64 + {FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.CICD|x64.ActiveCfg = CICD|x64 + {FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.CICD|x64.Build.0 = CICD|x64 + {FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.Debug|x64.ActiveCfg = Release|x64 + {FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.Release|x64.ActiveCfg = Release|x64 + {FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.Release|x64.Build.0 = Release|x64 + {FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {093A3174-A27E-4D23-B64E-16F9448AD5AC}.CICD|x64.ActiveCfg = Release|x64 + {093A3174-A27E-4D23-B64E-16F9448AD5AC}.CICD|x64.Build.0 = Release|x64 + {093A3174-A27E-4D23-B64E-16F9448AD5AC}.Debug|x64.ActiveCfg = Release|x64 + {093A3174-A27E-4D23-B64E-16F9448AD5AC}.Debug|x64.Build.0 = Release|x64 {093A3174-A27E-4D23-B64E-16F9448AD5AC}.Release|x64.ActiveCfg = Release|x64 {093A3174-A27E-4D23-B64E-16F9448AD5AC}.Release|x64.Build.0 = Release|x64 - {093A3174-A27E-4D23-B64E-16F9448AD5AC}.Release|x86.ActiveCfg = Release|Win32 - {093A3174-A27E-4D23-B64E-16F9448AD5AC}.Release|x86.Build.0 = Release|Win32 {093A3174-A27E-4D23-B64E-16F9448AD5AC}.RelWithDebInfo|x64.ActiveCfg = Release|x64 {093A3174-A27E-4D23-B64E-16F9448AD5AC}.RelWithDebInfo|x64.Build.0 = Release|x64 - {093A3174-A27E-4D23-B64E-16F9448AD5AC}.RelWithDebInfo|x86.ActiveCfg = Release|Win32 - {093A3174-A27E-4D23-B64E-16F9448AD5AC}.RelWithDebInfo|x86.Build.0 = Release|Win32 + {362D1E30-F5AE-4279-9985-65C27B3BA300}.CICD|x64.ActiveCfg = CICD|x64 + {362D1E30-F5AE-4279-9985-65C27B3BA300}.CICD|x64.Build.0 = CICD|x64 + {362D1E30-F5AE-4279-9985-65C27B3BA300}.Debug|x64.ActiveCfg = RelWithDebInfo|x64 + {362D1E30-F5AE-4279-9985-65C27B3BA300}.Debug|x64.Build.0 = RelWithDebInfo|x64 {362D1E30-F5AE-4279-9985-65C27B3BA300}.Release|x64.ActiveCfg = Release|x64 {362D1E30-F5AE-4279-9985-65C27B3BA300}.Release|x64.Build.0 = Release|x64 - {362D1E30-F5AE-4279-9985-65C27B3BA300}.Release|x86.ActiveCfg = Release|x64 - {362D1E30-F5AE-4279-9985-65C27B3BA300}.Release|x86.Build.0 = Release|x64 {362D1E30-F5AE-4279-9985-65C27B3BA300}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 {362D1E30-F5AE-4279-9985-65C27B3BA300}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 - {362D1E30-F5AE-4279-9985-65C27B3BA300}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|x64 - {362D1E30-F5AE-4279-9985-65C27B3BA300}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|x64 + {8D9036DD-75F1-4BD0-89E2-DFB37B925DA3}.CICD|x64.ActiveCfg = Release|x64 + {8D9036DD-75F1-4BD0-89E2-DFB37B925DA3}.CICD|x64.Build.0 = Release|x64 + {8D9036DD-75F1-4BD0-89E2-DFB37B925DA3}.Debug|x64.ActiveCfg = Debug|x64 + {8D9036DD-75F1-4BD0-89E2-DFB37B925DA3}.Release|x64.ActiveCfg = Release|x64 + {8D9036DD-75F1-4BD0-89E2-DFB37B925DA3}.Release|x64.Build.0 = Release|x64 + {8D9036DD-75F1-4BD0-89E2-DFB37B925DA3}.RelWithDebInfo|x64.ActiveCfg = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/build.ps1 b/build.ps1 new file mode 100644 index 0000000000..ee59fbc4fe --- /dev/null +++ b/build.ps1 @@ -0,0 +1,16 @@ +if ($args.Length -ne 1) { + throw "One argument required" +} + +$target = $args[0] +$valid_targets = @("ReleaseCore", "ReleaseWpf", "ReleaseResource", "ReleaseBundle", "DevBuild") + +if (!$valid_targets.Contains($target)) { + throw "$target is not a valid target" +} + +Set-Location -Path .\src\MeoAssistantBuilder + +dotnet run -- --target $target + +Set-Location -Path ..\..\ diff --git a/docs/模拟器支持.md b/docs/模拟器支持.md index 506a0f41c7..8c9efc2a16 100644 --- a/docs/模拟器支持.md +++ b/docs/模拟器支持.md @@ -53,7 +53,7 @@ ### Win11 WSA -不支持。WSA 目前没有实现 AOSP screencap 需要的接口,无法进行截图。等微软支持后会尝试适配 +勉强支持。但 WSA 的截图经常莫名其妙截出来一个白屏,导致识别异常,不推荐使用 ### AVD diff --git a/read_path.ps1 b/read_path.ps1 new file mode 100644 index 0000000000..6cfb1aaf0e --- /dev/null +++ b/read_path.ps1 @@ -0,0 +1,16 @@ +if ($args.Length -ne 2) { + throw "Need two arguments" +} + +$fs = Get-ChildItem -Path $args[0] -Filter $args[1] + +$index = 0 +foreach($f in $fs) { + + $name = $f.Name + $path = $f.FullName + Write-Output "::set-output name=name_$index::$name" + Write-Output "::set-output name=path_$index::$path" + + $index = $index + 1 +} diff --git a/resource/tasks.json b/resource/tasks.json index 727bac7e1d..2c413ed145 100644 --- a/resource/tasks.json +++ b/resource/tasks.json @@ -1737,6 +1737,205 @@ "RecruitNowConfirm" ] }, + "ActivitiesBegin": { + "algorithm": "justreturn", + "action": "doNothing", + "next": [ + "ReturnToActivities", + "MiningActivities", + "RecruitingActivities" + ] + }, + "ReturnToActivities": { + "template": "Return.png", + "action": "clickSelf", + "roi": [ + 0, + 0, + 180, + 80 + ], + "next": [ + "ReturnToActivities", + "MiningActivities", + "RecruitingActivities", + "Stop" + ] + }, + "MiningActivities": { + "algorithm": "OcrDetect", + "text": [ + "限时开采", + "开采" + ], + "action": "clickSelf", + "roi": [ + 0, + 20, + 302, + 302 + ], + "next": [ + "MiningActivityDigging", + "MiningActivitiesReturn" + ] + }, + "MiningActivityDigging": { + "action": "clickSelf", + "roi": [ + 901, + 469, + 334, + 182 + ], + "next": [ + "MiningActivityDigging", + "MiningActivityDiggingEnd", + "MiningActivitiesReturn" + ] + }, + "MiningActivityDiggingEnd": { + "action": "clickSelf", + "roi": [ + 559, + 563, + 160, + 157 + ], + "next": [ + "MiningActivitiesReturn" + ] + }, + "MiningActivitiesReturn": { + "template": "CloseAnno.png", + "action": "clickSelf", + "roi": [ + 1146, + 0, + 134, + 162 + ], + "next": [ + "RecruitingActivities", + "MiningActivitiesReturn", + "Stop" + ] + }, + "RecruitingActivities": { + "algorithm": "OcrDetect", + "text": [ + "赠送", + "次" + ], + "action": "clickSelf", + "roi": [ + 1148, + 416, + 132, + 138 + ], + "next": [ + "RecruitingActivitiesConfirm", + "RecruitingActivities" + ] + }, + "RecruitingActivitiesConfirm": { + "action": "doNothing", + "algorithm": "OcrDetect", + "text": [ + "赠送", + "次", + "小时" + ], + "roi": [ + 729, + 515, + 303, + 135 + ], + "next": [ + "RecruitingActivitiesRecruit", + "RecruitingActivitiesConfirm" + ] + }, + "RecruitingActivitiesRecruit": { + "algorithm": "OcrDetect", + "action": "clickSelf", + "text": [ + "寻访一次", + "寻访" + ], + "roi": [ + 770, + 577, + 267, + 143 + ], + "next": [ + "RecruitingActivitiesRecruitNowConfirm" + ] + }, + "RecruitingActivitiesRecruitNowConfirm": { + "action": "clickSelf", + "template": "RecruitNowConfirm.png", + "roi": [ + 586, + 399, + 694, + 192 + ], + "next": [ + "RecruitingActivitiesRecruitSkip", + "RecruitingActivitiesRecruitSkipWithoutButton", + "RecruitingActivitiesRecruitNowConfirm" + ] + }, + "RecruitingActivitiesRecruitSkip": { + "action": "clickSelf", + "template": "RecruitSkip.png", + "roi": [ + 1100, + 0, + 180, + 150 + ], + "next": [ + "RecruitingActivitiesRecruitSkip", + "RecruitingActivitiesRecruitSkipWithoutButton" + ] + }, + "RecruitingActivitiesRecruitSkipWithoutButton": { + "action": "clickRect", + "algorithm": "justReturn", + "specificRect": [ + 1180, + 15, + 85, + 60 + ], + "next": [ + "RecruitingActivitiesRecruitEnd", + "RecruitingActivitiesRecruitSkip", + "RecruitingActivitiesRecruitSkipWithoutButton" + ] + }, + "RecruitingActivitiesRecruitEnd": { + "algorithm": "OcrDetect", + "action": "doNothing", + "text": [ + "寻访一次", + "寻访" + ], + "roi": [ + 770, + 577, + 267, + 143 + ], + "next": [ + "Stop" + ] + }, "AwardBegin": { "algorithm": "JustReturn", "action": "DoNothing", diff --git a/resource/template/MiningActivityDigging.png b/resource/template/MiningActivityDigging.png new file mode 100644 index 0000000000..386ef5063a Binary files /dev/null and b/resource/template/MiningActivityDigging.png differ diff --git a/resource/template/MiningActivityDiggingEnd.png b/resource/template/MiningActivityDiggingEnd.png new file mode 100644 index 0000000000..5456511c3a Binary files /dev/null and b/resource/template/MiningActivityDiggingEnd.png differ diff --git a/src/MeoAssistant/MeoAssistant.vcxproj b/src/MeoAssistant/MeoAssistant.vcxproj index bbc718157e..58f0172a38 100644 --- a/src/MeoAssistant/MeoAssistant.vcxproj +++ b/src/MeoAssistant/MeoAssistant.vcxproj @@ -1,4 +1,4 @@ - + @@ -9,6 +9,10 @@ RelWithDebInfo x64 + + CICD + x64 + @@ -185,6 +189,13 @@ true Unicode + + DynamicLibrary + false + v143 + true + Unicode + DynamicLibrary false @@ -200,19 +211,30 @@ + + + false - $(SolutionDir)include;$(SolutionDir)3rdparty\include;$(IncludePath) - $(TargetDir);$(SolutionDir)\3rdparty\lib;$(LibraryPath) + $(ProjectDir)..\..\include;$(ProjectDir)..\..\3rdparty\include;$(IncludePath) + $(TargetDir);$(ProjectDir)..\..\3rdparty\lib;$(LibraryPath) + $(ProjectDir)..\..\$(Platform)\$(Configuration)\ + + + false + $(ProjectDir)..\..\include;$(ProjectDir)..\..\3rdparty\include;$(IncludePath) + $(TargetDir);$(ProjectDir)..\..\3rdparty\lib;$(LibraryPath) + $(ProjectDir)..\..\$(Platform)\$(Configuration)\ false - $(SolutionDir)include;$(SolutionDir)3rdparty\include;$(IncludePath) - $(TargetDir);$(SolutionDir)\3rdparty\lib;$(LibraryPath) + $(ProjectDir)..\..\include;$(ProjectDir)..\..\3rdparty\include;$(IncludePath) + $(TargetDir);$(ProjectDir)..\..\3rdparty\lib;$(LibraryPath) + $(ProjectDir)..\..\$(Platform)\$(Configuration)\ @@ -245,19 +267,50 @@ - xcopy /e /y /i /c $(SolutionDir)resource $(TargetDir)resource -xcopy /e /y /i /c $(SolutionDir)3rdparty\resource $(TargetDir)resource + + xcopy /e /y /i /c $(ProjectDir)..\..\resource $(TargetDir)resource + xcopy /e /y /i /c $(ProjectDir)..\..\3rdparty\resource $(TargetDir)resource + - copy resource + Copy resource - xcopy /e /y /i /c $(SolutionDir)3rdparty\bin $(TargetDir) + + xcopy /e /y /i /c $(ProjectDir)..\..\3rdparty\bin $(TargetDir) + - copy 3rd party dll + Copy 3rd party dll + + + Level4 + true + true + true + NDEBUG;_CONSOLE;ASST_DLL_EXPORTS;%(PreprocessorDefinitions) + true + stdcpp17 + stdc11 + MultiThreaded + MaxSpeed + /utf-8 /MP %(AdditionalOptions) + + + Console + true + true + true + ppocr.lib;opencv_world453.lib;zlibstatic.lib;%(AdditionalDependencies) + RequireAdministrator + + + true + msvcrt.lib + + Level4 @@ -292,17 +345,21 @@ xcopy /e /y /i /c $(SolutionDir)3rdparty\resource $(TargetDir)resource - xcopy /e /y /i /c $(SolutionDir)resource $(TargetDir)resource -xcopy /e /y /i /c $(SolutionDir)3rdparty\resource $(TargetDir)resource + + xcopy /e /y /i /c $(ProjectDir)..\..\resource $(TargetDir)resource + xcopy /e /y /i /c $(ProjectDir)..\..\3rdparty\resource $(TargetDir)resource + - copy resource + Copy resource - xcopy /e /y /i /c $(SolutionDir)3rdparty\bin $(TargetDir) + + xcopy /e /y /i /c $(ProjectDir)..\..\3rdparty\bin $(TargetDir) + - copy 3rd party dll + Copy 3rd party dll diff --git a/src/MeoAssistantBuilder/Constants.cs b/src/MeoAssistantBuilder/Constants.cs new file mode 100644 index 0000000000..7b67b1daf4 --- /dev/null +++ b/src/MeoAssistantBuilder/Constants.cs @@ -0,0 +1,23 @@ +namespace MeoAssistantBuilder; + +public static class Constants +{ + public const string MaaProjectRootDirectory = "../../"; + public const string MaaProjectThirdPartyDirectory = "../../3rdparty"; + public const string MaaProjectResourceDirectory = "../../resource"; + public const string MaaProjectArtifactDirectory = "../../artifacts"; + + public const string MaaCoreProjectDirectory = "../MeoAssistant"; + public const string MaaWpfProjectDirectory = "../MeoAsstGui"; + + public const string MaaCoreProjectFilePath = $"{MaaCoreProjectDirectory}/MeoAssistant.vcxproj"; + public const string MaaWpfProjectFilePath = $"{MaaWpfProjectDirectory}/MeoAsstGui.csproj"; + + public const string MaaBuildOutputDirectory = $"{MaaProjectRootDirectory}/x64"; + + public const string MaaCoreBuildIntermediatOutputDirectory = $"{MaaCoreProjectDirectory}/x64"; + + public static readonly string[] MaaCoreExtraFiles = new [] { "MeoAssistant.pdb", "MeoAssistant.lib", "MeoAssistant.exp" }; + + public static readonly string[] MaaWpfExtraFiles = new[] { "MeoAsstGui.pdb", "MeoAsstGui.exe.config" }; +} diff --git a/src/MeoAssistantBuilder/Helper/BuildCoreHelper.cs b/src/MeoAssistantBuilder/Helper/BuildCoreHelper.cs new file mode 100644 index 0000000000..078a94f099 --- /dev/null +++ b/src/MeoAssistantBuilder/Helper/BuildCoreHelper.cs @@ -0,0 +1,17 @@ +using Cake.Common.Tools.MSBuild; + +namespace MeoAssistantBuilder.Helper; + +public static class BuildCoreHelper +{ + public static void BuildCore(this MaaBuildContext context, string configuration) + { + context.MSBuild(Constants.MaaCoreProjectFilePath, new MSBuildSettings + { + WorkingDirectory = Constants.MaaProjectRootDirectory, + ToolPath = context.MsBuildExecutable, + Configuration = configuration, + PlatformTarget = PlatformTarget.x64 + }); + } +} diff --git a/src/MeoAssistantBuilder/Helper/BuildWpfHelper.cs b/src/MeoAssistantBuilder/Helper/BuildWpfHelper.cs new file mode 100644 index 0000000000..d3ed8f052a --- /dev/null +++ b/src/MeoAssistantBuilder/Helper/BuildWpfHelper.cs @@ -0,0 +1,18 @@ +using Cake.Common.Tools.MSBuild; + +namespace MeoAssistantBuilder.Helper; + +public static class BuildWpfHelper +{ + public static void BuildWpf(this MaaBuildContext context, string configuration) + { + context.MSBuild(Constants.MaaWpfProjectFilePath, new MSBuildSettings + { + WorkingDirectory = Constants.MaaProjectRootDirectory, + Restore = true, + ToolPath = context.MsBuildExecutable, + Configuration = configuration, + PlatformTarget = PlatformTarget.x64 + }); + } +} diff --git a/src/MeoAssistantBuilder/Helper/CleanDirectoryHelper.cs b/src/MeoAssistantBuilder/Helper/CleanDirectoryHelper.cs new file mode 100644 index 0000000000..44611e9631 --- /dev/null +++ b/src/MeoAssistantBuilder/Helper/CleanDirectoryHelper.cs @@ -0,0 +1,60 @@ +using Cake.Common.Diagnostics; +using Cake.Common.IO; + +namespace MeoAssistantBuilder.Helper; +public static class CleanDirectoryHelper +{ + public static void CleanArtifacts(this MaaBuildContext context) + { + context.CleanDirectory(Constants.MaaProjectArtifactDirectory); + if (Directory.Exists(Constants.MaaProjectArtifactDirectory)) + { + Directory.CreateDirectory(Constants.MaaProjectArtifactDirectory); + } + } + + public static void CleanCore(this MaaBuildContext context) + { + context.CleanDirectory(Constants.MaaBuildOutputDirectory); + context.CleanDirectory(Constants.MaaCoreBuildIntermediatOutputDirectory); + } + + public static void CleanWpf(this MaaBuildContext context) + { + context.CleanDirectory(Constants.MaaBuildOutputDirectory); + context.CleanDirectory(Path.Combine(Constants.MaaWpfProjectDirectory, "bin")); + context.CleanDirectory(Path.Combine(Constants.MaaWpfProjectDirectory, "obj")); + } + + public static void CleanAll(this MaaBuildContext context) + { + CleanCore(context); + CleanWpf(context); + } + + public static void RemoveExtraCore(this MaaBuildContext context, string buildOutput) + { + foreach (var extra in Constants.MaaCoreExtraFiles) + { + var file = Path.Combine(buildOutput, extra); + if (File.Exists(file)) + { + File.Delete(file); + context.Information($"Delete file: {file}"); + } + } + } + + public static void RemoveExtraWpf(this MaaBuildContext context, string buildOutput) + { + foreach (var extra in Constants.MaaWpfExtraFiles) + { + var file = Path.Combine(buildOutput, extra); + if (File.Exists(file)) + { + File.Delete(file); + context.Information($"Delete file: {file}"); + } + } + } +} diff --git a/src/MeoAssistantBuilder/Helper/FileCopyHelper.cs b/src/MeoAssistantBuilder/Helper/FileCopyHelper.cs new file mode 100644 index 0000000000..be2e4dcd73 --- /dev/null +++ b/src/MeoAssistantBuilder/Helper/FileCopyHelper.cs @@ -0,0 +1,53 @@ +using Cake.Common.Diagnostics; +using Cake.Common.IO; + +namespace MeoAssistantBuilder.Helper +{ + public static class FileCopyHelper + { + public static void CopyThirdPartyDlls(this MaaBuildContext context, string outputDir) + { + var thirdPartyDlls = Directory.GetFiles(Path.Combine(Constants.MaaProjectThirdPartyDirectory, "bin")); + foreach (var f in thirdPartyDlls) + { + var fileName = new FileInfo(f).Name; + context.CopyFile(f, Path.Combine(outputDir, fileName)); + context.Information($"Copy file: FROM {f} to {Path.Combine(outputDir, fileName)}"); + } + } + + public static void CopyResources(this MaaBuildContext context, string outputDir) + { + var resourceTargetDir = Path.Combine(outputDir, "resource"); + var resourceThirdParty = Path.Combine(Constants.MaaProjectRootDirectory, "3rdparty\\resource"); + var resoutceMaa = Path.Combine(Constants.MaaProjectRootDirectory, "resource"); + + var files = new List(); + var directories = new List(); + + files.AddRange(Directory.GetFiles(resourceThirdParty)); + files.AddRange(Directory.GetFiles(resoutceMaa)); + directories.AddRange(Directory.GetDirectories(resourceThirdParty)); + directories.AddRange(Directory.GetDirectories(resoutceMaa)); + + if (Directory.Exists(resourceTargetDir) is false) + { + Directory.CreateDirectory(resourceTargetDir); + } + + foreach (var f in files) + { + var fileName = new FileInfo(f).Name; + context.CopyFile(f, Path.Combine(resourceTargetDir, fileName)); + context.Information($"Copy file: FROM {f} TO {Path.Combine(resourceTargetDir, fileName)}"); + } + + foreach (var d in directories) + { + var dirName = new DirectoryInfo(d).Name; + context.CopyDirectory(d, Path.Combine(resourceTargetDir, dirName)); + context.Information($"Copy directory: FROM {d} TO {Path.Combine(resourceTargetDir, dirName)}"); + } + } + } +} diff --git a/src/MeoAssistantBuilder/Helper/GetBuildInformationHelper.cs b/src/MeoAssistantBuilder/Helper/GetBuildInformationHelper.cs new file mode 100644 index 0000000000..ac87a4c998 --- /dev/null +++ b/src/MeoAssistantBuilder/Helper/GetBuildInformationHelper.cs @@ -0,0 +1,38 @@ +using Cake.Common.Build; +using Cake.Common.Diagnostics; + +namespace MeoAssistantBuilder.Helper; + +public static class GetBuildInformationHelper +{ + public static (string, string) GetBuildInformation(this MaaBuildContext context) + { + var ghAction = context.GitHubActions(); + + var buildTime = DateTime.UtcNow.AddHours(8); + var bt = buildTime.ToString("yyyy-MM-dd-HH-mm-ss"); + string hash; + + if (ghAction.IsRunningOnGitHubActions) + { + hash = ghAction.Environment.Workflow.Sha.ToLower()[..7]; + } + else + { + try + { + var realPath = new DirectoryInfo(Constants.MaaProjectRootDirectory).FullName; + var repo = new LibGit2Sharp.Repository(realPath); + var commit = repo.Commits.First(); + hash = commit.Sha.ToLower()[..7]; + } + catch (Exception e) + { + context.Warning($"Failed to get git log: {e.Message}"); + hash = "Unknown"; + } + } + + return (bt, hash); + } +} diff --git a/src/MeoAssistantBuilder/MaaBuildContext.cs b/src/MeoAssistantBuilder/MaaBuildContext.cs new file mode 100644 index 0000000000..01044eed84 --- /dev/null +++ b/src/MeoAssistantBuilder/MaaBuildContext.cs @@ -0,0 +1,28 @@ +using Cake.Common; +using Cake.Common.Tools.VSWhere; +using Cake.Core; +using Cake.Core.Diagnostics; +using Cake.Frosting; + +namespace MeoAssistantBuilder; + +public class MaaBuildContext : FrostingContext +{ + public string MsBuildExecutable { get; set; } + + public MaaBuildContext(ICakeContext context) : base(context) + { + MsBuildExecutable = context.Argument("tool", ""); + if (MsBuildExecutable == "") + { + var vsPath = context.VSWhereLatest(); + if (vsPath == null) + { + context.Log.Write(Verbosity.Normal, LogLevel.Fatal, "Can not find Visual Studio install path"); + System.Environment.Exit(-1); + } + MsBuildExecutable = Path.Combine(vsPath.FullPath, "Msbuild\\Current\\Bin\\MsBuild.exe"); + } + context.Log.Information($"Use MsBuild at: {MsBuildExecutable}"); + } +} diff --git a/src/MeoAssistantBuilder/MeoAssistantBuilder.csproj b/src/MeoAssistantBuilder/MeoAssistantBuilder.csproj new file mode 100644 index 0000000000..c8d02f6130 --- /dev/null +++ b/src/MeoAssistantBuilder/MeoAssistantBuilder.csproj @@ -0,0 +1,17 @@ + + + + Exe + net6.0 + enable + disable + x64 + Debug;Release;CICD + + + + + + + + diff --git a/src/MeoAssistantBuilder/Program.cs b/src/MeoAssistantBuilder/Program.cs new file mode 100644 index 0000000000..c14c37d4ef --- /dev/null +++ b/src/MeoAssistantBuilder/Program.cs @@ -0,0 +1,15 @@ +using Cake.Frosting; +using MeoAssistantBuilder; + +var sArgs = new List(); +foreach (var arg in args) +{ + var sa = arg.Split(" ") + .ToList(); + sa.RemoveAll(x => string.IsNullOrEmpty(x) || string.IsNullOrWhiteSpace(x)); + sArgs.AddRange(sa); +} + +return new CakeHost() + .UseContext() + .Run(sArgs); diff --git a/src/MeoAssistantBuilder/README.md b/src/MeoAssistantBuilder/README.md new file mode 100644 index 0000000000..c4288f5cd3 --- /dev/null +++ b/src/MeoAssistantBuilder/README.md @@ -0,0 +1,23 @@ +# MeoAssistantBuilder + +MAA 构建项目 + +## 构建 MAA + +需要安装 +- `.NET SDK 6.0` +- `.NET Framework SDK 4.8` +- `MSVC v143 x64` +- `MSBuild (VS2022)` + +在本项目根目录执行 +``` +dotnet run -- --target +``` + +TARGET 可选项 + +- `DevBuild` +- `ReleaseCore` +- `ReleaseWpf` +- `ReleaseResource` diff --git a/src/MeoAssistantBuilder/Tasks/DevBuildTask.cs b/src/MeoAssistantBuilder/Tasks/DevBuildTask.cs new file mode 100644 index 0000000000..6b7ce804c7 --- /dev/null +++ b/src/MeoAssistantBuilder/Tasks/DevBuildTask.cs @@ -0,0 +1,61 @@ +using Cake.Common.Build; +using Cake.Common.Diagnostics; +using Cake.Frosting; +using MeoAssistantBuilder.Helper; +using System.IO.Compression; + +namespace MeoAssistantBuilder.Tasks; + +[TaskName("DevBuild")] +public sealed class DevBuildTask : FrostingTask +{ + public override void Run(MaaBuildContext context) + { + context.Information("--------------------------------------------------"); + context.Information("1. Get build information"); + context.Information("--------------------------------------------------"); + + context.CleanArtifacts(); + var (bt, hash) = context.GetBuildInformation(); + var artifact = $"MaaBundle-DevBuild-(CONF)-{hash}-{bt}.zip"; + context.Information($"Dev build of commit {hash} at {bt}"); + + context.Information("--------------------------------------------------"); + context.Information("2. Build MaaBundle with configuration Release"); + context.Information("--------------------------------------------------"); + + context.CleanAll(); + + context.BuildCore("Release"); + context.BuildWpf("Release"); + var releaseOutput = Path.Combine(Constants.MaaBuildOutputDirectory, "Release"); + var releaseArtifact = Path.Combine(Constants.MaaProjectArtifactDirectory, artifact.Replace("(CONF)", "Release")); + ZipFile.CreateFromDirectory(releaseOutput, releaseArtifact); + + context.Information("--------------------------------------------------"); + context.Information("3. Build MaaBundle with configuration RelWithDebInfo"); + context.Information("--------------------------------------------------"); + + context.CleanAll(); + + context.BuildCore("RelWithDebInfo"); + context.BuildWpf("RelWithDebInfo"); + var releaseDebugOutput = Path.Combine(Constants.MaaBuildOutputDirectory, "RelWithDebInfo"); + var releaseDebugArtifact = Path.Combine(Constants.MaaProjectArtifactDirectory, artifact.Replace("(CONF)", "RelWithDebInfo")); + ZipFile.CreateFromDirectory(releaseDebugOutput, releaseDebugArtifact); + + context.Information("--------------------------------------------------"); + context.Information("4. Build MaaBundle with configuration CICD"); + context.Information("--------------------------------------------------"); + + context.CleanAll(); + + context.BuildCore("CICD"); + context.BuildWpf("CICD"); + var releaseCiOutput = Path.Combine(Constants.MaaBuildOutputDirectory, "CICD"); + var releaseCiArtifact = Path.Combine(Constants.MaaProjectArtifactDirectory, artifact.Replace("(CONF)", "CICD")); + context.CopyThirdPartyDlls(releaseCiOutput); + context.CopyResources(releaseCiOutput); + ZipFile.CreateFromDirectory(releaseCiOutput, releaseCiArtifact); + } +} diff --git a/src/MeoAssistantBuilder/Tasks/ReleaseBundleTask.cs b/src/MeoAssistantBuilder/Tasks/ReleaseBundleTask.cs new file mode 100644 index 0000000000..1a75549b30 --- /dev/null +++ b/src/MeoAssistantBuilder/Tasks/ReleaseBundleTask.cs @@ -0,0 +1,88 @@ +using Cake.Common.Build; +using Cake.Common.Diagnostics; +using Cake.Frosting; +using MeoAssistantBuilder.Helper; +using System.IO.Compression; +using System.Text.RegularExpressions; + +namespace MeoAssistantBuilder.Tasks; + +[TaskName("ReleaseBundle")] +public sealed class ReleaseBundleTask : FrostingTask +{ + public override void Run(MaaBuildContext context) + { + context.Information("--------------------------------------------------"); + context.Information("1. Read MaaCore version string"); + context.Information("--------------------------------------------------"); + + var version = "UNKNOWN"; + var versionFile = Path.Combine(Constants.MaaCoreProjectDirectory, "Version.h"); + var versionFileContent = File.ReadAllText(versionFile); + + var regex = @"v((0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)"; + + var match = Regex.Match(versionFileContent, regex); + if (match.Success is false) + { + context.Warning("Can not read version"); + Environment.Exit(-1); + } + else + { + version = match.Value; + } + + var ghActions = context.GitHubActions(); + if (ghActions.IsRunningOnGitHubActions is false) + { + version += "-Local"; + } + else + { + context.Information($"Running in GitHub Action with workflow name: {ghActions.Environment.Workflow.Workflow}, ref: {ghActions.Environment.Workflow.Ref}"); + if (ghActions.Environment.Workflow.Workflow != "Release MaaCore") + { + version += $"-{ghActions.Environment.Workflow.RunId}"; + } + else + { + var tag = ghActions.Environment.Workflow.Ref.Replace("refs/tags/", ""); + if (tag != version) + { + context.Error($"Version do not match. From File: {version}. From Ref: {tag}"); + Environment.Exit(-1); + } + } + } + + context.Information($"MaaCore Version: {version}"); + + context.Information("--------------------------------------------------"); + context.Information("2. Release MaaCore with third party dlls and resource"); + context.Information("--------------------------------------------------"); + + var buildOutput = Path.Combine(Constants.MaaBuildOutputDirectory, "Release"); + context.CleanAll(); + context.CleanArtifacts(); + + context.BuildCore("Release"); + context.RemoveExtraCore(buildOutput); + + context.Information("--------------------------------------------------"); + context.Information("3. Release MaaWpf with third party executables"); + context.Information("--------------------------------------------------"); + + context.BuildWpf("Release"); + context.RemoveExtraWpf(buildOutput); + + context.Information("--------------------------------------------------"); + context.Information("4. Bundle MaaBundle package"); + context.Information("--------------------------------------------------"); + + var bundle = Path.Combine(Constants.MaaProjectArtifactDirectory, $"MaaBundle-{version}.zip"); + ZipFile.CreateFromDirectory(buildOutput, bundle); + + context.Information($"Bundled MaaBundle file: {bundle}"); + } +} diff --git a/src/MeoAssistantBuilder/Tasks/ReleaseCoreTask.cs b/src/MeoAssistantBuilder/Tasks/ReleaseCoreTask.cs new file mode 100644 index 0000000000..8a2131b5e4 --- /dev/null +++ b/src/MeoAssistantBuilder/Tasks/ReleaseCoreTask.cs @@ -0,0 +1,97 @@ +using Cake.Common.Build; +using Cake.Common.Diagnostics; +using Cake.Frosting; +using MeoAssistantBuilder.Helper; +using System.IO.Compression; +using System.Text.RegularExpressions; + +namespace MeoAssistantBuilder.Tasks; + +[TaskName("ReleaseCore")] +public sealed class ReleaseCoreTask : FrostingTask +{ + public override void Run(MaaBuildContext context) + { + context.Information("--------------------------------------------------"); + context.Information("1. Read MaaCore version string"); + context.Information("--------------------------------------------------"); + + var version = "UNKNOWN"; + var versionFile = Path.Combine(Constants.MaaCoreProjectDirectory, "Version.h"); + var versionFileContent = File.ReadAllText(versionFile); + + var regex = @"v((0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)"; + + var match = Regex.Match(versionFileContent, regex); + if (match.Success is false) + { + context.Warning("Can not read version"); + Environment.Exit(-1); + } + else + { + version = match.Value; + } + + var ghActions = context.GitHubActions(); + if (ghActions.IsRunningOnGitHubActions is false) + { + version += "-Local"; + } + else + { + context.Information($"Running in GitHub Action with workflow name: {ghActions.Environment.Workflow.Workflow}, ref: {ghActions.Environment.Workflow.Ref}"); + if (ghActions.Environment.Workflow.Workflow != "Release MaaCore") + { + version += $"-{ghActions.Environment.Workflow.RunId}"; + } + else + { + var tag = ghActions.Environment.Workflow.Ref.Replace("refs/tags/", ""); + if (tag != version) + { + context.Error($"Version do not match. From File: {version}. From Ref: {tag}"); + Environment.Exit(-1); + } + } + } + + context.Information($"MaaCore Version: {version}"); + + context.Information("--------------------------------------------------"); + context.Information("2. Build MaaCore with CICD configuration"); + context.Information("--------------------------------------------------"); + + context.CleanCore(); + context.CleanArtifacts(); + context.BuildCore("CICD"); + + context.Information("--------------------------------------------------"); + context.Information("3. Remove extra files from build output"); + context.Information("--------------------------------------------------"); + + var buildOutput = Path.Combine(Constants.MaaBuildOutputDirectory, "CICD"); + context.RemoveExtraCore(buildOutput); + + context.Information("--------------------------------------------------"); + context.Information("4. Copy 3rd party library DLLs to output directory"); + context.Information("--------------------------------------------------"); + + var thirdPartyDlls = Directory.GetFiles(Path.Combine(Constants.MaaProjectThirdPartyDirectory, "bin")); + foreach(var f in thirdPartyDlls) + { + var fileName = new FileInfo(f).Name; + File.Copy(f, Path.Combine(buildOutput, fileName)); + context.Information($"Copy file: FROM {f} to {Path.Combine(buildOutput, fileName)}"); + } + + context.Information("--------------------------------------------------"); + context.Information("5. Bundle MaaCore DLLs"); + context.Information("--------------------------------------------------"); + + var bundle = Path.Combine(Constants.MaaProjectArtifactDirectory, $"MaaCore-{version}.zip"); + ZipFile.CreateFromDirectory(buildOutput, bundle); + + context.Information($"Bundled MAACore DLLs file: {bundle}"); + } +} diff --git a/src/MeoAssistantBuilder/Tasks/ReleaseResourceTask.cs b/src/MeoAssistantBuilder/Tasks/ReleaseResourceTask.cs new file mode 100644 index 0000000000..de89df2d60 --- /dev/null +++ b/src/MeoAssistantBuilder/Tasks/ReleaseResourceTask.cs @@ -0,0 +1,43 @@ +using Cake.Common.Build; +using Cake.Common.Diagnostics; +using Cake.Frosting; +using MeoAssistantBuilder.Helper; +using System.IO.Compression; + +namespace MeoAssistantBuilder.Tasks; + +[TaskName("ReleaseResource")] +public sealed class ReleaseResourceTask : FrostingTask +{ + public override void Run(MaaBuildContext context) + { + context.Information("--------------------------------------------------"); + context.Information("1. Get bundle information"); + context.Information("--------------------------------------------------"); + + var (hash, bt) = context.GetBuildInformation(); + context.CleanArtifacts(); + var version = $"{hash}-{bt}"; + context.Information($"MaaResource Version: {version}"); + + context.Information("--------------------------------------------------"); + context.Information("2. Copy MaaResource"); + context.Information("--------------------------------------------------"); + + var resDir = Path.Combine(Constants.MaaBuildOutputDirectory, "resource"); + if (Directory.Exists(resDir) is false) + { + Directory.CreateDirectory(resDir); + } + context.CopyResources(resDir); + + context.Information("--------------------------------------------------"); + context.Information("3. Bundle MaaResource"); + context.Information("--------------------------------------------------"); + + var bundle = Path.Combine(Constants.MaaProjectArtifactDirectory, $"MaaResource-{version}.zip"); + ZipFile.CreateFromDirectory(resDir, bundle); + + context.Information($"Bundled MaaResource file: {bundle}"); + } +} diff --git a/src/MeoAssistantBuilder/Tasks/ReleaseWpfTask.cs b/src/MeoAssistantBuilder/Tasks/ReleaseWpfTask.cs new file mode 100644 index 0000000000..43b7ceb0b9 --- /dev/null +++ b/src/MeoAssistantBuilder/Tasks/ReleaseWpfTask.cs @@ -0,0 +1,46 @@ +using Cake.Common.Build; +using Cake.Common.Diagnostics; +using Cake.Frosting; +using MeoAssistantBuilder.Helper; +using System.IO.Compression; + +namespace MeoAssistantBuilder.Tasks; + +[TaskName("ReleaseWpf")] +public sealed class ReleaseWpfTask : FrostingTask +{ + public override void Run(MaaBuildContext context) + { + context.Information("--------------------------------------------------"); + context.Information("1. Build MaaWpf with ReleaseCore configuration"); + context.Information("--------------------------------------------------"); + + var (hash, bt) = context.GetBuildInformation(); + context.CleanWpf(); + context.CleanArtifacts(); + context.BuildWpf("CICD"); + + context.Information("--------------------------------------------------"); + context.Information("2. Remove extra files from build output"); + context.Information("--------------------------------------------------"); + + var buildOutput = Path.Combine(Constants.MaaBuildOutputDirectory, "CICD"); + context.RemoveExtraWpf(buildOutput); + + context.Information("--------------------------------------------------"); + context.Information("3. Set MaaWpf Version Number"); + context.Information("--------------------------------------------------"); + + var version = $"{hash}-{bt}"; + context.Information($"MaaWpf Version: {version}"); + + context.Information("--------------------------------------------------"); + context.Information("4. Bundle MaaWpf Executables"); + context.Information("--------------------------------------------------"); + + var bundle = Path.Combine(Constants.MaaProjectArtifactDirectory, $"MaaWpf-{version}.zip"); + ZipFile.CreateFromDirectory(buildOutput, bundle); + + context.Information($"Bundled MaaWpf Executables file: {bundle}"); + } +} diff --git a/src/MeoAsstGui/App.config b/src/MeoAsstGui/App.config index 9681c0bbc8..d3b6d9590a 100644 --- a/src/MeoAsstGui/App.config +++ b/src/MeoAsstGui/App.config @@ -11,7 +11,7 @@ - + diff --git a/src/MeoAsstGui/Helper/ToastNotification.cs b/src/MeoAsstGui/Helper/ToastNotification.cs index 16edc963a4..86a4a8d80c 100644 --- a/src/MeoAsstGui/Helper/ToastNotification.cs +++ b/src/MeoAsstGui/Helper/ToastNotification.cs @@ -139,46 +139,45 @@ namespace MeoAsstGui /// 提示音类型 protected async Task PlayNotificationSoundAsync(NotificationSounds sounds = NotificationSounds.None) { - await Task.Run(() => + try { - - try + switch (sounds) { - switch (sounds) - { - case NotificationSounds.Exclamation: SystemSounds.Exclamation.Play(); break; - case NotificationSounds.Asterisk: SystemSounds.Asterisk.Play(); break; - case NotificationSounds.Question: SystemSounds.Question.Play(); break; - case NotificationSounds.Beep: SystemSounds.Beep.Play(); break; - case NotificationSounds.Hand: SystemSounds.Hand.Play(); break; + case NotificationSounds.Exclamation: SystemSounds.Exclamation.Play(); break; + case NotificationSounds.Asterisk: SystemSounds.Asterisk.Play(); break; + case NotificationSounds.Question: SystemSounds.Question.Play(); break; + case NotificationSounds.Beep: SystemSounds.Beep.Play(); break; + case NotificationSounds.Hand: SystemSounds.Hand.Play(); break; - case NotificationSounds.Notification: - using (var key = Registry.CurrentUser.OpenSubKey(@"AppEvents\Schemes\Apps\.Default\Notification.Default\.Current")) + case NotificationSounds.Notification: + using (var key = Registry.CurrentUser.OpenSubKey(@"AppEvents\Schemes\Apps\.Default\Notification.Default\.Current")) + { + if (key != null) { - if (key != null) + // 获取 (Default) 项 + var o = key.GetValue(null); + if (o != null) { - // 获取 (Default) 项 - var o = key.GetValue(null); - if (o != null) - { - var theSound = new SoundPlayer((string)o); - theSound.Play(); - } - } - else - { - // 如果不支持就播放其它提示音 - PlayNotificationSoundAsync(NotificationSounds.Asterisk); + var theSound = new SoundPlayer((string)o); + theSound.Play(); } } - break; + else + { + // 如果不支持就播放其它提示音 + await PlayNotificationSoundAsync(NotificationSounds.Asterisk); + } + } + break; - case NotificationSounds.None: - default: break; - } + case NotificationSounds.None: + default: break; } - catch (Exception) { } - }).ConfigureAwait(false); + } + catch (Exception) + { + // Ignore + } } #endregion @@ -316,7 +315,7 @@ namespace MeoAsstGui } // 播放通知提示音 - PlayNotificationSoundAsync(sound); + PlayNotificationSoundAsync(sound).Wait(); // 任务栏闪烁 FlashWindowEx(); diff --git a/src/MeoAsstGui/MeoAsstGui.csproj b/src/MeoAsstGui/MeoAsstGui.csproj index 7d8ee09952..085d1814c6 100644 --- a/src/MeoAsstGui/MeoAsstGui.csproj +++ b/src/MeoAsstGui/MeoAsstGui.csproj @@ -38,23 +38,25 @@ false true - - x64 - pdbonly - true - ..\..\x64\Release\ - TRACE - prompt - 4 - false - - Always + OnBuildSuccess newlogo.ico - + + MeoAsstGui.App + + + ..\..\x64\Release\ + TRACE + true + pdbonly + x64 + 7.3 + prompt + + ..\..\x64\RelWithDebInfo\ DEBUG;TRACE false @@ -63,28 +65,17 @@ 7.3 prompt - - MeoAsstGui.App + + ..\..\x64\CICD\ + TRACE + true + pdbonly + x64 + 7.3 + prompt + true - - ..\..\packages\Costura.Fody.5.6.0\lib\netstandard1.0\Costura.dll - - - ..\..\packages\gong-wpf-dragdrop.2.4.1\lib\net47\GongSolutions.WPF.DragDrop.dll - - - ..\..\packages\HandyControl.3.2.0\lib\net472\HandyControl.dll - - - ..\..\packages\Microsoft.Win32.Primitives.4.3.0\lib\net46\Microsoft.Win32.Primitives.dll - - - ..\..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll - - - ..\..\packages\Stylet.1.3.6\lib\net45\Stylet.dll - @@ -225,26 +216,7 @@ Code - - True - True - Resources.resx - - - True - Settings.settings - True - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - SettingsSingleFileGenerator - Settings.Designer.cs - @@ -252,7 +224,7 @@ False - Microsoft .NET Framework 4.7.2 %28x86 和 x64%29 + Microsoft .NET Framework 4.7.2 %28x86 and x64%29 true @@ -267,17 +239,16 @@ 5.7.0 - runtime; build; native; contentfiles; analyzers; buildtransitive - all + All - 2.4.3 + 3.1.1 3.3.0 - 5.0.4 + 6.0.3 4.3.0 @@ -289,7 +260,7 @@ 13.0.1 - 6.1.0.1 + 6.1.0.5 1.3.6 @@ -310,7 +281,7 @@ 4.3.0 - 5.0.1 + 6.0.0 4.3.0 @@ -417,6 +388,6 @@ - xcopy /e /y /i /c $(SolutionDir)resource $(TargetDir)resource + xcopy /e /y /i /c $(ProjectDir)..\..\3rdparty\tools $(TargetDir) \ No newline at end of file diff --git a/src/MeoAsstGui/Properties/Resources.Designer.cs b/src/MeoAsstGui/Properties/Resources.Designer.cs deleted file mode 100644 index 18701c716e..0000000000 --- a/src/MeoAsstGui/Properties/Resources.Designer.cs +++ /dev/null @@ -1,72 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 此代码由工具生成。 -// 运行时版本:4.0.30319.42000 -// -// 对此文件的更改可能会导致不正确的行为,并且如果 -// 重新生成代码,这些更改将会丢失。 -// -//------------------------------------------------------------------------------ - -namespace MeoAsstGui.Properties -{ - using System; - - - /// - /// 一个强类型的资源类,用于查找本地化的字符串等。 - /// - // 此类是由 StronglyTypedResourceBuilder - // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 - // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen - // (以 /str 作为命令选项),或重新生成 VS 项目。 - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources - { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() - { - } - - /// - /// 返回此类使用的缓存的 ResourceManager 实例。 - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager - { - get - { - if (object.ReferenceEquals(resourceMan, null)) - { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MeoAsstGui.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// 重写当前线程的 CurrentUICulture 属性,对 - /// 使用此强类型资源类的所有资源查找执行重写。 - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get - { - return resourceCulture; - } - set - { - resourceCulture = value; - } - } - } -} diff --git a/src/MeoAsstGui/Properties/Resources.resx b/src/MeoAsstGui/Properties/Resources.resx deleted file mode 100644 index af7dbebbac..0000000000 --- a/src/MeoAsstGui/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/src/MeoAsstGui/Properties/Settings.Designer.cs b/src/MeoAsstGui/Properties/Settings.Designer.cs deleted file mode 100644 index af956e4392..0000000000 --- a/src/MeoAsstGui/Properties/Settings.Designer.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 此代码由工具生成。 -// 运行时版本:4.0.30319.42000 -// -// 对此文件的更改可能会导致不正确的行为,并且如果 -// 重新生成代码,这些更改将会丢失。 -// -//------------------------------------------------------------------------------ - -namespace MeoAsstGui.Properties -{ - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get - { - return defaultInstance; - } - } - } -} diff --git a/src/MeoAsstGui/Properties/Settings.settings b/src/MeoAsstGui/Properties/Settings.settings deleted file mode 100644 index 033d7a5e9e..0000000000 --- a/src/MeoAsstGui/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file