Skip to content

Commit bd90124

Browse files
committed
Lib1.Ns2.Ns3
1 parent 71edde8 commit bd90124

File tree

4 files changed

+65
-0
lines changed

4 files changed

+65
-0
lines changed

LuYao.ResourcePacker.slnx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<Folder Name="/examples/">
88
<Project Path="examples/App1/App1.csproj" />
99
<Project Path="examples/ExampleProject/ExampleProject.csproj" />
10+
<Project Path="examples/Lib1.Ns2.Ns3/Lib1.Ns2.Ns3.csproj" />
1011
<Project Path="examples/Lib1/Lib1.csproj" />
1112
<Project Path="examples/Lib2/Lib2.csproj" />
1213
<Project Path="examples/Lib3/Lib3.csproj" />

examples/Lib1.Ns2.Ns3/Class1.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
namespace Lib1.Ns2.Ns3
2+
{
3+
public class Class1
4+
{
5+
6+
}
7+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<Nullable>enable</Nullable>
7+
<IsPackable>false</IsPackable>
8+
<ResourcePackerEnabled>true</ResourcePackerEnabled>
9+
<ResourcePackerPattern>*.res.*</ResourcePackerPattern>
10+
</PropertyGroup>
11+
12+
<ItemGroup>
13+
<ProjectReference Include="..\..\LuYao.ResourcePacker\LuYao.ResourcePacker.csproj" />
14+
<ProjectReference Include="..\..\LuYao.ResourcePacker.MSBuild\LuYao.ResourcePacker.MSBuild.csproj" />
15+
<ProjectReference Include="..\..\LuYao.ResourcePacker.SourceGenerator\LuYao.ResourcePacker.SourceGenerator.csproj"
16+
OutputItemType="Analyzer"
17+
ReferenceOutputAssembly="false" />
18+
</ItemGroup>
19+
20+
<ItemGroup>
21+
<None Include="Resources\**\*.res.*" CopyToOutputDirectory="Never" />
22+
</ItemGroup>
23+
24+
<!-- Add resource files as AdditionalFiles for source generator -->
25+
<ItemGroup>
26+
<AdditionalFiles Include="Resources\**\*.res.*" Visible="false" />
27+
</ItemGroup>
28+
29+
<!-- For development with project references, manually import and override assembly path -->
30+
<UsingTask TaskName="LuYao.ResourcePacker.MSBuild.ResourcePackerTask"
31+
AssemblyFile="..\..\LuYao.ResourcePacker.MSBuild\bin\$(Configuration)\netstandard2.0\LuYao.ResourcePacker.MSBuild.dll" />
32+
33+
<Import Project="..\..\LuYao.ResourcePacker.MSBuild\build\LuYao.ResourcePacker.MSBuild.props" />
34+
35+
<!-- Override the targets to use local source generator for development -->
36+
<Target Name="PackResources" BeforeTargets="AssignTargetPaths" Condition="'$(ResourcePackerEnabled)' == 'true'">
37+
<PropertyGroup>
38+
<ResourcePackerOutputFileName Condition="'$(ResourcePackerOutputFileName)' == ''">$(AssemblyName).dat</ResourcePackerOutputFileName>
39+
</PropertyGroup>
40+
<ResourcePackerTask
41+
ProjectDir="$(ProjectDir)"
42+
OutputPath="$(OutputPath)"
43+
AssemblyName="$(AssemblyName)"
44+
ResourcePattern="$(ResourcePackerPattern)"
45+
OutputFileName="$(ResourcePackerOutputFileName)" />
46+
47+
<!-- Add .dat file to None so it gets copied to referencing projects -->
48+
<ItemGroup>
49+
<None Include="$(OutputPath)$(ResourcePackerOutputFileName)">
50+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
51+
<Link>$(ResourcePackerOutputFileName)</Link>
52+
</None>
53+
</ItemGroup>
54+
</Target>
55+
56+
</Project>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Test resource content for Lib1

0 commit comments

Comments
 (0)