From d62096a02e299e4949ff69fbd72e79a8db376b8d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 8 Nov 2025 03:49:55 +0000 Subject: [PATCH 1/3] Initial plan From 9755637cfdea899477b96dfc4df00ad96c829670 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 8 Nov 2025 03:58:53 +0000 Subject: [PATCH 2/3] Change default resource directory from Resources to Assets Co-authored-by: Soar360 <15421284+Soar360@users.noreply.github.com> --- .../ResourcePackerTask.cs | 2 +- .../build/LuYao.ResourcePacker.MSBuild.props | 2 +- .../ResourcePackageGenerator.cs | 8 ++++---- README.md | 12 +++++++----- .../{Resources => Assets}/config.json | 0 .../{Resources => Assets}/message.json | 0 .../{Resources => Assets}/template.html | 0 examples/ExampleProject/ExampleProject.csproj | 6 +++--- examples/ExampleProject/README.md | 18 +++++++++--------- .../{Resources => Assets}/test.txt | 0 examples/Lib1.Ns2.Ns3/Lib1.Ns2.Ns3.csproj | 6 +++--- examples/Lib1/{Resources => Assets}/test.txt | 0 examples/Lib1/Lib1.csproj | 6 +++--- examples/Lib2/{Resources => Assets}/test.txt | 0 examples/Lib2/Lib2.csproj | 6 +++--- examples/Lib3/{Resources => Assets}/test.txt | 0 examples/Lib3/Lib3.csproj | 6 +++--- .../{Resources => Assets}/config.json | 0 .../{Resources => Assets}/message.txt | 0 .../NuGetReferenceExample.csproj | 6 +++--- examples/NuGetReferenceExample/README.md | 9 ++++----- .../{Resources => Assets}/config.json | 0 .../{Resources => Assets}/sample.txt | 0 examples/RootNamespaceTest/README.md | 2 +- .../RootNamespaceTest/RootNamespaceTest.csproj | 6 +++--- 25 files changed, 48 insertions(+), 47 deletions(-) rename examples/ExampleProject/{Resources => Assets}/config.json (100%) rename examples/ExampleProject/{Resources => Assets}/message.json (100%) rename examples/ExampleProject/{Resources => Assets}/template.html (100%) rename examples/Lib1.Ns2.Ns3/{Resources => Assets}/test.txt (100%) rename examples/Lib1/{Resources => Assets}/test.txt (100%) rename examples/Lib2/{Resources => Assets}/test.txt (100%) rename examples/Lib3/{Resources => Assets}/test.txt (100%) rename examples/NuGetReferenceExample/{Resources => Assets}/config.json (100%) rename examples/NuGetReferenceExample/{Resources => Assets}/message.txt (100%) rename examples/RootNamespaceTest/{Resources => Assets}/config.json (100%) rename examples/RootNamespaceTest/{Resources => Assets}/sample.txt (100%) diff --git a/LuYao.ResourcePacker.MSBuild/ResourcePackerTask.cs b/LuYao.ResourcePacker.MSBuild/ResourcePackerTask.cs index b09f3ae..3302022 100644 --- a/LuYao.ResourcePacker.MSBuild/ResourcePackerTask.cs +++ b/LuYao.ResourcePacker.MSBuild/ResourcePackerTask.cs @@ -16,7 +16,7 @@ public class ResourcePackerTask : Task [Required] public string AssemblyName { get; set; } - public string ResourceDirectory { get; set; } = "Resources"; + public string ResourceDirectory { get; set; } = "Assets"; public string OutputFileName { get; set; } diff --git a/LuYao.ResourcePacker.MSBuild/build/LuYao.ResourcePacker.MSBuild.props b/LuYao.ResourcePacker.MSBuild/build/LuYao.ResourcePacker.MSBuild.props index de588e6..a1c0ad3 100644 --- a/LuYao.ResourcePacker.MSBuild/build/LuYao.ResourcePacker.MSBuild.props +++ b/LuYao.ResourcePacker.MSBuild/build/LuYao.ResourcePacker.MSBuild.props @@ -2,7 +2,7 @@ true - Resources + Assets diff --git a/LuYao.ResourcePacker.SourceGenerator/ResourcePackageGenerator.cs b/LuYao.ResourcePacker.SourceGenerator/ResourcePackageGenerator.cs index 6e977a8..91c8582 100644 --- a/LuYao.ResourcePacker.SourceGenerator/ResourcePackageGenerator.cs +++ b/LuYao.ResourcePacker.SourceGenerator/ResourcePackageGenerator.cs @@ -39,7 +39,7 @@ private static void Execute(SourceProductionContext context, Compilation compila System.Collections.Immutable.ImmutableArray resourceFiles, AnalyzerConfigOptionsProvider configOptions) { - // Get the resource directory from analyzer config (default to "Resources") + // Get the resource directory from analyzer config (default to "Assets") var resourceDirectory = GetResourceDirectory(configOptions); // Filter additional files to only include those in the resource directory @@ -108,8 +108,8 @@ private static string GetResourceDirectory(AnalyzerConfigOptionsProvider configO } } - // Default to "Resources" - return "Resources"; + // Default to "Assets" + return "Assets"; } private static bool IsInResourceDirectory(string filePath, string resourceDirectory) @@ -124,7 +124,7 @@ private static bool IsInResourceDirectory(string filePath, string resourceDirect var normalizedDir = resourceDirectory.Replace('\\', '/'); // Check if the file path contains the resource directory - // Handle both "Resources" and "Resources/" formats + // Handle both with and without trailing slash (e.g., "Assets" and "Assets/") return normalizedPath.Contains($"/{normalizedDir}/") || normalizedPath.EndsWith($"/{normalizedDir}"); } diff --git a/README.md b/README.md index dcb33d9..0b98372 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ LuYao.ResourcePacker is a .NET library for packaging and accessing resource file - Pack multiple resource files into a single .dat file during build - **Intelligent tiered compression with GZip** - automatic compression with sampling for optimal space/performance -- Directory-based resource scanning (default: Resources directory) +- Directory-based resource scanning (default: Assets directory) - MSBuild integration - Simple runtime API for resource access - Async support @@ -35,9 +35,9 @@ dotnet add package LuYao.ResourcePacker ### 1. Basic Setup -Place your resource files in the `Resources` directory: +Place your resource files in the `Assets` directory: ``` -Resources/ +Assets/ ├── message.json ├── config.txt └── template.html @@ -45,6 +45,8 @@ Resources/ The resources will be automatically packed into a .dat file during build. +> **Note**: The default directory was changed from `Resources` to `Assets` to avoid conflicts with C# .resx files, which typically use the `Resources` directory. If you prefer to use `Resources` or any other directory name, you can configure it in your .csproj file (see Configuration section below). + ### 2. Runtime Access - Original API Access resources at runtime using the `ResourcePackageReader`: @@ -106,8 +108,8 @@ In your .csproj file: true - - Resources + + Assets $(AssemblyName).dat diff --git a/examples/ExampleProject/Resources/config.json b/examples/ExampleProject/Assets/config.json similarity index 100% rename from examples/ExampleProject/Resources/config.json rename to examples/ExampleProject/Assets/config.json diff --git a/examples/ExampleProject/Resources/message.json b/examples/ExampleProject/Assets/message.json similarity index 100% rename from examples/ExampleProject/Resources/message.json rename to examples/ExampleProject/Assets/message.json diff --git a/examples/ExampleProject/Resources/template.html b/examples/ExampleProject/Assets/template.html similarity index 100% rename from examples/ExampleProject/Resources/template.html rename to examples/ExampleProject/Assets/template.html diff --git a/examples/ExampleProject/ExampleProject.csproj b/examples/ExampleProject/ExampleProject.csproj index 844c60e..ee8dcd8 100644 --- a/examples/ExampleProject/ExampleProject.csproj +++ b/examples/ExampleProject/ExampleProject.csproj @@ -6,7 +6,7 @@ enable enable true - Resources + Assets $(AssemblyName).dat false @@ -20,7 +20,7 @@ - + - + diff --git a/examples/ExampleProject/README.md b/examples/ExampleProject/README.md index 0589b01..cfc5d0b 100644 --- a/examples/ExampleProject/README.md +++ b/examples/ExampleProject/README.md @@ -6,7 +6,7 @@ This is a console application demonstrating how to use the LuYao.ResourcePacker ## What This Example Demonstrates -1. **Resource File Setup**: Place resource files in a `Resources` folder with the `.res.` pattern in the filename (e.g., `message.res.json`, `config.res.json`, `template.res.html`) +1. **Resource File Setup**: Place resource files in an `Assets` folder (e.g., `message.json`, `config.json`, `template.html`) 2. **Automatic Build-Time Packing**: During build, all `.res.*` files are automatically packed into a single `.dat` file @@ -18,10 +18,10 @@ This is a console application demonstrating how to use the LuYao.ResourcePacker ExampleProject/ ├── ExampleProject.csproj # Project configuration with ResourcePacker integration ├── Program.cs # Main application demonstrating resource access -├── Resources/ # Directory containing resource files -│ ├── message.res.json # JSON resource with greeting and features -│ ├── config.res.json # JSON resource with configuration -│ └── template.res.html # HTML template resource +├── Assets/ # Directory containing resource files +│ ├── message.json # JSON resource with greeting and features +│ ├── config.json # JSON resource with configuration +│ └── template.html # HTML template resource └── README.md # This file ``` @@ -44,8 +44,8 @@ ExampleProject/ ## What Happens During Build -1. The MSBuild integration scans for files matching the pattern `*.res.*` -2. All matching files are packed into `ExampleProject.dat` +1. The MSBuild integration scans for files in the `Assets` directory +2. All files are packed into `ExampleProject.dat` 3. The `.dat` file is copied to the output directory 4. At runtime, the application reads resources from the `.dat` file @@ -101,7 +101,7 @@ If you're creating your own project using LuYao.ResourcePacker, follow these ste dotnet add package LuYao.ResourcePacker ``` -2. Add resource files with the `.res.` pattern to your project +2. Add resource files to the `Assets` directory in your project 3. The MSBuild integration will automatically pack your resources during build @@ -119,7 +119,7 @@ The example project uses the following MSBuild properties in `ExampleProject.csp ``` You can also customize: -- `ResourcePackerPattern` - Custom file pattern (default: `*.res.*`) +- `ResourcePackerDirectory` - Custom resource directory (default: `Assets`) - `ResourcePackerOutputFileName` - Custom output filename (default: `$(AssemblyName).dat`) ## Learn More diff --git a/examples/Lib1.Ns2.Ns3/Resources/test.txt b/examples/Lib1.Ns2.Ns3/Assets/test.txt similarity index 100% rename from examples/Lib1.Ns2.Ns3/Resources/test.txt rename to examples/Lib1.Ns2.Ns3/Assets/test.txt diff --git a/examples/Lib1.Ns2.Ns3/Lib1.Ns2.Ns3.csproj b/examples/Lib1.Ns2.Ns3/Lib1.Ns2.Ns3.csproj index 0a6e300..043718e 100644 --- a/examples/Lib1.Ns2.Ns3/Lib1.Ns2.Ns3.csproj +++ b/examples/Lib1.Ns2.Ns3/Lib1.Ns2.Ns3.csproj @@ -6,7 +6,7 @@ enable false true - Resources + Assets @@ -18,12 +18,12 @@ - + - + diff --git a/examples/Lib1/Resources/test.txt b/examples/Lib1/Assets/test.txt similarity index 100% rename from examples/Lib1/Resources/test.txt rename to examples/Lib1/Assets/test.txt diff --git a/examples/Lib1/Lib1.csproj b/examples/Lib1/Lib1.csproj index db6ffd0..1ee0913 100644 --- a/examples/Lib1/Lib1.csproj +++ b/examples/Lib1/Lib1.csproj @@ -6,7 +6,7 @@ enable false true - Resources + Assets @@ -18,12 +18,12 @@ - + - + diff --git a/examples/Lib2/Resources/test.txt b/examples/Lib2/Assets/test.txt similarity index 100% rename from examples/Lib2/Resources/test.txt rename to examples/Lib2/Assets/test.txt diff --git a/examples/Lib2/Lib2.csproj b/examples/Lib2/Lib2.csproj index 6610d37..bc15448 100644 --- a/examples/Lib2/Lib2.csproj +++ b/examples/Lib2/Lib2.csproj @@ -6,7 +6,7 @@ enable false true - Resources + Assets @@ -19,12 +19,12 @@ - + - + enable false true - Resources + Assets @@ -19,12 +19,12 @@ - + - + enable enable true - Resources + Assets $(AssemblyName).dat false @@ -20,7 +20,7 @@ - + - + diff --git a/examples/NuGetReferenceExample/README.md b/examples/NuGetReferenceExample/README.md index 302ebe7..edefd22 100644 --- a/examples/NuGetReferenceExample/README.md +++ b/examples/NuGetReferenceExample/README.md @@ -15,9 +15,8 @@ Alternatively, use the published NuGet package version once available. NuGetReferenceExample/ ├── NuGetReferenceExample.csproj # Project file with NuGet package reference ├── Program.cs # Application code -├── Resources/ -│ ├── config.res.json # Resource file (JSON) -│ └── message.res.txt # Resource file (text) +├── Assets/ +│ └── config.json # Resource file (JSON) └── README.md ``` @@ -29,11 +28,11 @@ NuGetReferenceExample/ 2. **Automatic Build Integration**: The MSBuild targets and props files are automatically imported by NuGet, so you don't need to manually configure any build tasks. -3. **Resource Naming Convention**: Files matching the pattern `*.res.*` are automatically packed into a `.dat` file during build. +3. **Resource Directory**: Files in the `Assets` directory are automatically packed into a `.dat` file during build. 4. **Configuration**: You can customize the behavior using MSBuild properties: - `ResourcePackerEnabled`: Enable/disable resource packing (default: `true`) - - `ResourcePackerPattern`: File pattern for resources (default: `*.res.*`) + - `ResourcePackerDirectory`: Resource directory name (default: `Assets`) - `ResourcePackerOutputFileName`: Output filename (default: `$(AssemblyName).dat`) ## Building (with local NuGet package) diff --git a/examples/RootNamespaceTest/Resources/config.json b/examples/RootNamespaceTest/Assets/config.json similarity index 100% rename from examples/RootNamespaceTest/Resources/config.json rename to examples/RootNamespaceTest/Assets/config.json diff --git a/examples/RootNamespaceTest/Resources/sample.txt b/examples/RootNamespaceTest/Assets/sample.txt similarity index 100% rename from examples/RootNamespaceTest/Resources/sample.txt rename to examples/RootNamespaceTest/Assets/sample.txt diff --git a/examples/RootNamespaceTest/README.md b/examples/RootNamespaceTest/README.md index 3b5bb6b..fd87bf3 100644 --- a/examples/RootNamespaceTest/README.md +++ b/examples/RootNamespaceTest/README.md @@ -11,7 +11,7 @@ When a project sets `Popcorn.Toolkit` in its .csp The project is configured with: - **AssemblyName**: RootNamespaceTest - **RootNamespace**: Popcorn.Toolkit -- **Resources**: Contains sample.txt and config.json +- **Assets**: Contains sample.txt and config.json ## Expected Behavior diff --git a/examples/RootNamespaceTest/RootNamespaceTest.csproj b/examples/RootNamespaceTest/RootNamespaceTest.csproj index c5412c5..2fcb93c 100644 --- a/examples/RootNamespaceTest/RootNamespaceTest.csproj +++ b/examples/RootNamespaceTest/RootNamespaceTest.csproj @@ -8,7 +8,7 @@ false Popcorn.Toolkit true - Resources + Assets @@ -20,12 +20,12 @@ - + - + From d440348220d12c222ae25c01b81422e48f90c78b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 8 Nov 2025 04:35:29 +0000 Subject: [PATCH 3/3] Change default directory from Assets to Attachments per feedback Co-authored-by: Soar360 <15421284+Soar360@users.noreply.github.com> --- LuYao.ResourcePacker.MSBuild/ResourcePackerTask.cs | 2 +- .../build/LuYao.ResourcePacker.MSBuild.props | 2 +- .../ResourcePackageGenerator.cs | 8 ++++---- README.md | 12 ++++++------ .../{Assets => Attachments}/config.json | 0 .../{Assets => Attachments}/message.json | 0 .../{Assets => Attachments}/template.html | 0 examples/ExampleProject/ExampleProject.csproj | 6 +++--- examples/ExampleProject/README.md | 10 +++++----- .../Lib1.Ns2.Ns3/{Assets => Attachments}/test.txt | 0 examples/Lib1.Ns2.Ns3/Lib1.Ns2.Ns3.csproj | 6 +++--- examples/Lib1/{Assets => Attachments}/test.txt | 0 examples/Lib1/Lib1.csproj | 6 +++--- examples/Lib2/{Assets => Attachments}/test.txt | 0 examples/Lib2/Lib2.csproj | 6 +++--- examples/Lib3/{Assets => Attachments}/test.txt | 0 examples/Lib3/Lib3.csproj | 6 +++--- .../{Assets => Attachments}/config.json | 0 .../{Assets => Attachments}/message.txt | 0 .../NuGetReferenceExample.csproj | 6 +++--- examples/NuGetReferenceExample/README.md | 6 +++--- .../{Assets => Attachments}/config.json | 0 .../{Assets => Attachments}/sample.txt | 0 examples/RootNamespaceTest/README.md | 2 +- examples/RootNamespaceTest/RootNamespaceTest.csproj | 6 +++--- 25 files changed, 42 insertions(+), 42 deletions(-) rename examples/ExampleProject/{Assets => Attachments}/config.json (100%) rename examples/ExampleProject/{Assets => Attachments}/message.json (100%) rename examples/ExampleProject/{Assets => Attachments}/template.html (100%) rename examples/Lib1.Ns2.Ns3/{Assets => Attachments}/test.txt (100%) rename examples/Lib1/{Assets => Attachments}/test.txt (100%) rename examples/Lib2/{Assets => Attachments}/test.txt (100%) rename examples/Lib3/{Assets => Attachments}/test.txt (100%) rename examples/NuGetReferenceExample/{Assets => Attachments}/config.json (100%) rename examples/NuGetReferenceExample/{Assets => Attachments}/message.txt (100%) rename examples/RootNamespaceTest/{Assets => Attachments}/config.json (100%) rename examples/RootNamespaceTest/{Assets => Attachments}/sample.txt (100%) diff --git a/LuYao.ResourcePacker.MSBuild/ResourcePackerTask.cs b/LuYao.ResourcePacker.MSBuild/ResourcePackerTask.cs index 3302022..9d03c77 100644 --- a/LuYao.ResourcePacker.MSBuild/ResourcePackerTask.cs +++ b/LuYao.ResourcePacker.MSBuild/ResourcePackerTask.cs @@ -16,7 +16,7 @@ public class ResourcePackerTask : Task [Required] public string AssemblyName { get; set; } - public string ResourceDirectory { get; set; } = "Assets"; + public string ResourceDirectory { get; set; } = "Attachments"; public string OutputFileName { get; set; } diff --git a/LuYao.ResourcePacker.MSBuild/build/LuYao.ResourcePacker.MSBuild.props b/LuYao.ResourcePacker.MSBuild/build/LuYao.ResourcePacker.MSBuild.props index a1c0ad3..86e4f78 100644 --- a/LuYao.ResourcePacker.MSBuild/build/LuYao.ResourcePacker.MSBuild.props +++ b/LuYao.ResourcePacker.MSBuild/build/LuYao.ResourcePacker.MSBuild.props @@ -2,7 +2,7 @@ true - Assets + Attachments diff --git a/LuYao.ResourcePacker.SourceGenerator/ResourcePackageGenerator.cs b/LuYao.ResourcePacker.SourceGenerator/ResourcePackageGenerator.cs index 91c8582..5cc4d2e 100644 --- a/LuYao.ResourcePacker.SourceGenerator/ResourcePackageGenerator.cs +++ b/LuYao.ResourcePacker.SourceGenerator/ResourcePackageGenerator.cs @@ -39,7 +39,7 @@ private static void Execute(SourceProductionContext context, Compilation compila System.Collections.Immutable.ImmutableArray resourceFiles, AnalyzerConfigOptionsProvider configOptions) { - // Get the resource directory from analyzer config (default to "Assets") + // Get the resource directory from analyzer config (default to "Attachments") var resourceDirectory = GetResourceDirectory(configOptions); // Filter additional files to only include those in the resource directory @@ -108,8 +108,8 @@ private static string GetResourceDirectory(AnalyzerConfigOptionsProvider configO } } - // Default to "Assets" - return "Assets"; + // Default to "Attachments" + return "Attachments"; } private static bool IsInResourceDirectory(string filePath, string resourceDirectory) @@ -124,7 +124,7 @@ private static bool IsInResourceDirectory(string filePath, string resourceDirect var normalizedDir = resourceDirectory.Replace('\\', '/'); // Check if the file path contains the resource directory - // Handle both with and without trailing slash (e.g., "Assets" and "Assets/") + // Handle both with and without trailing slash (e.g., "Attachments" and "Attachments/") return normalizedPath.Contains($"/{normalizedDir}/") || normalizedPath.EndsWith($"/{normalizedDir}"); } diff --git a/README.md b/README.md index 0b98372..e150e99 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ LuYao.ResourcePacker is a .NET library for packaging and accessing resource file - Pack multiple resource files into a single .dat file during build - **Intelligent tiered compression with GZip** - automatic compression with sampling for optimal space/performance -- Directory-based resource scanning (default: Assets directory) +- Directory-based resource scanning (default: Attachments directory) - MSBuild integration - Simple runtime API for resource access - Async support @@ -35,9 +35,9 @@ dotnet add package LuYao.ResourcePacker ### 1. Basic Setup -Place your resource files in the `Assets` directory: +Place your resource files in the `Attachments` directory: ``` -Assets/ +Attachments/ ├── message.json ├── config.txt └── template.html @@ -45,7 +45,7 @@ Assets/ The resources will be automatically packed into a .dat file during build. -> **Note**: The default directory was changed from `Resources` to `Assets` to avoid conflicts with C# .resx files, which typically use the `Resources` directory. If you prefer to use `Resources` or any other directory name, you can configure it in your .csproj file (see Configuration section below). +> **Note**: The default directory was changed from `Resources` to `Attachments` to avoid conflicts with C# .resx files, which typically use the `Resources` directory. If you prefer to use `Resources` or any other directory name, you can configure it in your .csproj file (see Configuration section below). ### 2. Runtime Access - Original API @@ -108,8 +108,8 @@ In your .csproj file: true - - Assets + + Attachments $(AssemblyName).dat diff --git a/examples/ExampleProject/Assets/config.json b/examples/ExampleProject/Attachments/config.json similarity index 100% rename from examples/ExampleProject/Assets/config.json rename to examples/ExampleProject/Attachments/config.json diff --git a/examples/ExampleProject/Assets/message.json b/examples/ExampleProject/Attachments/message.json similarity index 100% rename from examples/ExampleProject/Assets/message.json rename to examples/ExampleProject/Attachments/message.json diff --git a/examples/ExampleProject/Assets/template.html b/examples/ExampleProject/Attachments/template.html similarity index 100% rename from examples/ExampleProject/Assets/template.html rename to examples/ExampleProject/Attachments/template.html diff --git a/examples/ExampleProject/ExampleProject.csproj b/examples/ExampleProject/ExampleProject.csproj index ee8dcd8..97c8b94 100644 --- a/examples/ExampleProject/ExampleProject.csproj +++ b/examples/ExampleProject/ExampleProject.csproj @@ -6,7 +6,7 @@ enable enable true - Assets + Attachments $(AssemblyName).dat false @@ -20,7 +20,7 @@ - + - + diff --git a/examples/ExampleProject/README.md b/examples/ExampleProject/README.md index cfc5d0b..399d5e3 100644 --- a/examples/ExampleProject/README.md +++ b/examples/ExampleProject/README.md @@ -6,7 +6,7 @@ This is a console application demonstrating how to use the LuYao.ResourcePacker ## What This Example Demonstrates -1. **Resource File Setup**: Place resource files in an `Assets` folder (e.g., `message.json`, `config.json`, `template.html`) +1. **Resource File Setup**: Place resource files in an `Attachments` folder (e.g., `message.json`, `config.json`, `template.html`) 2. **Automatic Build-Time Packing**: During build, all `.res.*` files are automatically packed into a single `.dat` file @@ -18,7 +18,7 @@ This is a console application demonstrating how to use the LuYao.ResourcePacker ExampleProject/ ├── ExampleProject.csproj # Project configuration with ResourcePacker integration ├── Program.cs # Main application demonstrating resource access -├── Assets/ # Directory containing resource files +├── Attachments/ # Directory containing resource files │ ├── message.json # JSON resource with greeting and features │ ├── config.json # JSON resource with configuration │ └── template.html # HTML template resource @@ -44,7 +44,7 @@ ExampleProject/ ## What Happens During Build -1. The MSBuild integration scans for files in the `Assets` directory +1. The MSBuild integration scans for files in the `Attachments` directory 2. All files are packed into `ExampleProject.dat` 3. The `.dat` file is copied to the output directory 4. At runtime, the application reads resources from the `.dat` file @@ -101,7 +101,7 @@ If you're creating your own project using LuYao.ResourcePacker, follow these ste dotnet add package LuYao.ResourcePacker ``` -2. Add resource files to the `Assets` directory in your project +2. Add resource files to the `Attachments` directory in your project 3. The MSBuild integration will automatically pack your resources during build @@ -119,7 +119,7 @@ The example project uses the following MSBuild properties in `ExampleProject.csp ``` You can also customize: -- `ResourcePackerDirectory` - Custom resource directory (default: `Assets`) +- `ResourcePackerDirectory` - Custom resource directory (default: `Attachments`) - `ResourcePackerOutputFileName` - Custom output filename (default: `$(AssemblyName).dat`) ## Learn More diff --git a/examples/Lib1.Ns2.Ns3/Assets/test.txt b/examples/Lib1.Ns2.Ns3/Attachments/test.txt similarity index 100% rename from examples/Lib1.Ns2.Ns3/Assets/test.txt rename to examples/Lib1.Ns2.Ns3/Attachments/test.txt diff --git a/examples/Lib1.Ns2.Ns3/Lib1.Ns2.Ns3.csproj b/examples/Lib1.Ns2.Ns3/Lib1.Ns2.Ns3.csproj index 043718e..6b090ad 100644 --- a/examples/Lib1.Ns2.Ns3/Lib1.Ns2.Ns3.csproj +++ b/examples/Lib1.Ns2.Ns3/Lib1.Ns2.Ns3.csproj @@ -6,7 +6,7 @@ enable false true - Assets + Attachments @@ -18,12 +18,12 @@ - + - + diff --git a/examples/Lib1/Assets/test.txt b/examples/Lib1/Attachments/test.txt similarity index 100% rename from examples/Lib1/Assets/test.txt rename to examples/Lib1/Attachments/test.txt diff --git a/examples/Lib1/Lib1.csproj b/examples/Lib1/Lib1.csproj index 1ee0913..04ca9e9 100644 --- a/examples/Lib1/Lib1.csproj +++ b/examples/Lib1/Lib1.csproj @@ -6,7 +6,7 @@ enable false true - Assets + Attachments @@ -18,12 +18,12 @@ - + - + diff --git a/examples/Lib2/Assets/test.txt b/examples/Lib2/Attachments/test.txt similarity index 100% rename from examples/Lib2/Assets/test.txt rename to examples/Lib2/Attachments/test.txt diff --git a/examples/Lib2/Lib2.csproj b/examples/Lib2/Lib2.csproj index bc15448..8ccbcb7 100644 --- a/examples/Lib2/Lib2.csproj +++ b/examples/Lib2/Lib2.csproj @@ -6,7 +6,7 @@ enable false true - Assets + Attachments @@ -19,12 +19,12 @@ - + - + enable false true - Assets + Attachments @@ -19,12 +19,12 @@ - + - + enable enable true - Assets + Attachments $(AssemblyName).dat false @@ -20,7 +20,7 @@ - + - + diff --git a/examples/NuGetReferenceExample/README.md b/examples/NuGetReferenceExample/README.md index edefd22..27e4577 100644 --- a/examples/NuGetReferenceExample/README.md +++ b/examples/NuGetReferenceExample/README.md @@ -15,7 +15,7 @@ Alternatively, use the published NuGet package version once available. NuGetReferenceExample/ ├── NuGetReferenceExample.csproj # Project file with NuGet package reference ├── Program.cs # Application code -├── Assets/ +├── Attachments/ │ └── config.json # Resource file (JSON) └── README.md ``` @@ -28,11 +28,11 @@ NuGetReferenceExample/ 2. **Automatic Build Integration**: The MSBuild targets and props files are automatically imported by NuGet, so you don't need to manually configure any build tasks. -3. **Resource Directory**: Files in the `Assets` directory are automatically packed into a `.dat` file during build. +3. **Resource Directory**: Files in the `Attachments` directory are automatically packed into a `.dat` file during build. 4. **Configuration**: You can customize the behavior using MSBuild properties: - `ResourcePackerEnabled`: Enable/disable resource packing (default: `true`) - - `ResourcePackerDirectory`: Resource directory name (default: `Assets`) + - `ResourcePackerDirectory`: Resource directory name (default: `Attachments`) - `ResourcePackerOutputFileName`: Output filename (default: `$(AssemblyName).dat`) ## Building (with local NuGet package) diff --git a/examples/RootNamespaceTest/Assets/config.json b/examples/RootNamespaceTest/Attachments/config.json similarity index 100% rename from examples/RootNamespaceTest/Assets/config.json rename to examples/RootNamespaceTest/Attachments/config.json diff --git a/examples/RootNamespaceTest/Assets/sample.txt b/examples/RootNamespaceTest/Attachments/sample.txt similarity index 100% rename from examples/RootNamespaceTest/Assets/sample.txt rename to examples/RootNamespaceTest/Attachments/sample.txt diff --git a/examples/RootNamespaceTest/README.md b/examples/RootNamespaceTest/README.md index fd87bf3..866f8be 100644 --- a/examples/RootNamespaceTest/README.md +++ b/examples/RootNamespaceTest/README.md @@ -11,7 +11,7 @@ When a project sets `Popcorn.Toolkit` in its .csp The project is configured with: - **AssemblyName**: RootNamespaceTest - **RootNamespace**: Popcorn.Toolkit -- **Assets**: Contains sample.txt and config.json +- **Attachments**: Contains sample.txt and config.json ## Expected Behavior diff --git a/examples/RootNamespaceTest/RootNamespaceTest.csproj b/examples/RootNamespaceTest/RootNamespaceTest.csproj index 2fcb93c..cab5fbf 100644 --- a/examples/RootNamespaceTest/RootNamespaceTest.csproj +++ b/examples/RootNamespaceTest/RootNamespaceTest.csproj @@ -8,7 +8,7 @@ false Popcorn.Toolkit true - Assets + Attachments @@ -20,12 +20,12 @@ - + - +