我有以下项目结构。
我希望将此内容复制到目标目录,并按以下结构排列。
我在.csproj中使用以下脚本:
SolutionDir
-src
-Feature
|---Feature.A
|-----code
|-------ViewA
|---------FileA.cshtml
|---Feature.B
|-----code
|-------ViewB
|---------FileB.cshtml
我希望将此内容复制到目标目录,并按以下结构排列。
-OutputDir
|--code
|----ViewA
|------ViewA.cshtml
|----ViewB
|------ViewB.cshtml
我在.csproj中使用以下脚本:
<Target Name="AfterBuild">
<ItemGroup>
<FeatureViewFiles
Include="$(SolutionDir)src\Feature\Feature.*\code\**\*.cshtml" />
</ItemGroup>
<Copy
SkipUnchangedFiles="true"
SourceFiles="@(FeatureViewFiles)"
DestinationFolder="OutputDir\code\%(RecursiveDir)%(Filename)%(Extension)" />
</Target>
现在因为我的Include
中通配符从Feature.*
开始,RecursiveDir
指令输出Feature.A\code\ViewA\
,而我真正想要的是从code
文件夹下的文件夹结构。您有什么想法可以实现这一点吗?