-
Notifications
You must be signed in to change notification settings - Fork 69
Expand file tree
/
Copy pathDirectory.Build.targets
More file actions
72 lines (65 loc) · 3.27 KB
/
Directory.Build.targets
File metadata and controls
72 lines (65 loc) · 3.27 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<Project>
<!-- Some assemblies have strong names. We should resign them after AspectInjector before publishing on NuGet.
Otherwise, they won't pass the `sn.exe -vf <assembly>` check -->
<Target Name="Allure_SetAssemblyTimestampBeforeAspectInjection"
AfterTargets="CoreCompile"
BeforeTargets="$(_InjectAspectsDependsOn)">
<PropertyGroup>
<Allure_AssemblyTimestampBeforeAspectInjection>%(IntermediateAssembly.ModifiedTime)</Allure_AssemblyTimestampBeforeAspectInjection>
</PropertyGroup>
</Target>
<Target Name="Allure_SetAssemblyTimestampAfterAspectInjection"
AfterTargets="AspectInjector_InjectAspects;InjectAspects"
BeforeTargets="Allure_UpdateStrongNameSignatures">
<PropertyGroup>
<Allure_AssemblyTimestampAfterAspectInjection>%(IntermediateAssembly.ModifiedTime)</Allure_AssemblyTimestampAfterAspectInjection>
</PropertyGroup>
</Target>
<!--
Only resign the assembly if all four conditions are met:
1. We're running on Windows (sn.exe is a Windows-only utility).
2. The assembly's been signed during the compilation.
3. A path to sn.exe is given.
4. AspectInjector has modified the assembly.
-->
<Target Name="Allure_UpdateStrongNameSignatures"
Condition=" '$(OS)' == 'Windows_NT'
And '$(SignAssembly)' == 'true'
And Exists('$(AssemblyOriginatorKeyFile)')
And Exists('$(Allure_SnExePath)')
And '$(Allure_AssemblyTimestampBeforeAspectInjection)' != '$(Allure_AssemblyTimestampAfterAspectInjection)'"
AfterTargets="AspectInjector_InjectAspects;InjectAspects"
BeforeTargets="_TimeStampAfterCompile;AfterCompile">
<Exec UseUtf8Encoding="Always"
StdOutEncoding="UTF-8"
StdErrEncoding="UTF-8"
Command=""$(Allure_SnExePath)" -Ra "%(IntermediateAssembly.FullPath)" "$(AssemblyOriginatorKeyFile)""
/>
</Target>
<!-- A hacky way to skip AspectInjector's own re-signing logic,
which doesn't work on Linux/Mac (unless there is an sn binary in PATH).
It's not relevant for AspectInjector 2.9.0+ and should be removed as
soon as we upgrade. -->
<Target Name="Allure_DisableAspectInjector"
BeforeTargets="_ASI_ResignAssembly"
AfterTargets="_ASI_InjectAspectsCore"
Condition=" '$(_InjectionNeeded)' == 'true' ">
<PropertyGroup>
<Allure_ShouldEnableAspectInjector>true</Allure_ShouldEnableAspectInjector>
<_InjectionNeeded>false</_InjectionNeeded>
</PropertyGroup>
</Target>
<Target Name="Allure_EnableAspectInjector"
BeforeTargets="_ASI_TouchTimestampFile"
AfterTargets="_ASI_ResignAssembly"
Condition=" '$(Allure_ShouldEnableAspectInjector)' == 'true' ">
<PropertyGroup>
<_InjectionNeeded>true</_InjectionNeeded>
</PropertyGroup>
</Target>
<Target Name="Allure_GenerateTestSamples" />
<Target Name="Allure_BuildTestSamples" />
<Target Name="Allure_RunTestSamples" />
<Target Name="Allure_CleanTestSamples" />
<Target Name="Allure_DeleteTestSamples" />
</Project>