You've already forked Commercialization.topon
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 784bc7c0ee | |||
| 0958e1569a | |||
| f1084a5db9 |
8
AnyThinkPlugin/AnyThinkAds/Plugins/iOS.meta
Normal file
8
AnyThinkPlugin/AnyThinkAds/Plugins/iOS.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e9115931d711f214aa6aa79f3faae8d7
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
AnyThinkPlugin/AnyThinkAds/Plugins/iOS/China.meta
Normal file
8
AnyThinkPlugin/AnyThinkAds/Plugins/iOS/China.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 884850fa610017146a55d9579149e619
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
AnyThinkPlugin/AnyThinkAds/Plugins/iOS/China/baidu.meta
Normal file
8
AnyThinkPlugin/AnyThinkAds/Plugins/iOS/China/baidu.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: db06d62c9d0894385a59b5fb103ab275
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f6bea76eddb364121b83ad86a0338601
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<dependencies>
|
||||
<iosPods>
|
||||
<iosPod name="AnyThinkMediationBaiduAdapter" version="10.050.0" />
|
||||
</iosPods>
|
||||
</dependencies>
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0d8df9936bce14501b0ce7acb8f0e486
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"baidu","version":"10.050","country":1,"path":"Assets/AnyThinkPlugin/Script/IntegrationManager/Editor/../../..//AnyThinkAds\\Plugins/iOS/China/baidu"}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c479be6d2cfff5f49b743fd4e7d014f2
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
AnyThinkPlugin/AnyThinkAds/Plugins/iOS/China/core.meta
Normal file
8
AnyThinkPlugin/AnyThinkAds/Plugins/iOS/China/core.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4a5a23d591de040028521674fa54d20c
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8eebe69ca7fb743d2b5665bb700c28db
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<dependencies>
|
||||
<iosPods>
|
||||
<iosPod name="AnyThinkiOS" version="6.5.45" />
|
||||
<iosPod name="AnyThinkMediationAdxSmartdigimktCNAdapter" version="6.5.65.0" />
|
||||
</iosPods>
|
||||
</dependencies>
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 50c9dea184d284d84bc7e0822bb870d9
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
AnyThinkPlugin/AnyThinkAds/Plugins/iOS/China/csj.meta
Normal file
8
AnyThinkPlugin/AnyThinkAds/Plugins/iOS/China/csj.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ad0abde879bdd410199166a9164ebc16
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 965cd469bf04d4cc9a8d2cc8c7daf270
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<dependencies>
|
||||
<iosPods>
|
||||
<iosPod name="AnyThinkMediationTTAdapter" version="7.5.0.1.1" />
|
||||
</iosPods>
|
||||
</dependencies>
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6437e098bd08a44b7885c53c03330621
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"csj","version":"7.5.0.1","country":1,"path":"Assets/AnyThinkPlugin/Script/IntegrationManager/Editor/../../..//AnyThinkAds\\Plugins/iOS/China/csj"}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 32015d391988d1247929856b6469e6f3
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
AnyThinkPlugin/AnyThinkAds/Plugins/iOS/China/gdt.meta
Normal file
8
AnyThinkPlugin/AnyThinkAds/Plugins/iOS/China/gdt.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b29b0c13c4c4844d4b1be5760b6811f6
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ebeba71cc398047fe879c71be3a53d0d
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<dependencies>
|
||||
<iosPods>
|
||||
<iosPod name="AnyThinkMediationGDTAdapter" version="4.15.80.2" />
|
||||
</iosPods>
|
||||
</dependencies>
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 215f3a5690c3b4ea3bc7abeec1cd916b
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"gdt","version":"4.15.80","country":1,"path":"Assets/AnyThinkPlugin/Script/IntegrationManager/Editor/../../..//AnyThinkAds\\Plugins/iOS/China/gdt"}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: aa206b00090001e4a8ddb3b2a8820f60
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a5b213b3361cc47a19e52a0bc28b5927
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 871f2af504cd74b97a9fd8253a21aedd
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<dependencies>
|
||||
<iosPods>
|
||||
<iosPod name="AnyThinkMediationKuaiShouAdapter" version="4.12.20.3.3" />
|
||||
</iosPods>
|
||||
</dependencies>
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 801f4c656a41d4485b9d77ecff1ea8b5
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"kuaishou","version":"4.12.20.3","country":1,"path":"Assets/AnyThinkPlugin/Script/IntegrationManager/Editor/../../..//AnyThinkAds\\Plugins/iOS/China/kuaishou"}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8de46792959b74b43b6178a1daae3d82
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1 +1 @@
|
||||
{"curCountry":1,"china":{"android_version":"6.5.73","ios_version":"","androidXSetting":1,"country":1,"android_admob_app_id":"","ios_admob_app_id":""},"nonchina":{"android_version":"","ios_version":"","androidXSetting":0,"country":2,"android_admob_app_id":"","ios_admob_app_id":""}}
|
||||
{"curCountry":1,"china":{"android_version":"6.5.73","ios_version":"6.5.45","androidXSetting":1,"country":1,"android_admob_app_id":"","ios_admob_app_id":""},"nonchina":{"android_version":"","ios_version":"","androidXSetting":0,"country":2,"android_admob_app_id":"","ios_admob_app_id":""}}
|
||||
@@ -44,6 +44,8 @@ namespace AnyThink.Scripts.Editor
|
||||
get
|
||||
{
|
||||
var dynamicLibraryPathsToEmbed = new List<string>();
|
||||
dynamicLibraryPathsToEmbed.Add(Path.Combine("Pods/", "AnyThinkiOS/core/AnyThinkSDK.xcframework"));
|
||||
dynamicLibraryPathsToEmbed.Add(Path.Combine("Pods/", "SmartdigimktCNSDK/KuYingSDK/SmartdigimktSDK.xcframework"));
|
||||
dynamicLibraryPathsToEmbed.Add(Path.Combine("Pods/", "KSAdSDK/KSAdSDK.xcframework"));
|
||||
dynamicLibraryPathsToEmbed.Add(Path.Combine("Pods/", "StartAppSDK/StartApp.xcframework"));
|
||||
dynamicLibraryPathsToEmbed.Add(Path.Combine("Pods/", "BigoADS/BigoADS/BigoADS.xcframework"));
|
||||
|
||||
30
CHANGELOG.md
30
CHANGELOG.md
@@ -1,3 +1,33 @@
|
||||
# [1.4.17]
|
||||
|
||||
### 修复
|
||||
|
||||
* iOS 导出后处理会把 `AnyThinkSDK.xcframework` 和 `SmartdigimktSDK.xcframework` 加入主 App target 的 Embed Frameworks,避免真机启动时 `UnityFramework.framework` 因缺少动态依赖而加载失败并直接退出。
|
||||
|
||||
### 新增
|
||||
|
||||
* `TopOn 配置` 页签新增 iOS DebugUI Pod 开关,测试包可按需写入 `AnyThinkDebugUISDK 1.0.7`,正式包默认不带调试工具。
|
||||
|
||||
# [1.4.16]
|
||||
|
||||
### 新增
|
||||
|
||||
* 增加 Taku/AnyThink 中国区 iOS Pod 依赖声明,覆盖 core、CSJ、GDT、百度、快手网络。
|
||||
* 同步记录 iOS SDK core 版本 `6.5.45`,让 Integration Manager 能识别当前 iOS 安装状态。
|
||||
|
||||
### 维护
|
||||
|
||||
* 发布包依赖的 `com.foldcc.cc-framework.commercialization` 对齐到 `1.0.16`,并切换为当前可解析的 `18650` Git UPM 地址。
|
||||
* `TopOn 配置` 构建页签在宿主未安装新版构建窗口 API 时自动跳过编译,避免基础框架版本差异导致编辑器编译失败。
|
||||
|
||||
# [1.4.15]
|
||||
|
||||
### 修复
|
||||
|
||||
* Release 默认仍关闭 `com.anythink.sdk:debugger-ui`,但不再把 `com.verbto.tools:util` 当作 DebugUI 附属库排除。
|
||||
* `TopOn 配置` 页签新增独立的 `verbto util` 强制坐标配置,默认强制声明 `com.verbto.tools:util:1.1.3`;后续 Taku 修复后可取消勾选,交给宿主项目自动解析。
|
||||
* Android Gradle 后处理在强制 util 时改写旧的 `com.verbto.tools:util:*` 声明,并只清理非目标版本的本地 util 产物。
|
||||
|
||||
# [1.4.14]
|
||||
|
||||
### 修复
|
||||
|
||||
@@ -16,7 +16,18 @@
|
||||
- `BaseAwardAdKeyValue.value` = 激励视频广告位ID
|
||||
- `BaseInteractionAdKeyValue.value` = 插屏广告位ID
|
||||
3. 打开示例场景 `IAAAdDebugSample.unity`
|
||||
4. 运行到 Android 手机测试
|
||||
4. 运行到 Android 或 iOS 真机测试
|
||||
|
||||
## iOS DebugUI 启用
|
||||
|
||||
1. 在 `Build/Modular Build System` 的 `TopOn 配置` 页签开启 `启用 iOS DebugUI Pod`
|
||||
2. iOS DebugUI 版本保持默认 `1.0.7`
|
||||
3. 导出 Xcode 工程后执行 `pod install --repo-update`
|
||||
4. 在 Taku 后台获取 `SDK Debug Key`
|
||||
5. 在示例配置 `CommonKeyValues` 中设置 `topon.debugger_key=<SDK Debug Key>`
|
||||
6. 真机首次请求 IDFA 时选择允许
|
||||
7. 点击 `Initialize ADManager`
|
||||
8. 点击 `Open DebugUI`
|
||||
|
||||
## 当前默认策略
|
||||
|
||||
@@ -57,6 +68,7 @@
|
||||
- `topon.debug=true` 只用于打开 SDK 调试日志
|
||||
- 不会再因为 debug 模式自动弹出官方 DebugUI
|
||||
- 官方 DebugUI 改为手动点击 `Open DebugUI`
|
||||
- iOS 需要构建期启用 `AnyThinkDebugUISDK` Pod,并配置 `topon.debugger_key`
|
||||
|
||||
## 场景到达测试方式
|
||||
|
||||
|
||||
@@ -13,10 +13,13 @@ namespace Topon_Adapter.Editor
|
||||
{
|
||||
private const string Tag = "[TopOn Build]";
|
||||
private const string DebuggerDependency = "com.anythink.sdk:debugger-ui:+";
|
||||
private const string VerbtoDependency = "com.verbto.tools:util:1.1.3";
|
||||
private const string DebuggerDependencyMarker = "com.anythink.sdk:debugger-ui";
|
||||
private const string VerbtoDependencyMarker = "com.verbto.tools:util";
|
||||
private const string DebuggerRepositoryUrl = "https://jfrog.anythinktech.com/artifactory/debugger";
|
||||
private const string DepsStart = "// TopOn Debugger UI Dependencies Start";
|
||||
private const string DepsEnd = "// TopOn Debugger UI Dependencies End";
|
||||
private const string VerbtoDepsStart = "// TopOn Verbto Util Dependency Start";
|
||||
private const string VerbtoDepsEnd = "// TopOn Verbto Util Dependency End";
|
||||
private const string ReposStart = "// TopOn Debugger UI Repository Start";
|
||||
private const string ReposEnd = "// TopOn Debugger UI Repository End";
|
||||
|
||||
@@ -49,19 +52,25 @@ namespace Topon_Adapter.Editor
|
||||
Path.Combine(gradleRoot, "launcher", "build.gradle"),
|
||||
Path.Combine(gradleRoot, "build.gradle")
|
||||
};
|
||||
var forceVerbtoUtilVersion = settings.forceVerbtoUtilVersion;
|
||||
var verbtoDependency = ToponBuildSettingsStore.GetVerbtoUtilDependency(settings);
|
||||
|
||||
foreach (var gradleFile in gradleFiles)
|
||||
{
|
||||
StripDebuggerFromGradleFile(gradleFile);
|
||||
StripManagedDependenciesFromGradleFile(gradleFile, forceVerbtoUtilVersion);
|
||||
}
|
||||
|
||||
StripDebuggerFromGradleFile(Path.Combine(gradleRoot, "settings.gradle"));
|
||||
StripManagedDependenciesFromGradleFile(Path.Combine(gradleRoot, "settings.gradle"), forceVerbtoUtilVersion);
|
||||
|
||||
if (settings.enableDebuggerUI)
|
||||
if (settings.enableDebuggerUI || forceVerbtoUtilVersion)
|
||||
{
|
||||
InjectRepository(Path.Combine(gradleRoot, "settings.gradle"));
|
||||
InjectRepository(Path.Combine(gradleRoot, "build.gradle"));
|
||||
InjectDependencies(Path.Combine(path, "build.gradle"), settings.forceVerbtoUtilVersion);
|
||||
}
|
||||
|
||||
if (settings.enableDebuggerUI)
|
||||
{
|
||||
InjectDebuggerDependency(Path.Combine(path, "build.gradle"));
|
||||
Debug.Log($"{Tag} DebugUI dependency enabled for this build.");
|
||||
}
|
||||
else
|
||||
@@ -73,6 +82,17 @@ namespace Topon_Adapter.Editor
|
||||
|
||||
Debug.Log($"{Tag} DebugUI dependency disabled for this build.");
|
||||
}
|
||||
|
||||
if (forceVerbtoUtilVersion)
|
||||
{
|
||||
InjectVerbtoUtilDependency(Path.Combine(path, "build.gradle"), verbtoDependency);
|
||||
RemoveGeneratedStaleVerbtoUtilArtifacts(gradleRoot, verbtoDependency);
|
||||
Debug.Log($"{Tag} Verbto util dependency forced to {verbtoDependency}.");
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log($"{Tag} Verbto util dependency is not modified by TopOn build settings.");
|
||||
}
|
||||
}
|
||||
|
||||
private static string GetGradleRoot(string unityLibraryPath)
|
||||
@@ -84,7 +104,7 @@ namespace Topon_Adapter.Editor
|
||||
#endif
|
||||
}
|
||||
|
||||
private static void StripDebuggerFromGradleFile(string filePath)
|
||||
private static void StripManagedDependenciesFromGradleFile(string filePath, bool forceVerbtoUtilVersion)
|
||||
{
|
||||
if (string.IsNullOrEmpty(filePath) || !File.Exists(filePath))
|
||||
{
|
||||
@@ -94,9 +114,13 @@ namespace Topon_Adapter.Editor
|
||||
var content = File.ReadAllText(filePath);
|
||||
var original = content;
|
||||
content = RemoveMarkedBlock(content, DepsStart, DepsEnd);
|
||||
content = RemoveMarkedBlock(content, VerbtoDepsStart, VerbtoDepsEnd);
|
||||
content = RemoveMarkedBlock(content, ReposStart, ReposEnd);
|
||||
content = RemoveDebuggerRepositoryBlocks(content);
|
||||
content = RemoveLinesContaining(content, "com.anythink.sdk:debugger-ui", "com.verbto.tools:util");
|
||||
content = RemoveLinesContaining(content, DebuggerDependencyMarker);
|
||||
if (forceVerbtoUtilVersion)
|
||||
{
|
||||
content = RemoveLinesContaining(content, VerbtoDependencyMarker);
|
||||
}
|
||||
|
||||
if (!string.Equals(original, content, StringComparison.Ordinal))
|
||||
{
|
||||
@@ -104,7 +128,17 @@ namespace Topon_Adapter.Editor
|
||||
}
|
||||
}
|
||||
|
||||
private static void InjectDependencies(string buildGradlePath, bool forceVerbtoUtilVersion)
|
||||
private static void InjectDebuggerDependency(string buildGradlePath)
|
||||
{
|
||||
InjectDependencyBlock(buildGradlePath, DepsStart, DepsEnd, DebuggerDependency);
|
||||
}
|
||||
|
||||
private static void InjectVerbtoUtilDependency(string buildGradlePath, string dependency)
|
||||
{
|
||||
InjectDependencyBlock(buildGradlePath, VerbtoDepsStart, VerbtoDepsEnd, dependency);
|
||||
}
|
||||
|
||||
private static void InjectDependencyBlock(string buildGradlePath, string startMarker, string endMarker, string dependency)
|
||||
{
|
||||
if (!File.Exists(buildGradlePath))
|
||||
{
|
||||
@@ -112,16 +146,17 @@ namespace Topon_Adapter.Editor
|
||||
return;
|
||||
}
|
||||
|
||||
var content = File.ReadAllText(buildGradlePath);
|
||||
var block = new StringBuilder();
|
||||
block.AppendLine(DepsStart);
|
||||
block.AppendLine($" implementation '{DebuggerDependency}'");
|
||||
if (forceVerbtoUtilVersion)
|
||||
if (string.IsNullOrWhiteSpace(dependency))
|
||||
{
|
||||
block.AppendLine($" implementation '{VerbtoDependency}'");
|
||||
Debug.LogWarning($"{Tag} dependency is empty, skip injecting {startMarker}.");
|
||||
return;
|
||||
}
|
||||
|
||||
block.AppendLine($" {DepsEnd}");
|
||||
var content = File.ReadAllText(buildGradlePath);
|
||||
var block = new StringBuilder();
|
||||
block.AppendLine(startMarker);
|
||||
block.AppendLine($" implementation '{dependency.Trim()}'");
|
||||
block.AppendLine($" {endMarker}");
|
||||
|
||||
var pattern = new Regex(@"(dependencies\s*\{)");
|
||||
if (!pattern.IsMatch(content))
|
||||
@@ -142,6 +177,11 @@ namespace Topon_Adapter.Editor
|
||||
}
|
||||
|
||||
var content = File.ReadAllText(gradlePath);
|
||||
if (content.Contains(DebuggerRepositoryUrl))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var block = $"{ReposStart}\n maven {{ url '{DebuggerRepositoryUrl}' }}\n {ReposEnd}";
|
||||
Regex pattern;
|
||||
if (Path.GetFileName(gradlePath).Equals("settings.gradle", StringComparison.OrdinalIgnoreCase))
|
||||
@@ -196,26 +236,47 @@ namespace Topon_Adapter.Editor
|
||||
}
|
||||
}
|
||||
|
||||
private static void RemoveGeneratedStaleVerbtoUtilArtifacts(string gradleRoot, string expectedDependency)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(gradleRoot) || !Directory.Exists(gradleRoot))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var root = Path.GetFullPath(gradleRoot).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
|
||||
foreach (var path in Directory.GetFiles(root, "*", SearchOption.AllDirectories))
|
||||
{
|
||||
var fileName = Path.GetFileName(path);
|
||||
if (!ToponBuildSettingsStore.IsVerbtoUtilArtifactFileName(fileName) ||
|
||||
ToponBuildSettingsStore.IsExpectedVerbtoUtilArtifactFileName(fileName, expectedDependency))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var fullPath = Path.GetFullPath(path);
|
||||
if (!fullPath.StartsWith(root, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
File.Delete(fullPath);
|
||||
Debug.Log($"{Tag} Removed stale verbto util artifact: {fullPath}");
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
Debug.LogWarning($"{Tag} Failed to remove stale verbto util artifact: {exception.Message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static string RemoveMarkedBlock(string content, string startMarker, string endMarker)
|
||||
{
|
||||
var pattern = new Regex($@"\s*{Regex.Escape(startMarker)}[\s\S]*?{Regex.Escape(endMarker)}\s*");
|
||||
return pattern.Replace(content, "\n");
|
||||
}
|
||||
|
||||
private static string RemoveDebuggerRepositoryBlocks(string content)
|
||||
{
|
||||
var escapedUrl = Regex.Escape(DebuggerRepositoryUrl);
|
||||
content = Regex.Replace(
|
||||
content,
|
||||
$@"\r?\n\s*maven\s*\{{\s*url\s*['""]{escapedUrl}['""][^\r\n]*\s*\}}",
|
||||
string.Empty);
|
||||
content = Regex.Replace(
|
||||
content,
|
||||
$@"\r?\n\s*maven\s*\{{\s*\r?\n\s*url\s*['""]{escapedUrl}['""][^\r\n]*\r?\n\s*\}}",
|
||||
string.Empty);
|
||||
return content;
|
||||
}
|
||||
|
||||
private static string RemoveLinesContaining(string content, params string[] markers)
|
||||
{
|
||||
var lines = content.Replace("\r\n", "\n").Replace('\r', '\n').Split('\n');
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Callbacks;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Topon_Adapter.Editor
|
||||
@@ -11,17 +13,23 @@ namespace Topon_Adapter.Editor
|
||||
{
|
||||
public bool enableDebuggerUI = false;
|
||||
public bool forceVerbtoUtilVersion = true;
|
||||
public string verbtoUtilDependency = ToponBuildSettingsStore.DefaultVerbtoUtilDependency;
|
||||
public bool stripResolvedDebuggerArtifacts = true;
|
||||
public bool enableIOSDebuggerUI = false;
|
||||
public string iosDebuggerPodVersion = ToponBuildSettingsStore.DefaultIOSDebuggerPodVersion;
|
||||
}
|
||||
|
||||
internal static class ToponBuildSettingsStore
|
||||
{
|
||||
public const string DefaultVerbtoUtilDependency = "com.verbto.tools:util:1.1.3";
|
||||
public const string IOSDebuggerPodName = "AnyThinkDebugUISDK";
|
||||
public const string DefaultIOSDebuggerPodVersion = "1.0.7";
|
||||
|
||||
private const string ActiveBuildSessionKey = "Commercialization.Topon.ActiveBuildSettings";
|
||||
private const string SettingsFileSuffix = "_topon_build_settings.json";
|
||||
private const string BuildConfigsFolder = "BuildConfigs";
|
||||
private const string DebuggerPackageMarker = "com.anythink.sdk:debugger-ui";
|
||||
private const string VerbtoPackageMarker = "com.verbto.tools:util";
|
||||
private const string DebuggerRepositoryMarker = "jfrog.anythinktech.com/artifactory/debugger";
|
||||
|
||||
[Serializable]
|
||||
private sealed class ActiveBuildSettings
|
||||
@@ -35,6 +43,26 @@ namespace Topon_Adapter.Editor
|
||||
return new ToponBuildSettings();
|
||||
}
|
||||
|
||||
public static string GetVerbtoUtilDependency(ToponBuildSettings settings)
|
||||
{
|
||||
if (settings == null || string.IsNullOrWhiteSpace(settings.verbtoUtilDependency))
|
||||
{
|
||||
return DefaultVerbtoUtilDependency;
|
||||
}
|
||||
|
||||
return settings.verbtoUtilDependency.Trim();
|
||||
}
|
||||
|
||||
public static string GetIOSDebuggerPodVersion(ToponBuildSettings settings)
|
||||
{
|
||||
if (settings == null || string.IsNullOrWhiteSpace(settings.iosDebuggerPodVersion))
|
||||
{
|
||||
return DefaultIOSDebuggerPodVersion;
|
||||
}
|
||||
|
||||
return settings.iosDebuggerPodVersion.Trim();
|
||||
}
|
||||
|
||||
public static ToponBuildSettings LoadForProfileName(string profileName, string repositoryRoot)
|
||||
{
|
||||
var settings = CreateDefault();
|
||||
@@ -47,6 +75,7 @@ namespace Topon_Adapter.Editor
|
||||
try
|
||||
{
|
||||
JsonUtility.FromJsonOverwrite(File.ReadAllText(path), settings);
|
||||
Normalize(settings);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
@@ -62,6 +91,10 @@ namespace Topon_Adapter.Editor
|
||||
{
|
||||
settings = CreateDefault();
|
||||
}
|
||||
else
|
||||
{
|
||||
Normalize(settings);
|
||||
}
|
||||
|
||||
var path = GetSettingsPath(profileName, repositoryRoot);
|
||||
if (string.IsNullOrEmpty(path))
|
||||
@@ -111,6 +144,7 @@ namespace Topon_Adapter.Editor
|
||||
{
|
||||
return CreateDefault();
|
||||
}
|
||||
Normalize(activeSettings.settings);
|
||||
|
||||
var activatedAt = new DateTime(activeSettings.utcTicks, DateTimeKind.Utc);
|
||||
if (DateTime.UtcNow - activatedAt > TimeSpan.FromHours(6))
|
||||
@@ -143,9 +177,35 @@ namespace Topon_Adapter.Editor
|
||||
}
|
||||
|
||||
var content = File.ReadAllText(path);
|
||||
if (content.Contains(DebuggerPackageMarker) ||
|
||||
content.Contains(VerbtoPackageMarker) ||
|
||||
content.Contains(DebuggerRepositoryMarker))
|
||||
if (content.Contains(DebuggerPackageMarker))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool HasUnforcedVerbtoUtilOutput(string repositoryRoot, string expectedDependency)
|
||||
{
|
||||
expectedDependency = NormalizeDependency(expectedDependency);
|
||||
foreach (var path in GetResolverOutputPaths(repositoryRoot))
|
||||
{
|
||||
if (!File.Exists(path))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var content = File.ReadAllText(path);
|
||||
if (content.Contains(VerbtoPackageMarker) && !content.Contains(expectedDependency))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var path in FindResolvedVerbtoUtilArtifacts(repositoryRoot))
|
||||
{
|
||||
if (!IsExpectedVerbtoUtilArtifactFileName(Path.GetFileName(path), expectedDependency))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -180,6 +240,32 @@ namespace Topon_Adapter.Editor
|
||||
return result;
|
||||
}
|
||||
|
||||
public static IReadOnlyList<string> FindResolvedVerbtoUtilArtifacts(string repositoryRoot)
|
||||
{
|
||||
var result = new List<string>();
|
||||
var root = ResolveRepositoryRoot(repositoryRoot);
|
||||
if (string.IsNullOrEmpty(root))
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
var androidPluginPath = Path.Combine(root, "Assets", "Plugins", "Android");
|
||||
if (!Directory.Exists(androidPluginPath))
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
foreach (var path in Directory.GetFiles(androidPluginPath, "*", SearchOption.AllDirectories))
|
||||
{
|
||||
if (IsVerbtoUtilArtifactFileName(Path.GetFileName(path)))
|
||||
{
|
||||
result.Add(path);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
internal static bool IsDebuggerArtifactFileName(string fileName)
|
||||
{
|
||||
if (string.IsNullOrEmpty(fileName))
|
||||
@@ -187,8 +273,33 @@ namespace Topon_Adapter.Editor
|
||||
return false;
|
||||
}
|
||||
|
||||
return fileName.StartsWith("com.anythink.sdk.debugger-ui-", StringComparison.OrdinalIgnoreCase) ||
|
||||
fileName.StartsWith("com.verbto.tools.util-", StringComparison.OrdinalIgnoreCase);
|
||||
return fileName.StartsWith("com.anythink.sdk.debugger-ui-", StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
internal static bool IsVerbtoUtilArtifactFileName(string fileName)
|
||||
{
|
||||
if (string.IsNullOrEmpty(fileName))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return fileName.StartsWith("com.verbto.tools.util-", StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
internal static bool IsExpectedVerbtoUtilArtifactFileName(string fileName, string expectedDependency)
|
||||
{
|
||||
if (!IsVerbtoUtilArtifactFileName(fileName))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var version = GetVersionFromDependency(expectedDependency);
|
||||
if (string.IsNullOrEmpty(version))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return fileName.StartsWith($"com.verbto.tools.util-{version}", StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
private static ToponBuildSettings Clone(ToponBuildSettings settings)
|
||||
@@ -202,10 +313,51 @@ namespace Topon_Adapter.Editor
|
||||
{
|
||||
enableDebuggerUI = settings.enableDebuggerUI,
|
||||
forceVerbtoUtilVersion = settings.forceVerbtoUtilVersion,
|
||||
stripResolvedDebuggerArtifacts = settings.stripResolvedDebuggerArtifacts
|
||||
verbtoUtilDependency = GetVerbtoUtilDependency(settings),
|
||||
stripResolvedDebuggerArtifacts = settings.stripResolvedDebuggerArtifacts,
|
||||
enableIOSDebuggerUI = settings.enableIOSDebuggerUI,
|
||||
iosDebuggerPodVersion = GetIOSDebuggerPodVersion(settings)
|
||||
};
|
||||
}
|
||||
|
||||
private static void Normalize(ToponBuildSettings settings)
|
||||
{
|
||||
if (settings == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
settings.verbtoUtilDependency = NormalizeDependency(settings.verbtoUtilDependency);
|
||||
settings.iosDebuggerPodVersion = NormalizeIOSDebuggerPodVersion(settings.iosDebuggerPodVersion);
|
||||
}
|
||||
|
||||
private static string NormalizeDependency(string dependency)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(dependency))
|
||||
{
|
||||
return DefaultVerbtoUtilDependency;
|
||||
}
|
||||
|
||||
return dependency.Trim();
|
||||
}
|
||||
|
||||
private static string NormalizeIOSDebuggerPodVersion(string version)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(version))
|
||||
{
|
||||
return DefaultIOSDebuggerPodVersion;
|
||||
}
|
||||
|
||||
return version.Trim();
|
||||
}
|
||||
|
||||
private static string GetVersionFromDependency(string dependency)
|
||||
{
|
||||
dependency = NormalizeDependency(dependency);
|
||||
var parts = dependency.Split(':');
|
||||
return parts.Length >= 3 ? parts[parts.Length - 1] : string.Empty;
|
||||
}
|
||||
|
||||
private static IEnumerable<string> GetResolverOutputPaths(string repositoryRoot)
|
||||
{
|
||||
var root = ResolveRepositoryRoot(repositoryRoot);
|
||||
@@ -263,4 +415,196 @@ namespace Topon_Adapter.Editor
|
||||
return new string(chars);
|
||||
}
|
||||
}
|
||||
|
||||
#if UNITY_IOS || UNITY_IPHONE
|
||||
internal static class ToponIOSDebuggerDependencyPostProcessor
|
||||
{
|
||||
private const string Tag = "[TopOn Build]";
|
||||
|
||||
[PostProcessBuild(int.MaxValue)]
|
||||
public static void OnPostProcessBuild(BuildTarget buildTarget, string buildPath)
|
||||
{
|
||||
if (buildTarget != BuildTarget.iOS)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var settings = ToponBuildSettingsStore.GetActiveForCurrentBuild();
|
||||
try
|
||||
{
|
||||
ProcessExportedProject(buildPath, settings);
|
||||
}
|
||||
finally
|
||||
{
|
||||
ToponBuildSettingsStore.ClearActiveBuildSettings();
|
||||
}
|
||||
}
|
||||
|
||||
public static void ProcessExportedProject(string buildPath, ToponBuildSettings settings)
|
||||
{
|
||||
if (settings == null)
|
||||
{
|
||||
settings = ToponBuildSettingsStore.CreateDefault();
|
||||
}
|
||||
|
||||
var podfilePath = Path.Combine(buildPath, "Podfile");
|
||||
if (!File.Exists(podfilePath))
|
||||
{
|
||||
if (settings.enableIOSDebuggerUI)
|
||||
{
|
||||
Debug.LogWarning($"{Tag} Podfile not found, cannot add {ToponBuildSettingsStore.IOSDebuggerPodName}: {podfilePath}");
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
var content = File.ReadAllText(podfilePath);
|
||||
var updated = RewritePodfile(content, settings);
|
||||
if (!string.Equals(content, updated, StringComparison.Ordinal))
|
||||
{
|
||||
File.WriteAllText(podfilePath, updated);
|
||||
}
|
||||
|
||||
if (settings.enableIOSDebuggerUI)
|
||||
{
|
||||
Debug.Log($"{Tag} iOS DebugUI pod enabled: {ToponBuildSettingsStore.IOSDebuggerPodName} {ToponBuildSettingsStore.GetIOSDebuggerPodVersion(settings)}.");
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log($"{Tag} iOS DebugUI pod disabled for this build.");
|
||||
}
|
||||
}
|
||||
|
||||
private static string RewritePodfile(string content, ToponBuildSettings settings)
|
||||
{
|
||||
var newline = content.Contains("\r\n") ? "\r\n" : "\n";
|
||||
var lines = new List<string>(content.Replace("\r\n", "\n").Replace('\r', '\n').Split('\n'));
|
||||
|
||||
for (var i = lines.Count - 1; i >= 0; i--)
|
||||
{
|
||||
if (IsDebuggerPodLine(lines[i]))
|
||||
{
|
||||
lines.RemoveAt(i);
|
||||
}
|
||||
}
|
||||
|
||||
if (settings.enableIOSDebuggerUI)
|
||||
{
|
||||
InsertDebuggerPod(lines, ToponBuildSettingsStore.GetIOSDebuggerPodVersion(settings));
|
||||
}
|
||||
|
||||
return string.Join(newline, lines);
|
||||
}
|
||||
|
||||
private static bool IsDebuggerPodLine(string line)
|
||||
{
|
||||
return Regex.IsMatch(line ?? string.Empty,
|
||||
@"^\s*pod\s+['""]" + ToponBuildSettingsStore.IOSDebuggerPodName + @"['""]",
|
||||
RegexOptions.CultureInvariant);
|
||||
}
|
||||
|
||||
private static void InsertDebuggerPod(List<string> lines, string version)
|
||||
{
|
||||
var targetRange = FindTargetRange(lines, "UnityFramework");
|
||||
if (targetRange.start < 0)
|
||||
{
|
||||
targetRange = FindTargetRange(lines, "Unity-iPhone");
|
||||
}
|
||||
|
||||
if (targetRange.start >= 0)
|
||||
{
|
||||
var indent = ResolvePodIndent(lines, targetRange);
|
||||
var podLine = $"{indent}pod '{ToponBuildSettingsStore.IOSDebuggerPodName}', '{version}'";
|
||||
lines.Insert(ResolvePodInsertIndex(lines, targetRange), podLine);
|
||||
return;
|
||||
}
|
||||
|
||||
if (lines.Count > 0 && !string.IsNullOrWhiteSpace(lines[lines.Count - 1]))
|
||||
{
|
||||
lines.Add(string.Empty);
|
||||
}
|
||||
|
||||
lines.Add("target 'UnityFramework' do");
|
||||
lines.Add($" pod '{ToponBuildSettingsStore.IOSDebuggerPodName}', '{version}'");
|
||||
lines.Add("end");
|
||||
}
|
||||
|
||||
private static (int start, int end) FindTargetRange(List<string> lines, string targetName)
|
||||
{
|
||||
var targetPattern = new Regex(@"^\s*target\s+['""]" + Regex.Escape(targetName) + @"['""]\s+do\b",
|
||||
RegexOptions.CultureInvariant);
|
||||
|
||||
for (var i = 0; i < lines.Count; i++)
|
||||
{
|
||||
if (!targetPattern.IsMatch(lines[i] ?? string.Empty))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var depth = 0;
|
||||
for (var j = i; j < lines.Count; j++)
|
||||
{
|
||||
var line = StripComment(lines[j]);
|
||||
if (Regex.IsMatch(line, @"\bdo\b", RegexOptions.CultureInvariant))
|
||||
{
|
||||
depth++;
|
||||
}
|
||||
|
||||
if (Regex.IsMatch(line, @"^\s*end\s*$", RegexOptions.CultureInvariant))
|
||||
{
|
||||
depth--;
|
||||
if (depth <= 0)
|
||||
{
|
||||
return (i, j);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (i, lines.Count);
|
||||
}
|
||||
|
||||
return (-1, -1);
|
||||
}
|
||||
|
||||
private static int ResolvePodInsertIndex(List<string> lines, (int start, int end) targetRange)
|
||||
{
|
||||
var insertIndex = targetRange.start + 1;
|
||||
for (var i = targetRange.start + 1; i < targetRange.end && i < lines.Count; i++)
|
||||
{
|
||||
if (Regex.IsMatch(lines[i] ?? string.Empty, @"^\s*pod\s+", RegexOptions.CultureInvariant))
|
||||
{
|
||||
insertIndex = i + 1;
|
||||
}
|
||||
}
|
||||
|
||||
return insertIndex;
|
||||
}
|
||||
|
||||
private static string ResolvePodIndent(List<string> lines, (int start, int end) targetRange)
|
||||
{
|
||||
for (var i = targetRange.start + 1; i < targetRange.end && i < lines.Count; i++)
|
||||
{
|
||||
var match = Regex.Match(lines[i] ?? string.Empty, @"^(\s*)pod\s+", RegexOptions.CultureInvariant);
|
||||
if (match.Success)
|
||||
{
|
||||
return match.Groups[1].Value;
|
||||
}
|
||||
}
|
||||
|
||||
var targetIndent = Regex.Match(lines[targetRange.start] ?? string.Empty, @"^(\s*)", RegexOptions.CultureInvariant).Value;
|
||||
return targetIndent + " ";
|
||||
}
|
||||
|
||||
private static string StripComment(string line)
|
||||
{
|
||||
if (string.IsNullOrEmpty(line))
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
var commentIndex = line.IndexOf('#');
|
||||
return commentIndex >= 0 ? line.Substring(0, commentIndex) : line;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#if TOPON_HAS_CC_FRAMEWORK_COMMON_BUILD_WINDOW
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -31,25 +32,46 @@ namespace Topon_Adapter.Editor
|
||||
|
||||
EditorGUILayout.LabelField("TopOn Android 调试工具", EditorStyles.boldLabel);
|
||||
EditorGUILayout.HelpBox(
|
||||
"正式 release 默认关闭 DebugUI。关闭后构建后处理会剔除 debugger-ui 及其诊断库,避免 anr_data.db 降级崩溃。",
|
||||
"Android 正式 release 默认关闭 DebugUI。verbto util 独立控制,默认强制指定到 1.1.3,避免回落到存在数据库降级风险的旧版本。",
|
||||
MessageType.Info);
|
||||
|
||||
EditorGUI.BeginChangeCheck();
|
||||
settings.enableDebuggerUI = EditorGUILayout.Toggle(
|
||||
new GUIContent("启用 DebugUI 依赖", "仅用于开发/测试包;正式 release 应保持关闭。"),
|
||||
new GUIContent("启用 Android DebugUI 依赖", "仅用于开发/测试包;正式 release 应保持关闭。"),
|
||||
settings.enableDebuggerUI);
|
||||
|
||||
using (new EditorGUI.DisabledScope(!settings.enableDebuggerUI))
|
||||
settings.forceVerbtoUtilVersion = EditorGUILayout.Toggle(
|
||||
new GUIContent("强制指定 verbto util", "无论 DebugUI 是否启用,都声明下方的 com.verbto.tools:util 坐标;取消勾选后交给 Taku/宿主项目自动处理。"),
|
||||
settings.forceVerbtoUtilVersion);
|
||||
|
||||
using (new EditorGUI.DisabledScope(!settings.forceVerbtoUtilVersion))
|
||||
{
|
||||
settings.forceVerbtoUtilVersion = EditorGUILayout.Toggle(
|
||||
new GUIContent("强制 util 1.1.3", "启用 DebugUI 时同时声明 com.verbto.tools:util:1.1.3,避免回落到 1.0.6。"),
|
||||
settings.forceVerbtoUtilVersion);
|
||||
settings.verbtoUtilDependency = EditorGUILayout.TextField(
|
||||
new GUIContent("util 坐标", "默认 com.verbto.tools:util:1.1.3;Taku 修复后可取消强制指定。"),
|
||||
ToponBuildSettingsStore.GetVerbtoUtilDependency(settings));
|
||||
}
|
||||
|
||||
settings.stripResolvedDebuggerArtifacts = EditorGUILayout.Toggle(
|
||||
new GUIContent("禁用时剔除旧产物", "关闭 DebugUI 时,从生成的 Gradle 工程中删除旧 Resolver 带入的 debugger-ui/util AAR。"),
|
||||
new GUIContent("禁用时剔除 DebugUI 旧产物", "关闭 DebugUI 时,从生成的 Gradle 工程中删除旧 Resolver 带入的 debugger-ui AAR;不会把 verbto util 当作 DebugUI 一起剔除。"),
|
||||
settings.stripResolvedDebuggerArtifacts);
|
||||
|
||||
EditorGUILayout.Space(6);
|
||||
EditorGUILayout.LabelField("TopOn iOS 调试工具", EditorStyles.boldLabel);
|
||||
EditorGUILayout.HelpBox(
|
||||
"iOS DebugUI 通过导出后的 Podfile 写入 AnyThinkDebugUISDK。当前 Taku iOS SDK 6.5.45 对应 DebugUI 1.0.7;正式 release 应保持关闭。",
|
||||
MessageType.Info);
|
||||
|
||||
settings.enableIOSDebuggerUI = EditorGUILayout.Toggle(
|
||||
new GUIContent("启用 iOS DebugUI Pod", "仅用于开发/测试包;启用后导出工程 Podfile 会写入 AnyThinkDebugUISDK。"),
|
||||
settings.enableIOSDebuggerUI);
|
||||
|
||||
using (new EditorGUI.DisabledScope(!settings.enableIOSDebuggerUI))
|
||||
{
|
||||
settings.iosDebuggerPodVersion = EditorGUILayout.TextField(
|
||||
new GUIContent("iOS DebugUI 版本", "Taku iOS SDK 6.5.45 推荐 AnyThinkDebugUISDK 1.0.7。"),
|
||||
ToponBuildSettingsStore.GetIOSDebuggerPodVersion(settings));
|
||||
}
|
||||
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
ToponBuildSettingsStore.SaveForProfileName(profile.profileName, context.repositoryRoot, settings);
|
||||
@@ -58,11 +80,29 @@ namespace Topon_Adapter.Editor
|
||||
EditorGUILayout.Space(6);
|
||||
if (settings.enableDebuggerUI)
|
||||
{
|
||||
EditorGUILayout.HelpBox("当前配置会把 TopOn DebugUI 打进 Android 构建;请不要用于正式 release。", MessageType.Warning);
|
||||
EditorGUILayout.HelpBox("当前配置会把 TopOn Android DebugUI 打进 Android 构建;请不要用于正式 release。", MessageType.Warning);
|
||||
}
|
||||
else
|
||||
{
|
||||
EditorGUILayout.HelpBox("当前配置不会打包 TopOn DebugUI。", MessageType.None);
|
||||
EditorGUILayout.HelpBox("当前配置不会打包 TopOn Android DebugUI。", MessageType.None);
|
||||
}
|
||||
|
||||
if (settings.enableIOSDebuggerUI)
|
||||
{
|
||||
EditorGUILayout.HelpBox($"当前配置会在 iOS Podfile 写入 {ToponBuildSettingsStore.IOSDebuggerPodName} {ToponBuildSettingsStore.GetIOSDebuggerPodVersion(settings)};请不要用于正式 release。", MessageType.Warning);
|
||||
}
|
||||
else
|
||||
{
|
||||
EditorGUILayout.HelpBox("当前配置不会打包 TopOn iOS DebugUI。", MessageType.None);
|
||||
}
|
||||
|
||||
if (settings.forceVerbtoUtilVersion)
|
||||
{
|
||||
EditorGUILayout.HelpBox($"当前会强制声明 {ToponBuildSettingsStore.GetVerbtoUtilDependency(settings)}。", MessageType.None);
|
||||
}
|
||||
else
|
||||
{
|
||||
EditorGUILayout.HelpBox("当前不会干预 verbto util 版本,由 Taku/宿主项目依赖解析决定。", MessageType.Info);
|
||||
}
|
||||
|
||||
DrawResolverStatus(context);
|
||||
@@ -82,15 +122,28 @@ namespace Topon_Adapter.Editor
|
||||
var report = BuildWindowExtensionReport.Pass();
|
||||
if (settings.enableDebuggerUI)
|
||||
{
|
||||
report.AddMessage("TopOn DebugUI 已启用。");
|
||||
report.AddMessage("TopOn Android DebugUI 已启用。");
|
||||
if (!profile.isDevelopment)
|
||||
{
|
||||
report.AddWarning("当前不是 Development Build,请确认该配置不是正式 release。");
|
||||
report.AddWarning("Android DebugUI 已启用,但当前不是 Development Build,请确认该配置不是正式 release。");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
report.AddMessage("TopOn DebugUI 已关闭,构建产物会剔除 debugger-ui/util 诊断库。");
|
||||
report.AddMessage("TopOn Android DebugUI 已关闭,构建产物不会打包 debugger-ui。");
|
||||
}
|
||||
|
||||
if (settings.enableIOSDebuggerUI)
|
||||
{
|
||||
report.AddMessage($"TopOn iOS DebugUI 已启用,将写入 {ToponBuildSettingsStore.IOSDebuggerPodName} {ToponBuildSettingsStore.GetIOSDebuggerPodVersion(settings)}。");
|
||||
if (!profile.isDevelopment)
|
||||
{
|
||||
report.AddWarning("iOS DebugUI 已启用,但当前不是 Development Build,请确认该配置不是正式 release。");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
report.AddMessage("TopOn iOS DebugUI 已关闭,导出工程不会写入 AnyThinkDebugUISDK。");
|
||||
}
|
||||
|
||||
if (!settings.enableDebuggerUI && ToponBuildSettingsStore.HasStaleDebuggerResolverOutput(context.repositoryRoot))
|
||||
@@ -98,6 +151,20 @@ namespace Topon_Adapter.Editor
|
||||
report.AddWarning("检测到旧 Resolver 输出仍包含 TopOn DebugUI;本次构建会在生成 Gradle 后剔除,建议后续重新 Resolve。");
|
||||
}
|
||||
|
||||
if (settings.forceVerbtoUtilVersion)
|
||||
{
|
||||
var dependency = ToponBuildSettingsStore.GetVerbtoUtilDependency(settings);
|
||||
report.AddMessage($"TopOn 将强制声明 {dependency}。");
|
||||
if (ToponBuildSettingsStore.HasUnforcedVerbtoUtilOutput(context.repositoryRoot, dependency))
|
||||
{
|
||||
report.AddWarning($"检测到旧 Resolver 输出或本地 AAR 可能不是 {dependency};本次构建会在生成 Gradle 后改写为强制版本。");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
report.AddMessage("TopOn 不干预 verbto util 版本。");
|
||||
}
|
||||
|
||||
return report;
|
||||
}
|
||||
|
||||
@@ -108,13 +175,30 @@ namespace Topon_Adapter.Editor
|
||||
|
||||
private static void DrawResolverStatus(BuildWindowExtensionContext context)
|
||||
{
|
||||
var hasStaleOutput = ToponBuildSettingsStore.HasStaleDebuggerResolverOutput(context.repositoryRoot);
|
||||
var artifacts = ToponBuildSettingsStore.FindResolvedDebuggerArtifacts(context.repositoryRoot);
|
||||
var profile = context?.profile;
|
||||
var settings = profile == null
|
||||
? ToponBuildSettingsStore.CreateDefault()
|
||||
: ToponBuildSettingsStore.LoadForProfileName(profile.profileName, context.repositoryRoot);
|
||||
var dependency = ToponBuildSettingsStore.GetVerbtoUtilDependency(settings);
|
||||
var hasStaleDebuggerOutput = ToponBuildSettingsStore.HasStaleDebuggerResolverOutput(context.repositoryRoot);
|
||||
var hasUnforcedUtilOutput = ToponBuildSettingsStore.HasUnforcedVerbtoUtilOutput(context.repositoryRoot, dependency);
|
||||
var debuggerArtifacts = ToponBuildSettingsStore.FindResolvedDebuggerArtifacts(context.repositoryRoot);
|
||||
var utilArtifacts = ToponBuildSettingsStore.FindResolvedVerbtoUtilArtifacts(context.repositoryRoot);
|
||||
|
||||
EditorGUILayout.Space(6);
|
||||
EditorGUILayout.LabelField("本地依赖状态", EditorStyles.boldLabel);
|
||||
EditorGUILayout.LabelField("旧 Resolver 输出", hasStaleOutput ? "检测到 debugger-ui/util" : "未检测到");
|
||||
EditorGUILayout.LabelField("已解析 AAR/JAR", artifacts.Count == 0 ? "未检测到" : $"{artifacts.Count} 个");
|
||||
EditorGUILayout.LabelField("旧 DebugUI 输出", hasStaleDebuggerOutput ? "检测到 debugger-ui" : "未检测到");
|
||||
EditorGUILayout.LabelField("Android DebugUI AAR/JAR", debuggerArtifacts.Count == 0 ? "未检测到" : $"{debuggerArtifacts.Count} 个");
|
||||
EditorGUILayout.LabelField("verbto util 强制", settings.forceVerbtoUtilVersion ? dependency : "自动/不干预");
|
||||
EditorGUILayout.LabelField("verbto util 本地产物", utilArtifacts.Count == 0 ? "未检测到" : $"{utilArtifacts.Count} 个");
|
||||
EditorGUILayout.LabelField("iOS DebugUI Pod", settings.enableIOSDebuggerUI
|
||||
? $"{ToponBuildSettingsStore.IOSDebuggerPodName} {ToponBuildSettingsStore.GetIOSDebuggerPodVersion(settings)}"
|
||||
: "关闭");
|
||||
if (settings.forceVerbtoUtilVersion && hasUnforcedUtilOutput)
|
||||
{
|
||||
EditorGUILayout.HelpBox("检测到本地/Resolver 中存在非强制版本的 verbto util;Android Gradle 工程生成后会改写依赖,并清理旧版本本地产物。", MessageType.Warning);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -16,6 +16,12 @@
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"versionDefines": [
|
||||
{
|
||||
"name": "com.foldcc.cc-framework.common",
|
||||
"expression": "[1.0.5,)",
|
||||
"define": "TOPON_HAS_CC_FRAMEWORK_COMMON_BUILD_WINDOW"
|
||||
}
|
||||
],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
"name": "com.commercialization.topon",
|
||||
"displayName": "Commercialization.topon",
|
||||
"description": "基于topon的广告sdk封装,依赖基础商业化模块",
|
||||
"version": "1.4.14",
|
||||
"version": "1.4.17",
|
||||
"unity": "2021.1",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "http://private.lightyears.ltd:18640/foldcc/Commercialization.topon"
|
||||
"url": "http://private.lightyears.ltd:18650/foldcc/Commercialization.topon.git"
|
||||
},
|
||||
"author": {
|
||||
"name": "foldcc",
|
||||
@@ -16,7 +16,7 @@
|
||||
},
|
||||
"dependencies":
|
||||
{
|
||||
"com.foldcc.cc-framework.commercialization" : "http://private.lightyears.ltd:18640/foldcc/CC-Framework.Commercialization.git#1.0.14"
|
||||
"com.foldcc.cc-framework.commercialization" : "http://private.lightyears.ltd:18650/foldcc/CC-Framework.Commercialization.git#1.0.16"
|
||||
},
|
||||
"samples": [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user