From bcd04448c041191b9da8bd1af476869d1c3219bf Mon Sep 17 00:00:00 2001
From: Starfire-Corporation-Win <1398581458@qq.com>
Date: Thu, 9 May 2024 16:10:30 +0800
Subject: [PATCH 1/7] =?UTF-8?q?=F0=9F=AA=84=20=E4=BC=98=E5=8C=96=20?=
=?UTF-8?q?=E8=B5=84=E6=BA=90=E6=90=9C=E7=B4=A2=E6=A1=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Editor/Windows/Page/2AssetPage.EditConfig.cs | 181 +++++++++---------
Editor/Windows/Page/4AssetPage.LookCollect.cs | 15 +-
Editor/Windows/Page/5AssetPage.LookTags.cs | 48 ++---
.../Page/6AssetPage.LookFirstPackage.cs | 17 +-
Editor/Windows/Page/AssetPage.Look.cs | 52 ++++-
.../TreeViewItem/TreeViewItemQueryAsset.cs | 10 +-
6 files changed, 171 insertions(+), 152 deletions(-)
diff --git a/Editor/Windows/Page/2AssetPage.EditConfig.cs b/Editor/Windows/Page/2AssetPage.EditConfig.cs
index 110117d..8c59640 100644
--- a/Editor/Windows/Page/2AssetPage.EditConfig.cs
+++ b/Editor/Windows/Page/2AssetPage.EditConfig.cs
@@ -18,9 +18,9 @@ internal class AssetPageEditConfig : IAssetPage
public AssetPageEditConfig()
{
GC_Select = GEContent.NewSetting("ic_Eyes", "选择资源配置文件");
- GC_SAVE = GEContent.NewBuiltin("d_SaveAs", "保存");
- Data = AssetCollectRoot.GetOrCreate();
- Config = ASConfig.GetOrCreate();
+ GC_SAVE = GEContent.NewBuiltin("d_SaveAs", "保存");
+ Data = AssetCollectRoot.GetOrCreate();
+ Config = ASConfig.GetOrCreate();
ViewConfig = new ViewRect(550, 1)
@@ -35,9 +35,9 @@ public AssetPageEditConfig()
public void Dispose()
{
- Data = null;
- Config = null;
- GC_SAVE = null;
+ Data = null;
+ Config = null;
+ GC_SAVE = null;
GC_Select = null;
}
@@ -299,116 +299,115 @@ private void OnDrawASConfig(Rect rect)
cell.y += cell.height;
cell.x = rect.x + 10;
cell.width = rect.width - cell.x;
- GUI.Label(cell,
+ GUI.Label(cell, string.Format("运行时 : {0}/{1}",
#if UNITY_ANDROID
- $"运行时 : Application.persistentDataPath/{Config.RuntimeRootDirectory}"
+ "Application.persistentDataPath"
#elif UNITY_STANDALONE_WIN
- $"运行时 : Application.streamingAssetsPath/{Config.RuntimeRootDirectory}"
+ "Application.streamingAssetsPath"
#elif UNITY_IPHONE || UNITY_IOS
- $"运行时 : Application.persistentDataPath/{Config.RuntimeRootDirectory}"
+ "Application.persistentDataPath"
#elif UNITY_WEBGL
- $"运行时 : Application.persistentDataPath/{Config.RuntimeRootDirectory}"
+ "Application.persistentDataPath"
+#else
+ "Not Support"
#endif
- , GEStyle.HeaderLabel);
+ , Config.RuntimeRootDirectory), GEStyle.HeaderLabel);
}
-
- if (string.IsNullOrEmpty(Config.RuntimeRootDirectory)) GUI.enabled = false;
-
- switch (Config.ASMode)
+ using (new EditorGUI.DisabledGroupScope(string.IsNullOrEmpty(Config.RuntimeRootDirectory)))
{
- case EASMode.Remote:
+ switch (Config.ASMode)
{
+ case EASMode.Remote:
{
- cell.y += cell.height;
- cell.x = rect.x + 10;
- cell.width = 150;
- GUI.Label(cell, "远端资源地址", GEStyle.HeaderLabel);
- }
- using (new EditorGUI.DisabledGroupScope(string.IsNullOrEmpty(Config.URL)))
- {
- cell.width = 100;
- cell.x = rect.width - cell.width;
- if (GUI.Button(cell, "跳转首包清单", GEStyle.toolbarbutton))
{
- AssetWindow.OpenPage();
- GUI.FocusControl(null);
+ cell.y += cell.height;
+ cell.x = rect.x + 10;
+ cell.width = 150;
+ GUI.Label(cell, "远端资源地址", GEStyle.HeaderLabel);
+ }
+ using (new EditorGUI.DisabledGroupScope(string.IsNullOrEmpty(Config.URL)))
+ {
+ cell.width = 100;
+ cell.x = rect.width - cell.width;
+ if (GUI.Button(cell, "跳转首包清单", GEStyle.toolbarbutton))
+ {
+ AssetWindow.OpenPage();
+ GUI.FocusControl(null);
+ }
+
+ cell.width = 100;
+ cell.x -= cell.width;
+ if (GUI.Button(cell, "打开远端网页", GEStyle.toolbarbutton))
+ {
+ Application.OpenURL(Config.URL);
+ GUI.FocusControl(null);
+ }
}
- cell.width = 100;
- cell.x -= cell.width;
- if (GUI.Button(cell, "打开远端网页", GEStyle.toolbarbutton))
{
- Application.OpenURL(Config.URL);
- GUI.FocusControl(null);
+ cell.y += cell.height;
+ cell.x = rect.x + 10;
+ cell.width = rect.width - cell.x;
+ cell.height = 50;
+ Config.URL = GUI.TextArea(cell, Config.URL);
}
- }
- {
- cell.y += cell.height;
- cell.x = rect.x + 10;
- cell.width = rect.width - cell.x;
- cell.height = 50;
- Config.URL = GUI.TextArea(cell, Config.URL);
- }
+ {
+ cell.y += cell.height;
+ cell.x = rect.x + 10;
+ cell.width = 150;
+ cell.height = 20;
+ GUI.Label(cell, "下载失败尝试次数", GEStyle.HeaderLabel);
+ cell.x += cell.width;
+ cell.width = rect.width - cell.x;
+ Config.DownloadFailedTryAgain = EditorGUI.IntSlider(cell, Config.DownloadFailedTryAgain, 3, 36);
+ }
- {
- cell.y += cell.height;
- cell.x = rect.x + 10;
- cell.width = 150;
- cell.height = 20;
- GUI.Label(cell, "下载失败尝试次数", GEStyle.HeaderLabel);
- cell.x += cell.width;
- cell.width = rect.width - cell.x;
- Config.DownloadFailedTryAgain = EditorGUI.IntSlider(cell, Config.DownloadFailedTryAgain, 3, 36);
- }
+ {
+ cell.y += cell.height;
+ cell.x = rect.x + 10;
+ cell.width = 150;
+ GUI.Label(cell, "资源加载的最大数量", GEStyle.HeaderLabel);
+ cell.x += cell.width;
+ cell.width = rect.width - cell.x;
+ Config.LoadingMaxTimeSlice = EditorGUI.IntSlider(cell, Config.LoadingMaxTimeSlice, 144, 8192);
+ }
- {
- cell.y += cell.height;
- cell.x = rect.x + 10;
- cell.width = 150;
- GUI.Label(cell, "资源加载的最大数量", GEStyle.HeaderLabel);
- cell.x += cell.width;
- cell.width = rect.width - cell.x;
- Config.LoadingMaxTimeSlice = EditorGUI.IntSlider(cell, Config.LoadingMaxTimeSlice, 144, 8192);
- }
+ {
+ cell.y += cell.height;
+ cell.x = rect.x + 10;
+ cell.width = 150;
+ GUI.Label(cell, "请求超时时间", GEStyle.HeaderLabel);
+ cell.x += cell.width;
+ cell.width = rect.width - cell.x;
+ Config.Timeout = EditorGUI.IntSlider(cell, Config.Timeout, 3, 180);
+ }
- {
- cell.y += cell.height;
- cell.x = rect.x + 10;
- cell.width = 150;
- GUI.Label(cell, "请求超时时间", GEStyle.HeaderLabel);
- cell.x += cell.width;
- cell.width = rect.width - cell.x;
- Config.Timeout = EditorGUI.IntSlider(cell, Config.Timeout, 3, 180);
+ break;
}
-
- if (string.IsNullOrEmpty(Config.URL)) GUI.enabled = true;
- break;
- }
- default:
- using (new EditorGUI.DisabledGroupScope(false))
- {
- cell.y += cell.height;
- cell.x = rect.x + 10;
- cell.width = 150;
- GUI.Label(cell, "资源包配置", GEStyle.HeaderLabel);
- foreach (var config in Config.Packages)
+ default:
+ using (new EditorGUI.DisabledGroupScope(true))
{
cell.y += cell.height;
cell.x = rect.x + 10;
- cell.width = rect.width - 20 - cell.x;
- GUI.Label(cell, config.Name, GEStyle.HeaderLabel);
-
- cell.x += cell.width;
- cell.width = 20;
- config.IsDefault = GUI.Toggle(cell, config.IsDefault, "");
+ cell.width = 150;
+ GUI.Label(cell, "资源包配置", GEStyle.HeaderLabel);
+ foreach (var config in Config.Packages)
+ {
+ cell.y += cell.height;
+ cell.x = rect.x + 10;
+ cell.width = rect.width - 20 - cell.x;
+ GUI.Label(cell, config.Name, GEStyle.HeaderLabel);
+
+ cell.x += cell.width;
+ cell.width = 20;
+ config.IsDefault = GUI.Toggle(cell, config.IsDefault, "");
+ }
}
- }
- break;
+ break;
+ }
}
-
- if (string.IsNullOrEmpty(Config.RuntimeRootDirectory)) GUI.enabled = true;
}
}
}
\ No newline at end of file
diff --git a/Editor/Windows/Page/4AssetPage.LookCollect.cs b/Editor/Windows/Page/4AssetPage.LookCollect.cs
index 0fe11c7..a1eb1b0 100644
--- a/Editor/Windows/Page/4AssetPage.LookCollect.cs
+++ b/Editor/Windows/Page/4AssetPage.LookCollect.cs
@@ -163,18 +163,8 @@ DisplayPackages is null ||
}
rect.x += rect.width + 3;
- rect.width = width - 30 - 30 - rect.x - (PageValues.Count <= 0 ? 0 : 190);
- TreeViewQueryAsset.searchString = DataDic[(Data.CurrentPackageIndex, Data.CurrentGroupIndex)].Count > 300
- ? EditorGUI.DelayedTextField(rect, TreeViewQueryAsset.searchString, GEStyle.SearchTextField)
- : EditorGUI.TextField(rect, TreeViewQueryAsset.searchString, GEStyle.SearchTextField);
-
- rect.x += rect.width;
- rect.width = 30;
- if (GUI.Button(rect, Instance.GC_CLEAR, GEStyle.TEtoolbarbutton))
- {
- GUI.FocusControl(null);
- TreeViewQueryAsset.searchString = string.Empty;
- }
+ rect.width = width - 30 - rect.x - (PageValues.Count <= 0 ? 0 : 190);
+ SearchAssetText(rect);
rect.x += rect.width;
rect.width = 190;
@@ -270,6 +260,7 @@ private bool FilterData(AssetDataInfo data)
public void UpdateData()
{
+ TreeViewQueryAsset.searchString = string.Empty;
GUI.FocusControl(null);
if (!Data.IsValidCollect()) return;
diff --git a/Editor/Windows/Page/5AssetPage.LookTags.cs b/Editor/Windows/Page/5AssetPage.LookTags.cs
index 2fadd32..850df69 100644
--- a/Editor/Windows/Page/5AssetPage.LookTags.cs
+++ b/Editor/Windows/Page/5AssetPage.LookTags.cs
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using UnityEditor;
+using UnityEditor.IMGUI.Controls;
using UnityEngine;
namespace AIO.UEditor
@@ -28,7 +29,7 @@ void IAssetPage.EventMouseDrag(in Event evt)
}
bool IAssetPage.Shortcut(Event evt) =>
- evt.control && evt.type == EventType.KeyDown && (evt.keyCode == KeyCode.Keypad6 || evt.keyCode == KeyCode.Alpha6);
+ evt.control && evt.type == EventType.KeyDown && (evt.keyCode == KeyCode.Keypad5 || evt.keyCode == KeyCode.Alpha5);
public void Dispose() { DisplayPackages = null; }
@@ -80,27 +81,22 @@ public void OnDrawHeader(Rect rect)
if (EditorGUI.EndChangeCheck())
{
- PageValues.Clear();
- PageValues.Add(Values.Where(data => !FilterData(data)));
- PageValues.PageIndex = 0;
+ lock (PageValues)
+ {
+ PageValues.Clear();
+ PageValues.Add(Values.Where(data => !FilterData(data)));
+ PageValues.PageIndex = 0;
+ }
+
TreeViewQueryAsset.ReloadAndSelect(0);
}
- rect.x += rect.width + 3;
- rect.width = width - 30 - 30 - 30 - rect.x - (PageValues.Count <= 0 ? 0 : 190);
- TreeViewQueryAsset.searchString = Values.Count > 300
- ? EditorGUI.DelayedTextField(rect, TreeViewQueryAsset.searchString, GEStyle.SearchTextField)
- : EditorGUI.TextField(rect, TreeViewQueryAsset.searchString, GEStyle.SearchTextField);
+ rect.x += rect.width + 3;
- rect.x += rect.width;
- rect.width = 30;
- if (GUI.Button(rect, Instance.GC_CLEAR, GEStyle.TEtoolbarbutton))
- {
- GUI.FocusControl(null);
- TreeViewQueryAsset.searchString = string.Empty;
- }
+ rect.width = width - 30 - 30 - rect.x - (PageValues.Count <= 0 ? 0 : 190) - 3;
+ SearchAssetText(rect);
- rect.x += rect.width;
+ rect.x += rect.width + 3;
rect.width = 190;
Instance.OnDrawPageSetting(rect);
@@ -175,11 +171,15 @@ public void OnDrawContent(Rect rect)
public void UpdateData()
{
GUI.FocusControl(null);
- Instance.SelectAsset = null;
+ Instance.SelectAsset = null;
+ TreeViewQueryAsset.searchString = string.Empty;
+ lock (PageValues)
+ {
+ PageValues.Clear();
+ PageValues.PageIndex = 0;
+ }
- PageValues.Clear();
- PageValues.PageIndex = 0;
- Values.Clear();
+ lock (Values) Values.Clear();
if (Data.Packages.Length == 0) return;
@@ -218,11 +218,11 @@ public void UpdateData()
void Collect(AssetCollectPackage package, AssetCollectGroup group, AssetCollectItem item)
{
item.CollectAssetAsync(package, group, toLower, hasExtension);
- Values.AddRange(item.DataInfos.Values);
+ lock (Values) Values.AddRange(item.DataInfos.Values);
if (listItems.Count != ++index) return;
Runner.StartCoroutine(() =>
{
- listTypes.AddRange(Values.Where(dataInfo => !listTypes.Contains(dataInfo.Type)).Select(dataInfo => dataInfo.Type));
+ lock (Values) listTypes.AddRange(Values.Where(dataInfo => !listTypes.Contains(dataInfo.Type)).Select(dataInfo => dataInfo.Type));
Runner.StartTask(End);
});
}
@@ -242,7 +242,7 @@ void End()
///
/// 标签模式 资源过滤器
///
- private bool FilterData(AssetDataInfo data)
+ private static bool FilterData(AssetDataInfo data)
{
var filter = 0;
if (IsFilterCollectors(DisplayCollectorsIndex, data.CollectPath, DisplayCollectors)) filter++;
diff --git a/Editor/Windows/Page/6AssetPage.LookFirstPackage.cs b/Editor/Windows/Page/6AssetPage.LookFirstPackage.cs
index 9bd5a44..810395f 100644
--- a/Editor/Windows/Page/6AssetPage.LookFirstPackage.cs
+++ b/Editor/Windows/Page/6AssetPage.LookFirstPackage.cs
@@ -29,12 +29,13 @@ void IAssetPage.EventMouseDrag(in Event evt)
}
bool IAssetPage.Shortcut(Event evt) =>
- evt.control && evt.type == EventType.KeyDown && (evt.keyCode == KeyCode.Keypad5 || evt.keyCode == KeyCode.Alpha5);
+ evt.control && evt.type == EventType.KeyDown && (evt.keyCode == KeyCode.Keypad6 || evt.keyCode == KeyCode.Alpha6);
#endregion
public void UpdateData()
{
+ TreeViewQueryAsset.searchString = string.Empty;
if (!Config.EnableSequenceRecord) return;
if (Config.SequenceRecord.ExistsLocal()) Config.SequenceRecord.UpdateLocal();
UpdateDataAll();
@@ -115,17 +116,9 @@ public void OnDrawHeader(Rect rect)
}
}
- rect.x += rect.width + 3;
- rect.width = width - 30 - 30 - 30 - 30 - rect.x - (PageValues.Count <= 0 ? 0 : 190);
- TreeViewQueryAsset.searchString = GUI.TextField(rect, TreeViewQueryAsset.searchString, GEStyle.SearchTextField);
-
- rect.x += rect.width;
- rect.width = 30;
- if (GUI.Button(rect, Instance.GC_CLEAR, GEStyle.TEtoolbarbutton))
- {
- GUI.FocusControl(null);
- TreeViewQueryAsset.searchString = string.Empty;
- }
+ rect.x += rect.width + 3;
+ rect.width = width - 30 - 30 - 30 - rect.x - (PageValues.Count <= 0 ? 0 : 190);
+ SearchAssetText(rect);
rect.x += rect.width;
rect.width = 190;
diff --git a/Editor/Windows/Page/AssetPage.Look.cs b/Editor/Windows/Page/AssetPage.Look.cs
index 5e8f4ae..a6bad0e 100644
--- a/Editor/Windows/Page/AssetPage.Look.cs
+++ b/Editor/Windows/Page/AssetPage.Look.cs
@@ -22,13 +22,14 @@ public partial class AssetPageLook
#endregion
- private static AssetCollectRoot Data; // 资源数据
- private static ASConfig Config; // 配置文件
- private static TreeViewQueryAsset TreeViewQueryAsset;
+ private static AssetCollectRoot Data; // 资源数据
+ private static ASConfig Config; // 配置文件
+ private static TreeViewQueryAsset TreeViewQueryAsset;
+
private static TreeViewDependencies TreeViewDependencies;
- private static PageList PageValues; // 当前页资源列表
- private static List Values; // 当前所有资源
+ private static volatile PageList PageValues; // 当前页资源列表
+ private static volatile List Values; // 当前所有资源
private static string[] DisplayPackages; // 列表:包
private static string[] DisplayTags; // 列表:标签
@@ -231,7 +232,7 @@ private AssetPageLook()
TreeViewQueryAsset.OnSingleSelectionChanged += OnQueryAsseChanged;
}
-
+ ControlID = GUIUtility.GetControlID(FocusType.Passive).ToString();
TreeViewDependencies = TreeViewDependencies.Create(Dependencies.Values);
UpdatePageSizeMenu();
}
@@ -257,6 +258,45 @@ private void UpdatePageSizeMenu()
#endregion
+ private static string ControlID;
+
+ private static void SearchAssetText(Rect rect)
+ {
+ rect.y += 2;
+ rect.height -= 2;
+
+ using (new GUI.GroupScope(rect, GEStyle.ToolbarSeachTextField))
+ {
+ var cell = new Rect(12, -1, rect.width, rect.height + 1);
+ if (!string.IsNullOrEmpty(TreeViewQueryAsset.searchString)) cell.width -= cell.x + 15;
+ else cell.width -= cell.x;
+ EditorGUIUtility.AddCursorRect(cell, MouseCursor.Text);
+ GUI.SetNextControlName(ControlID);
+ TreeViewQueryAsset.searchString = GUI.TextField(cell, TreeViewQueryAsset.searchString, GEStyle.MiniBoldLabel);
+
+ // 按下 Ctrl + F 时,自动聚焦到搜索框
+ if (Event.current != null && Event.current.keyCode == KeyCode.F && (Event.current.control || Event.current.command))
+ {
+ Debug.Log("Focus");
+ EditorGUIUtility.editingTextField = true;
+ GUI.FocusControl(ControlID);
+ Event.current.Use();
+ }
+
+ if (string.IsNullOrEmpty(TreeViewQueryAsset.searchString)) return;
+
+ cell.width = 15;
+ cell.y = 0;
+ cell.x = rect.width - cell.width;
+ cell.height = rect.height;
+ EditorGUIUtility.AddCursorRect(cell, MouseCursor.Arrow);
+ if (!GUI.Button(cell, GUIContent.none, GEStyle.ToolbarSeachCancelButton)) return;
+
+ GUI.FocusControl(null);
+ TreeViewQueryAsset.searchString = string.Empty;
+ }
+ }
+
#region IsFilter
///
diff --git a/Editor/Windows/TreeViewItem/TreeViewItemQueryAsset.cs b/Editor/Windows/TreeViewItem/TreeViewItemQueryAsset.cs
index 3695742..75473e2 100644
--- a/Editor/Windows/TreeViewItem/TreeViewItemQueryAsset.cs
+++ b/Editor/Windows/TreeViewItem/TreeViewItemQueryAsset.cs
@@ -49,13 +49,9 @@ public TreeViewItemQueryAsset(
public float GetHeight() => 22;
public Rect GetRenameRect(Rect rowRect, int row) => rowRect;
- bool ITVItemDraw.MatchSearch(string search)
- {
- if (string.IsNullOrEmpty(search)) return true;
- return data.Address.Contains(search)
- || data.AssetPath.Contains(search)
- || data.Type.Contains(search);
- }
+ bool ITVItemDraw.MatchSearch(string search) => (!string.IsNullOrEmpty(data.Address) && data.Address.Contains(search))
+ || (!string.IsNullOrEmpty(data.AssetPath) && data.AssetPath.Contains(search))
+ || (!string.IsNullOrEmpty(data.Type) && data.Type.Contains(search));
void ITVItemDraw.OnDraw(Rect cell, int col, ref RowGUIArgs args)
{
From 27a7cd176eb57620ffcac115763afd6b3fad3917 Mon Sep 17 00:00:00 2001
From: Starfire-Corporation-Win <1398581458@qq.com>
Date: Thu, 9 May 2024 18:03:45 +0800
Subject: [PATCH 2/7] =?UTF-8?q?=E2=9C=A8=20=E6=9B=B4=E6=96=B0=E5=A4=9A?=
=?UTF-8?q?=E7=BA=BF=E7=A8=8B=E5=8A=A0=E8=BD=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Editor/Interface/AssetInfoData.cs | 2 +-
Editor/Windows/Page/4AssetPage.LookCollect.cs | 3 +++
Editor/Windows/Page/AssetPage.Look.cs | 4 ++--
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/Editor/Interface/AssetInfoData.cs b/Editor/Interface/AssetInfoData.cs
index 88581b0..10f63e9 100644
--- a/Editor/Interface/AssetInfoData.cs
+++ b/Editor/Interface/AssetInfoData.cs
@@ -282,7 +282,7 @@ public string Type
private long _size;
[NonSerialized]
- private string _type;
+ internal string _type;
[NonSerialized]
private string _guid;
diff --git a/Editor/Windows/Page/4AssetPage.LookCollect.cs b/Editor/Windows/Page/4AssetPage.LookCollect.cs
index a1eb1b0..c5a695d 100644
--- a/Editor/Windows/Page/4AssetPage.LookCollect.cs
+++ b/Editor/Windows/Page/4AssetPage.LookCollect.cs
@@ -1,6 +1,9 @@
using System;
using System.Collections.Generic;
using System.Linq;
+using Unity.Collections;
+using Unity.Jobs;
+using Unity.Jobs.LowLevel.Unsafe;
using UnityEditor;
using UnityEngine;
diff --git a/Editor/Windows/Page/AssetPage.Look.cs b/Editor/Windows/Page/AssetPage.Look.cs
index a6bad0e..3bd058f 100644
--- a/Editor/Windows/Page/AssetPage.Look.cs
+++ b/Editor/Windows/Page/AssetPage.Look.cs
@@ -28,8 +28,8 @@ public partial class AssetPageLook
private static TreeViewDependencies TreeViewDependencies;
- private static volatile PageList PageValues; // 当前页资源列表
- private static volatile List Values; // 当前所有资源
+ private static PageList PageValues; // 当前页资源列表
+ private static List Values; // 当前所有资源
private static string[] DisplayPackages; // 列表:包
private static string[] DisplayTags; // 列表:标签
From 574e65fe88a069d0f08e4d0005015f3fccf38101 Mon Sep 17 00:00:00 2001
From: Starfire-Win
Date: Wed, 15 May 2024 20:23:11 +0800
Subject: [PATCH 3/7] =?UTF-8?q?=E2=9C=A8=20=E6=96=B0=E5=A2=9ECodecov?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.github/workflows/codecov.yml | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
create mode 100644 .github/workflows/codecov.yml
diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml
new file mode 100644
index 0000000..2ee2eef
--- /dev/null
+++ b/.github/workflows/codecov.yml
@@ -0,0 +1,30 @@
+name: Workflow for Codecov example-python
+on: [push, pull_request]
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+ - name: Set up Python 3.10
+ uses: actions/setup-python@v4
+ with:
+ python-version: '3.10'
+ - name: Install dependencies
+ run: pip install -r requirements.txt
+ - name: Run ATS
+ uses: codecov/codecov-ats@v0
+ env:
+ CODECOV_STATIC_TOKEN: ${{ secrets.CODECOV_STATIC_TOKEN }}
+ CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
+ - name: Run tests and collect coverage
+ run: pytest --cov app ${{ env.CODECOV_ATS_TESTS }}
+ - name: Upload coverage to Codecov
+ uses: codecov/codecov-action@v4
+ with:
+ flags: smart-tests
+ verbose: true
+ env:
+ CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
\ No newline at end of file
From 10a1066bdf99d9cd1d4c046c9ce81c33c9700b83 Mon Sep 17 00:00:00 2001
From: Starfire-Win
Date: Wed, 15 May 2024 20:27:18 +0800
Subject: [PATCH 4/7] =?UTF-8?q?=E2=9C=A8=20=E4=BF=AE=E6=94=B9=E6=96=87?=
=?UTF-8?q?=E6=A1=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.github/README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/README.md b/.github/README.md
index 594952c..f304ac9 100644
--- a/.github/README.md
+++ b/.github/README.md
@@ -14,8 +14,8 @@
+
-
## ⚙ 安装
@@ -131,4 +131,4 @@
- **谢谢您选择我们的扩展包。**
- **如果此软件包对您有所帮助。**
-- **请考虑通过添加⭐来表示支持。**
+- **请考虑通过添加⭐来表示支持。**
\ No newline at end of file
From 7880325f49d5487ca5f63f220ac7ff06fddc2d52 Mon Sep 17 00:00:00 2001
From: Starfire-Win
Date: Wed, 15 May 2024 20:32:59 +0800
Subject: [PATCH 5/7] =?UTF-8?q?=E2=9C=A8=20=E6=B5=8B=E8=AF=95=20cdoecov?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.github/workflows/codecov.yml | 56 ++++++++++++++++++-----------------
1 file changed, 29 insertions(+), 27 deletions(-)
diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml
index 2ee2eef..25455e7 100644
--- a/.github/workflows/codecov.yml
+++ b/.github/workflows/codecov.yml
@@ -1,30 +1,32 @@
-name: Workflow for Codecov example-python
-on: [push, pull_request]
+name: workflow for Codecov
+on: [push]
jobs:
run:
- runs-on: ubuntu-latest
+ runs-on: ${{ matrix.os }}
+ strategy:
+ matrix:
+ os: [ubuntu-latest, macos-latest, windows-latest]
+ env:
+ OS: ${{ matrix.os }}
+ PYTHON: '3.10'
steps:
- - name: Checkout
- uses: actions/checkout@v4
- with:
- fetch-depth: 0
- - name: Set up Python 3.10
- uses: actions/setup-python@v4
- with:
- python-version: '3.10'
- - name: Install dependencies
- run: pip install -r requirements.txt
- - name: Run ATS
- uses: codecov/codecov-ats@v0
- env:
- CODECOV_STATIC_TOKEN: ${{ secrets.CODECOV_STATIC_TOKEN }}
- CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- - name: Run tests and collect coverage
- run: pytest --cov app ${{ env.CODECOV_ATS_TESTS }}
- - name: Upload coverage to Codecov
- uses: codecov/codecov-action@v4
- with:
- flags: smart-tests
- verbose: true
- env:
- CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
\ No newline at end of file
+ - uses: actions/checkout@main
+ - name: Setup Python
+ uses: actions/setup-python@main
+ with:
+ python-version: 3.10
+ - name: Generate coverage report
+ run: |
+ pip install pytest
+ pip install pytest-cov
+ pytest --cov=./ --cov-report=xml
+ - name: Upload coverage to Codecov
+ uses: codecov/codecov-action@v4
+ with:
+ directory: ./coverage/reports/
+ env_vars: OS,PYTHON
+ fail_ci_if_error: true
+ flags: unittests
+ name: codecov-umbrella
+ token: ${{ secrets.CODECOV_TOKEN }}
+ verbose: true
\ No newline at end of file
From 39e247cc463a268f69895db16a1d1925f74eb616 Mon Sep 17 00:00:00 2001
From: Starfire-Win
Date: Wed, 15 May 2024 20:37:20 +0800
Subject: [PATCH 6/7] =?UTF-8?q?=E2=9C=A8=20=E4=BF=AE=E6=94=B9Readme?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.github/README.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/.github/README.md b/.github/README.md
index f304ac9..f66d74d 100644
--- a/.github/README.md
+++ b/.github/README.md
@@ -16,6 +16,7 @@
+
## ⚙ 安装
From 013f8d68e91e5fa8f56d30643853ddd01e8a99cf Mon Sep 17 00:00:00 2001
From: Starfire-Win
Date: Wed, 15 May 2024 20:42:06 +0800
Subject: [PATCH 7/7] =?UTF-8?q?=E2=9C=A8=20=E4=BF=AE=E6=94=B9=20=E5=B7=A5?=
=?UTF-8?q?=E4=BD=9C=E6=B5=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.github/workflows/codecov.yml | 31 ++++++-------------------------
1 file changed, 6 insertions(+), 25 deletions(-)
diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml
index 25455e7..f9b4707 100644
--- a/.github/workflows/codecov.yml
+++ b/.github/workflows/codecov.yml
@@ -2,31 +2,12 @@ name: workflow for Codecov
on: [push]
jobs:
run:
- runs-on: ${{ matrix.os }}
- strategy:
- matrix:
- os: [ubuntu-latest, macos-latest, windows-latest]
- env:
- OS: ${{ matrix.os }}
- PYTHON: '3.10'
+ runs-on: ubuntu-latest
+
steps:
- uses: actions/checkout@main
- - name: Setup Python
- uses: actions/setup-python@main
+ - uses: codecov/codecov-action@v4
with:
- python-version: 3.10
- - name: Generate coverage report
- run: |
- pip install pytest
- pip install pytest-cov
- pytest --cov=./ --cov-report=xml
- - name: Upload coverage to Codecov
- uses: codecov/codecov-action@v4
- with:
- directory: ./coverage/reports/
- env_vars: OS,PYTHON
- fail_ci_if_error: true
- flags: unittests
- name: codecov-umbrella
- token: ${{ secrets.CODECOV_TOKEN }}
- verbose: true
\ No newline at end of file
+ fail_ci_if_error: true # optional (default = false)
+ token: ${{ secrets.CODECOV_TOKEN }} # required
+ verbose: true # optional (default = false)
\ No newline at end of file