|
40 | 40 | Inputs="@(CopyAndSubstituteText)" |
41 | 41 | Outputs="@(CopyAndSubstituteText->'$(OutDir)%(TargetFilename)')" > |
42 | 42 |
|
43 | | - <PropertyGroup> |
44 | | - <FileText> |
45 | | - $([System.Text.RegularExpressions.Regex]::Replace($([System.IO.File]::ReadAllText("%(CopyAndSubstituteText.FullPath)")), "%(CopyAndSubstituteText.Pattern1)", "%(CopyAndSubstituteText.Replacement1)")) |
46 | | - </FileText> |
47 | | - |
48 | | - <FileText Condition ="'%(CopyAndSubstituteText.Pattern2)' != ''"> |
49 | | - $([System.Text.RegularExpressions.Regex]::Replace($(FileText), "%(CopyAndSubstituteText.Pattern2)", "%(CopyAndSubstituteText.Replacement2)")) |
50 | | - </FileText> |
51 | | - </PropertyGroup> |
52 | | - <WriteLinesToFileFile="$(OutDir)%(CopyAndSubstituteText.TargetFilename)"Lines="$(FileText)"Overwrite="true" /> |
| 43 | + <ItemGroup> |
| 44 | + <ResultsInclude="@(CopyAndSubstituteText->'$(OutDir)%(TargetFilename)')"> |
| 45 | + <Lines> |
| 46 | + $([System.Text.RegularExpressions.Regex]::Replace($([System.IO.File]::ReadAllText("%(CopyAndSubstituteText.FullPath)")), "%(CopyAndSubstituteText.Pattern1)", "%(CopyAndSubstituteText.Replacement1)")) |
| 47 | + </Lines> |
| 48 | + <Lines Condition ="'%(CopyAndSubstituteText.Pattern2)' != ''"> |
| 49 | + $([System.Text.RegularExpressions.Regex]::Replace($(FileText), "%(CopyAndSubstituteText.Pattern2)", "%(CopyAndSubstituteText.Replacement2)")) |
| 50 | + </Lines> |
| 51 | + </Results> |
| 52 | + </ItemGroup> |
| 53 | + |
| 54 | + <WriteLinesToFileFile="$(OutDir)%(Results.Filename)%(Results.Extension)"Lines="%(Results.Lines)"Overwrite="true" /> |
53 | 55 | </Target> |
54 | 56 |
|
55 | 57 | <!-- |
|