-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSupportAdditionalFiles.targets
More file actions
54 lines (46 loc) · 3.95 KB
/
Copy pathSupportAdditionalFiles.targets
File metadata and controls
54 lines (46 loc) · 3.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<Project TreatAsLocalProperty="IsCrossTargetingProject;ConfigDir">
<PropertyGroup>
<IsCrossTargetingProject Condition="$(TargetFrameworks) != ''">true</IsCrossTargetingProject>
</PropertyGroup>
<Target Name="UpdateEditorConfig" BeforeTargets="DispatchToInnerBuilds;BeforeBuild;CSharpierFormat" Condition=" '$(IsCrossTargetingProject)' == '$(IsCrossTargetingBuild)' ">
<PropertyGroup>
<ConfigDir>$(SolutionDir)</ConfigDir>
<ConfigDir Condition=" ('$(ConfigDir)' == '' or '$(ConfigDir)' == '*Undefined*') and '$(MSBuildProjectDirectory)' != ''"
>$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), Directory.Packages.props))</ConfigDir
>
<ConfigDir Condition=" ('$(ConfigDir)' == '' or '$(ConfigDir)' == '*Undefined*') and '$(ProjectDir)' != '' "
>$([MSBuild]::GetDirectoryNameOfFileAbove($(ProjectDir), Directory.Packages.props))</ConfigDir
>
</PropertyGroup>
<PropertyGroup>
<EditorConfigSource>$(MSBuildThisFileDirectory)..\configurations\template.editorconfig</EditorConfigSource>
<EditorConfigDest>$([MSBuild]::NormalizePath('$(ConfigDir)', '.editorconfig'))</EditorConfigDest>
<EditorConfigCopyCommand Condition="'$(OS)' == 'Windows_NT'"
>pwsh -NoProfile -NonInteractive -Command "Copy-Item -Path '$(EditorConfigSource)' -Destination '$(EditorConfigDest)' -Force -ErrorAction SilentlyContinue"</EditorConfigCopyCommand
>
<EditorConfigCopyCommand Condition="'$(OS)' != 'Windows_NT'">bash -c "cp -f '$(EditorConfigSource)' '$(EditorConfigDest)' 2>/dev/null || true"</EditorConfigCopyCommand>
<CSharpierIgnoreSource>$(MSBuildThisFileDirectory)..\configurations\template.csharpierignore</CSharpierIgnoreSource>
<CSharpierIgnoreDest>$([MSBuild]::NormalizePath('$(ConfigDir)', '.csharpierignore'))</CSharpierIgnoreDest>
<CsharpierIgnoreCopyCommand Condition="'$(OS)' == 'Windows_NT'"
>pwsh -NoProfile -NonInteractive -Command "Copy-Item -Path '$(CsharpierIgnoreSource)' -Destination '$(CsharpierIgnoreDest)' -Force -ErrorAction SilentlyContinue"</CsharpierIgnoreCopyCommand
>
<CsharpierIgnoreCopyCommand Condition="'$(OS)' != 'Windows_NT'">bash -c "cp -f '$(CsharpierIgnoreSource)' '$(CsharpierIgnoreDest)' 2>/dev/null || true"</CsharpierIgnoreCopyCommand>
<GitIgnoreSource>$(MSBuildThisFileDirectory)..\configurations\template.gitignore</GitIgnoreSource>
<GitIgnoreDest>$([MSBuild]::NormalizePath('$(ConfigDir)', '.gitignore'))</GitIgnoreDest>
<GitIgnoreCopyCommand Condition="'$(OS)' == 'Windows_NT'"
>pwsh -NoProfile -NonInteractive -Command "Copy-Item -Path '$(GitIgnoreSource)' -Destination '$(GitIgnoreDest)' -Force -ErrorAction SilentlyContinue"</GitIgnoreCopyCommand
>
<GitIgnoreCopyCommand Condition="'$(OS)' != 'Windows_NT'">bash -c "cp -f '$(GitIgnoreSource)' '$(GitIgnoreDest)' 2>/dev/null || true"</GitIgnoreCopyCommand>
<GitAttributesSource>$(MSBuildThisFileDirectory)..\configurations\template.gitattributes</GitAttributesSource>
<GitAttributesDest>$([MSBuild]::NormalizePath('$(ConfigDir)', '.gitattributes'))</GitAttributesDest>
<GitAttributesCopyCommand Condition="'$(OS)' == 'Windows_NT'"
>pwsh -NoProfile -NonInteractive -Command "Copy-Item -Path '$(GitAttributesSource)' -Destination '$(GitAttributesDest)' -Force -ErrorAction SilentlyContinue"</GitAttributesCopyCommand
>
<GitAttributesCopyCommand Condition="'$(OS)' != 'Windows_NT'">bash -c "cp -f '$(GitAttributesSource)' '$(GitAttributesDest)' 2>/dev/null || true"</GitAttributesCopyCommand>
</PropertyGroup>
<Exec Command="$(EditorConfigCopyCommand)" ContinueOnError="true" IgnoreExitCode="true" />
<Exec Command="$(CsharpierIgnoreCopyCommand)" ContinueOnError="true" IgnoreExitCode="true" />
<Exec Command="$(GitIgnoreCopyCommand)" ContinueOnError="true" IgnoreExitCode="true" />
<Exec Command="$(GitAttributesCopyCommand)" ContinueOnError="true" IgnoreExitCode="true" />
</Target>
</Project>