Skip to content

Commit 0ef6959

Browse files
committed
定位日志
1 parent 837ceda commit 0ef6959

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

unity/nuget/build/Program.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,23 +276,30 @@ public override void Run(BuildContext context)
276276
// For Python, we need to flatten the directory structure
277277
if (projectItem.DotNetNativeName == "Python")
278278
{
279+
context.Log.Information($"Processing Python files from: {nativeAssetsPath.FullPath}");
280+
context.Log.Information($"Total files found: {files.Count()}");
281+
279282
foreach (var file in files)
280283
{
281284
var relativePath = file.FullPath.Substring(nativeAssetsPath.FullPath.Length + 1);
282285
var fileName = System.IO.Path.GetFileName(file.FullPath);
283286
var fileExtension = System.IO.Path.GetExtension(fileName).ToLowerInvariant();
284287

288+
// Normalize path separators for comparison
289+
var normalizedRelativePath = relativePath.Replace('\\', '/');
290+
285291
// Check if file is in lib/ subdirectory
286-
var isInLibDir = relativePath.StartsWith("lib" + System.IO.Path.DirectorySeparatorChar) ||
287-
relativePath.StartsWith("lib/");
292+
var isInLibDir = normalizedRelativePath.StartsWith("lib/");
293+
294+
context.Log.Information($"File: {relativePath}, Extension: {fileExtension}, InLibDir: {isInLibDir}");
288295

289296
// Flatten: move .so/.dylib files from lib/ to root, keep python3.x/ structure
290297
if (isInLibDir && (fileExtension == ".so" || fileExtension == ".dylib"))
291298
{
292299
// Move shared libraries to root directory
293300
var targetFile = System.IO.Path.Combine(targetDirectory.FullPath, fileName);
294301
context.CopyFile(file, targetFile);
295-
context.Log.Information($"Flattened: {relativePath} -> {fileName}");
302+
context.Log.Information($"Flattened: {relativePath} -> {fileName}");
296303
}
297304
else
298305
{

0 commit comments

Comments
 (0)