0
我有以下文件結構:「MySameNameFile * *」文件包括/基於子文件夾名排除
\RootFolder\
\RootFolder\SubFolder1\
\RootFolder\SubFolder1\SubfolderA\
\RootFolder\SubFolder1\SubfolderA\bin\
\RootFolder\SubFolder1\SubfolderA\bin\MySameNameFile1.txt
\RootFolder\SubFolder1\SubfolderA\bin\MySameNameFile2.txt
\RootFolder\SubFolder1\SubfolderA\bin\MySameNameFile3.txt
\RootFolder\SubFolder1\SubfolderA\bin\DontWantFile.txt
\RootFolder\SubFolder1\SubfolderA\obj\
\RootFolder\SubFolder1\SubfolderA\obj\MySameNameFile1.txt
\RootFolder\SubFolder1\SubfolderA\obj\MySameNameFile2.txt
\RootFolder\SubFolder1\SubfolderA\obj\MySameNameFile3.txt
\RootFolder\SubFolder2\
\RootFolder\SubFolder2\SubfolderB\
\RootFolder\SubFolder2\SubfolderB\bin\
\RootFolder\SubFolder2\SubfolderB\bin\MySameNameFile1.txt
\RootFolder\SubFolder2\SubfolderB\bin\MySameNameFile2.txt
\RootFolder\SubFolder2\SubfolderB\bin\MySameNameFile3.txt
\RootFolder\SubFolder2\SubfolderB\bin\DontWantFile.txt
\RootFolder\SubFolder2\SubFolder2\obj\
\RootFolder\SubFolder2\SubfolderB\obj\MySameNameFile1.txt
\RootFolder\SubFolder2\SubfolderB\obj\MySameNameFile2.txt
\RootFolder\SubFolder2\SubfolderB\obj\MySameNameFile3.txt
\RootFolder\SubFolder3\
\RootFolder\SubFolder3\SubfolderC\
\RootFolder\SubFolder3\SubfolderC\bin\
\RootFolder\SubFolder3\SubfolderC\bin\MySameNameFile1.txt
\RootFolder\SubFolder3\SubfolderC\bin\MySameNameFile2.txt
\RootFolder\SubFolder3\SubfolderC\bin\MySameNameFile3.txt
\RootFolder\SubFolder3\SubfolderC\bin\DontWantFile.txt
\RootFolder\SubFolder3\SubfolderC\obj\
\RootFolder\SubFolder3\SubfolderC\obj\MySameNameFile1.txt
\RootFolder\SubFolder3\SubfolderC\obj\MySameNameFile2.txt
\RootFolder\SubFolder3\SubfolderC\obj\MySameNameFile3.txt
我試圖讓所有的文件,而不是那些在\ OBJ \目錄。
我已經試過:
<PropertyGroup>
<MyRootFolderVariable>.\RootFolder\</MyRootFolderVariable>
</PropertyGroup>
<Target Name="MyTarget">
<ItemGroup>
<MyExcludeFiles Include="$(MyRootFolderVariable)\**\obj\*.*" />
</ItemGroup>
<ItemGroup>
<MyIncludeFiles Include="$(MyRootFolderVariable)\**\*MySameNameFile*.txt" Exclude="@(MyExcludeFiles)" />
</ItemGroup>
<PropertyGroup>
<BinFilesButNoObjFiles>@(MyIncludeFiles->'"%(fullpath)"' , ' ')</BinFilesButNoObjFiles>
</PropertyGroup>
<Message Text="BinFilesButNoObjFiles=$(BinFilesButNoObjFiles)"/>
<Message Text=" "/>
<Message Text=" "/>
</Target>
文件我後:
\RootFolder\SubFolder1\SubfolderA\bin\MySameNameFile1.txt
\RootFolder\SubFolder1\SubfolderA\bin\MySameNameFile2.txt
\RootFolder\SubFolder1\SubfolderA\bin\MySameNameFile3.txt
\RootFolder\SubFolder2\SubfolderB\bin\MySameNameFile1.txt
\RootFolder\SubFolder2\SubfolderB\bin\MySameNameFile2.txt
\RootFolder\SubFolder2\SubfolderB\bin\MySameNameFile3.txt
\RootFolder\SubFolder3\SubfolderC\bin\MySameNameFile1.txt
\RootFolder\SubFolder3\SubfolderC\bin\MySameNameFile2.txt
\RootFolder\SubFolder3\SubfolderC\bin\MySameNameFile3.txt
這是什麼問題?代碼看起來非常好。 – stijn